Cabbage Logo
Back to Cabbage Site

Loading files onto soundfiler (Cabbage 2.9.227)

heyo
EliottFromET here

i’m having trouble loading files onto the soundfiler window.
i’m using cabbageCreate,
but even without cabbageCreate
(and with Cabbage examples)
i’m having the same issue.
the audio will load and play,
but it just won’t display.

the same code i have,
if i run on Cabbage 2.8.0
it works perfectly fine:
the soundfiler window will display the audio file on 2.8.0.

and i would be okay with this…
if 2.8.0 would display images using cabbageCreate!!!
(which it doesn’t)

bug fix time perhaps?!?!

ALSO, for some odd reason,
currently i get no audio from any .csd file on any version of Cabbage.
if i click the “Test” button in the Settings window, i get audio.
but nothing else works!
using different output ports, tried different buffer sizes, sample rates, restarted my computer…
still nothing!

here is my code in question:
simpLsampLr.zip (3.7 MB)

HOPE THIS CAN ALL BE FIXED OR IF MY VEIL OF IGNORANCE CAN BE LIFTED IN THIS SITUATION! :slight_smile:

Hi @EliottFromET, welcome to the forum. I’m sorry to hear you’re having issues, but I think it’s a simple fix. I didn’t have time to test, but I think the problem is with this line:

image

Cabbage had to change how it deals with file paths. It was mentioned here in this post which you most likely missed:

In your case you need to construct an absolute path. This can be done using the code provided in that post.

What OS are you using? I’ve had reports of this in the past, whereby for some reason the instruments aren’t being patched to the output in the Cabbage graph. Can you open your settings and make sure this setting is checked, as in the image below:

image

If you open the Cabbage patcher the instrument should be connected to the main outs. For example:

If it’s not connected you won’t get any audio. I don’t know why Cabbage sometimes disables this setting. I’ve never been able to find the reason, but hopefully that’s the case here and it’s a quick fix.

Hey! @rorywalsh
Checking off the “auto-connect nodes” mark ended up working for me.
What a strange issue…
MAYBE COMPUTERS REALLY DO HAVE SOULS
AND SOME DON’T WANT AUTO-CONNECT NODES
mmm i doubt it

as for setting the file path,
this still didn’t work.
i used it to load the samples for playback, and that worked fine.
although, when i use it within this section of my code:

`SPad_SoundFilerCode sprintf "bounds(%d, %d, 91, 91), colour(180, 130, 0, 255) tableBackgroundColour(214, 170, 0, 255), channel(\"pad_SoundFiler%d\"), file(getFullPath(\"samples/%d.wav\"))", iX+2, iY+2, iSlotNumber, iSlotNumber`

it didn’t work (in conjunction with cabbageCreate).

although, the images i’m using for the playback buttons in the “edit” section work fine (again, with cabbageCreate).
i can use the relative path for that one, and there is no problem.
the section of my code i’m referring to is this one:

`SEdit_PlayCode sprintf "bounds(442, %d, 12, 12) channel(\"edit_Play%d\"), imgFile(\"On\", \"./imgs/playButton.png\"), imgFile(\"Off\", \"./imgs/playButton.png\")", iEditY+4, iSlotNumber`

when i used the absolute path for the image, it worked fine.
when i used the absolute path for the soundfiler, it still doesn’t work.
when i used the UDO or chnget:S("CSD_PATH"), this didn’t work for either the image creation or loading onto soundfiler.

i’m having the same issue of soundfiler not displaying the audio file with soundfiler.csd (in “Examples”).

i’m using Sonoma 14.3.

I wonder if this has to do with the fact you’re using cabbageCreate to generate the widgets. Could you try omitting the soundfiler from the cabbageCreate steps, and see if it works when you add it to the Cabbage section?

@rorywalsh

Here are some screenshots showing the code in the Cabbage section (in two different ways)
It works in Cabbage 2.8.0, but not in 2.9.227

@rorywalsh

Here are some screenshots of the soundfiler.csd file in the Examples/Widgets folder.
It works in Cabbage 2.8.0, but not in 2.9.227

Something is clearly broken then. Leave it with me, I’ll try to get it sorted asap.

I just pushed a fix for this. At least it fixes the issues presented in the soundfiler widget example. I’m almost sure it should fix your issues too. There was a path issue when it was loading first.

@rorywalsh

Thank you, Rory.
I appreciate this.

I’m pretty new to Csound,
and much newer to Cabbage.
I just started Dr. B’s class at Berklee for Csound at the beginning of this summer,
and I’m really digging the Csound and Cabbage layout,
and especially your help and guidance.

Eliott

You’re in good hands then :wink:

You can find the latest build here:
https://dev.azure.com/rorywalsh/cabbage/_build/results?buildId=2760&view=artifacts&pathAsName=false&type=publishedArtifacts

@rorywalsh
Hey, Rory!
I found the new release.
soundfiler works again!

Although, I’m still having the issue using soundfiler with cabbageCreate on the new version.
Whereas opening the same file with 2.8.0 I don’t have the issue.

Thanks for testing. I will take a look at this later today or tomorrow if I get a chance.

I just took a look at this now, and it works fine so long as you pass the full file path in your cabbageCreate string. I’m doing something like this, which is a hack of the example that comes with Cabbage.

<Cabbage>
form caption("Soundfiler Example") size(410, 500), guiMode("queue"), colour(2, 145, 209) pluginId("def1")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key=4 --midi-velocity-amp=5
</CsOptions>e
<CsInstruments>
; Initialize the global variables. 
ksmps = 16
nchnls = 2
0dbfs = 1

instr Gui
    SFile sprintf "%s/DoubleBass/1.wav", chnget:S("CSD_PATH")
    cabbageCreate "soundfiler", sprintf({{bounds(22, 16, 120, 89), channel("soundfiler1"), file(%s) colour(147, 210, 0), tableBackgroundColour(0, 0, 0, 80)}}, SFile)
            
    kRandom cabbageGetValue "randomPlayback"
    if kRandom == 1 && metro(1) == 1 then
        event "i", "SamplePlayback", int(random:k(1, 10))*.1, 1, int(random:k(1, 7))
    endif
endin

</CsInstruments>
<CsScore>
i"Gui" 0 z
</CsScore>
</CsoundSynthesizer>

If you want to test it, just make sure you update the file path, or copy the DoubleBass folder from the Cabbage example directory to your working directory. The reason why relative path work in the Cabbage section is because Cabbage can work out the absolute path. Once we enter the domain of Csound, it will try to load resources based on the CWD (current working directory). In most case, when people use Csound this will be the directory where the .csd file is located. But when using Cabbage, the host might change the CWD before Csound is compiled, thus causing problems with relative path. That why you must use a full absolute path when loaded resources within your Csound instrument.

@rorywalsh
THANK YOU SO MUCH!!
I highly appreciate this, Rory.

Here is my sampler!
Check it out if you’d like:

Cool, I’m away for a few days with nothing but my phone, but I’ll check this out when I get a chance :smiley: