Cabbage Logo
Back to Cabbage Site

Soundfiler not displaying waveform

Hello, I hope someone can help me. I repurposed an old example I found on the forum using a soundfiler. Originally, it was using chnset identChannel Opcodes etc which aren’t compatible with guiMode(“queue”). I replaced chnset with CabbageSet (also tried with cabbageSetValue) and it plays sound how it should normally. However, the soundfiler is no longer displaying the waveform but works correctly.

I am wondering if I am just doing something dumb or is it a glitch. I have attached the patch below.

Mark.Soundfiler 3.csd (2.1 KB)

Looks like something is not right, but it’s not your code. I’ll take a look later when I get a chance. :+1:

Nope, it turns out we both missed an issue with the syntax. First of all, you should only use cabbageSetValue with widgets whose state is set by a number, sliders, button, checkbox, etc. For the more abstract widgets, like soundfiler you need to use cabbageSet (no Value). That was one issue, but the other issue is that you have the arguments passed in the wrong order. It should be channel, and then identifier, rather than the other way around. This works:

instr 2000
    SFile chnget "LAST_FILE_DROPPED"

    if strindex(SFile, ".wav") > 0 then
        SMessage sprintf "file(\"%s\")", SFile
        prints SMessage
        cabbageSet "soundfiler1", SMessage

Thanks very much Rory, I really appreciate your help :+1: :+1: :+1:

No problem, always happy to help. It’s fun that we both got caught out with this :rofl: Just goes to show you how easy it is to miss a simple issue like this. I was knee deep in Cabbage source code before I twigged it!