Cabbage Logo
Back to Cabbage Site

CsoundUnity Package (UPM) development

yes I did

:confused: :thinking:

Iā€™m a bit late to this, but whatā€™s the difference between these two Csound packages?

Should be the same .framework, I donā€™t remember having modified anything!

Thatā€™s really odd? I canā€™t think what might be causing the problem there.

I pushed a new feature, now itā€™s possible to edit the csd from the inspector and save the changes on the file.
Question for @rorywalsh: how to highlight the code? :grin:

It looks itā€™s going to rain here tomorrow, so I guess Iā€™ll have some time for this! Iā€™m looking forward to checking out this new feature. Btw, you are familiar with the Csound extension for VS Code? Or do you use Mono?

I use Visual Studio for Mac for C# and Cabbage/CsoundQT for Csound code.
I found the Csound tokenizer of Cabbage (https://github.com/rorywalsh/cabbage/blob/master/Source/CodeEditor/CsoundTokeniser.h)
and I was thinking of porting it to C# someday.
Btw, for now it is useful to have the chance to edit the csd ā€˜on the flyā€™, but in the future a basic Csound editor in the inspector could be a great feature!

Iā€™m sure there are easier ways to do this. I used various syntax highlighting libraries in JS, Iā€™m sure there must exist a few for C# too?

I donā€™t know any, Iā€™ll do a search!
Let me know if you have some ideas!

Iā€™ve just pulled the latest dev2 tip now. Iā€™m not seeing any way to edit the .csd file from the editor however?

Iā€™ve been sidetracked with work this past week or so. Where are we at now in terms of bigger picture? Are most of the main features we planned working Ok now? Is the FileWatcher only testing CSD files on Windows at the moment? I can see about getting that working on OSX too? Then I might try another example to see how it works. An example that reads and writes to function tables should be a good test case!

Iā€™ll try to recap:

Build

  • Build works on Windows.
  • Build doesnā€™t work on macOS but there is a workaround.
  • Build not tested on Android (we should probably remove some old code)

Usage

  • Csound works on Editor for Windows and macOS

  • Inspector shows Control Channels and Audio Channels

  • Control channels values are serialized and saved

  • Unity Presets can be used

  • Edit CSD:
    Itā€™s possible to edit the csd and save the changes from the CsoundUnity inspector.
    You should see something like this:


    Notice that the tabs (\t) have some problems, but editing and saving works on macOS.

  • Foldable sections to have a cleaner inspector

(EDIT)

  • CsoundFileWatcher works on macOS, I havenā€™t tested it on Windows

TODO

  • Some work has to be done to parse other popular Cabbage Widgets, especially

    • groupbox
    • label
    • radio button
    • keyboard?
  • 0dbfs bug: itā€™s not working on macOS, it always reports 1 even if thereā€™s no 0dbfs set. Lots of older csound files are using 32767 as sample max level, very dangerous!

(EDIT)

  • Bug: Unity crashes on exit! (maybe related to CsoundFileWatcher)

I can take a look at that 0dbfs bug. Itā€™s definitely one that needs fixing! Iā€™m not seeing any way to edit the csd files though? Iā€™m working off the latest dev2 tip?

really strange!
Try to reset the inspector, but it should work even without :thinking:

EDIT: Notice I put a LogWarning in ProcessBlock when sample value goes over 10.0 (and set the sample value to 0.0), as temporary workaround

this is the last commit:

(well of course not pressing play but pressing the save csd button :sweat_smile:)

Iā€™ll try this. Note I just merge dev2 back into develop. I hope thatā€™s Ok. All the dev2 history will not be accessible though the develop branch so i think I will probably delete dev2 in the future. Iā€™ll be sad to see it go. As far as git goes, it was one of the better branches Iā€™ve worked on!! :laughing:

Ok thatā€™s fair!
Yes it will be missed, I think I never reached 150 commits on a branch :sweat_smile:
Is it all ok now? Iā€™ll pull the develop branch now to do some tests.

We should mark this day every year with a glass of whiskey and a nice cigar :laughing:

2 Likes

Still no way to edit the .csd file as far as I can see?

You should do it from the inspector of the CsoundUnity instance where you set it!
(sorry it wasnā€™t clear)

Oh yes, I see it now. Oh this looks like itā€™s going to be a complete distraction!!

Are there any existing code editor components that we can use? If not I think any time spent on this might be a waste of effort :see_no_evil: Weā€™ll never match VS Code for functionalityā€¦