Cabbage Logo
Back to Cabbage Site

New synth beta : Morpheur

Sounds like a good idea.

Hello Rory,
it seems that there is something weird with path and \ symbol in last build I made. The console does not show these symbol.

I also attach a simple csd for showing the trouble with combo preset / soundfiler and init phase.

In order to show the trouble :

  • change the code to init the string with valid file name to populate the soundfiler in the following instrument

    instr InitWav
    chnset “AKWF_0212.wav”,“filenameOscA”

Start the instrument. It shows the init wav file
then load another file into soundfiler and save the preset, you can make a few preset.

Stop and Quit the instrument.
Restart it, there should be an init file loaded and few preset available.

Try to load one of the preset : the preset are not loaded, only the init file is present.
Maybe I do something wrong but I don’t see what.

cabbage_soundfiler.csd (3.2 KB)


Thanks, I also see the issue. It will be next week before I get a chance to look into this. I would like to know if this actually ever worked? I don’t have time now, but perhaps you could try building an earlier version and see if it ever worked? I fear it may never have actually worked…

Hello Rory,
Do you have any idea the date of the version I should try to rebuild ? I will do it.
Also, I will open a new thread to list bugs as of the last package I built.

I don’t. Do you think this ever worked?

I don’t think so.

In that case you needn’t bother looking back in time :wink: I hope to get a chance to look at this tomorrow.

I can’t figure out why your code doesn’t work. I wonder if Csound is somehow preventing the string channel from updating. The few things I did try have led me to segfaults in the Csound source code. I did find a workaround. I’ve posted the relevant bits below. Be sure to update your file path. Basically what I did was replace the INIT instrument you had, and simply called the “LoadSoundFile” instrument on startup, passing the initial soundfile as a p-field. I also updated the subsequent calls to that instrument whenever event is used.

I’ll have to dig deeper into the reason it’s not working but I think it may have something to do with the fact that all strings in Csound are technically i-rate, which is why one needs to use special opcodes to update them. Otherwise we could just use the assignment operator ‘=’. Somewhere in my head is the answer I think. I just need to spend some time there searching for it :joy:

gSfilepathOscA init ""

instr	LoadSoundFile	; load sound file
SFilePath strcpy p5
    if p4 == 1 then
   ;     Sfile strcpy gSfilepathOscA
        if filevalid(SFilePath) ==1 then
             gitableOscA	ftgen	901,0,0,1,SFilePath,0,0,0		; load sound file into a GEN 01 function table 
             gichansOscA	filenchnls	SFilePath			; derive the number of channels (mono=1,stereo=2) in the sound file
             giReadyOscA 	=	1					; if no string has yet been loaded giReady will be zero
             gkTabLenOscA	init		ftlen(gitableOscA)/gichansOscA		; table length in sample frames         	
             Smessage sprintfk "file(%s)", SFilePath			; print sound file to viewer
             prints Smessage
             chnset Smessage, "filerOscA"
            printks "File no valid \n",0

instr 2 
;- Region: Load soundfile 
 if changed:k(chnget:S("filenameOscA"))==1 then 
     gSfilepathOscA	    chnget	"filenameOscA"
  kNewFileTrg1  changed	gSfilepathOscA	    ; if a new file is loaded generate a trigger
  if kNewFileTrg1 == 1 then		; if user has requested a preset or new file...	
    String  sprintfk {{i "LoadSoundFile" 0 0 1 "%s" }}, gSfilepathOscA
    scoreline String, 1     
  if changed:k(chnget:k("PresetCombo"))==1 then
    SfilepathOscA	    chnget	"filenameOscA"
    String  sprintfk {{i "LoadSoundFile" 0 0 1 "%s" }}, gSfilepathOscA
    scoreline String, 1  

;causes Csound to run for about 7000 years...
i "LoadSoundFile" 0 0 1 "/home/rory/Desktop/shortSample.wav"
i 2 0.01 z

That is indeed a work around !!! :grin: Thank you !
It is difficult to understand. Please tell me if I am wrong.
What is done is to write force loading the soundfile as a score line whenever this is appropriate, exactly as it would happen at the init time… Right or Wrong ?

TLTT (too late to think!)
Hey I just made up a new acronym! All jokes aside, I’ll take a look at this tomorrow and see if I can figure out what’s happening. It certainly has my attention!

In the example I posted I never directly set a string value for the “filenameOscA” channel. Something odd is going on with chnset but I can’t seem to make a minimal example. Time for more digging…

[edit] After some extensive tests it seems that string channels cannot be updated at perf-time using the host API. I’m pretty sure we should be able to do this. I’ve posted an issue on the Csound github repo. Let’s see what they can do.

I think I’ve found the source of this problem. I’ll try to push through a fix tomorrow.

Ohh thank you! Looking forward to seeing it

While I’m at it I’ll see if I look into the MIDI issue.

@rorywalsh @gsenna
Thank you for your efforts helping debugging.
I just uploaded a slightly improved version in the first post. It seems to eat less CPU.Please use this one instead of prevous one.

Thanks to the help of @rorywalsh, @gsenna and @iainmccurdy , I am pleased to announce that

  • The Morpheur synth is updated, please see first post of this thread for what is new.
  • and also you will find thereafter a demo of this synth. So enjoy the sounds.

About the demo : thanks to Cabbage 2, the Morhpeur synth was exported as VST. I created 6 tracks in Reaper, each of them using a different preset of Morpheur synth. There is no post-production.
Your feedback is more than welcome about the sounds and the synth.

New update for saving more CPU. See discussion there One or many instruments?

There is a new version today. Please feel free to play with it !

One small bug in Tone and aTone corrected.

Final version is out. See first post.
Feed back is welcome.