Skip to content
Giovanni Bedetti edited this page Dec 11, 2022 · 4 revisions

Setup a development project

If you want to help us develop CsoundUnity, you should create a Unity project and place the CsoundUnity package in a specific folder. You will need git to be able to pull the repository and then push your changes. You will also need a GitHub account to be able to fork the repository.

Click on Fork to create your own version of CsoundUnity. After creating the Unity project (any Unity version and operating system is ok), open the folder where the project has been created, and look for the Packages folder. Create a CsoundUnity folder in that folder.

Now, using your git client of choice, clone the CsoundUnity package in the created folder, using this git link:

https://github.com/< your-user-name >/CsoundUnity.git

After cloning is completed, go back to the Unity project. You will see it importing (it should be quick so you could miss it), but if you open the Package Manager from the Window menu, you should see CsoundUnity under the Custom section.
You can then use the package like you would do normally, importing it using git or a zip file (so this means you can import the existing samples in the Unity project too).

Making changes

Now have a look at the Project View in Unity, scroll down to Packages, and you will see the CsoundUnity files. If you double click any of those, the file will open (with your IDE of choice), and you will see that they are now part of the solution that gets created by Unity, meaning that you can edit and navigate them like all the other scripts in your project.

Do your changes, and when you’re ready, push to your repository. Maybe create a specific branch for each feature you want to implement / improve.

Pull requests

When you’re happy with the result, go to https://github.com/< your-user-name >/CsoundUnity, click on Pull requests, and then click on New pull request. After selecting the right branches on both the repos click on Create Pull Request. We will review your changes and if everything is good we will approve them, and add you as a contributor.

Submit a sample

If you have an idea for a sample scene that should be in the CsoundUnity samples collection, feel free to submit it with a pull request. We're very happy to receive new examples.

The limitations of the samples that can be submitted are:

  • no dependencies to other packages or scripts, everything should be contained in a single folder
  • no Unity project settings should be changed at any time
  • additional asset files should be the smallest possible: we want to showcase CsoundUnity capabilities, we're not focusing on fancy visuals.
  • possibly they should work on every supported platform (this is not really a requirement but a nice to have)
  • Audio assets should be contained in a Resources folder inside the submitted folder and loaded with one of the GetSamples methods

Create a sample

Create a folder in your Unity project (any location is fine), with a descriptive name. Usually our folder names are the categories of the samples, meaning that a single folder can contain multiple Unity scenes, showcasing different behaviours within the same context.
Create there your scene(s) and their related scripts.

Please use namespaces to avoid conflicts with other samples. An example for a namespace could be:

CsoundUnity.Samples.< your sample folder name >

When you're happy with your scene(s), copy the whole containing folder to the Samples~ folder inside the CsoundUnity package. This is a special folder that won't appear in the Unity editor, hence it will be possible to import the samples back using the Package Manager. To be able to list the folder under the CsoundUnity samples list, you will have to modify the package.json file in the CsoundUnity package folder. There you should add this structure to the existing list:

{
    "displayName": "Your sample descriptive name",
    "description": "A brief description of what your sample does",
    "path": "Samples~/< your chosen folder name >"
}

If you want to make changes to the scene(s) after copying, you can reimport the sample in the project using the Package Manager (delete the existing folder first). You will see it being imported in your Unity project at:

Assets\Samples\CsoundUnity\< current CsoundUnity version >\< your sample folder name >

Make your changes, and copy the whole folder back to the Samples~ folder again.

Now you're ready to create a pull request to submit your new scene(s).

Clone this wiki locally