Cabbage Logo
Back to Cabbage Site

Texteditor cursor colour

I think the identChannels are not set properly in the widget array anymore. Had it working now on a single soundfiler.

Oh, that could be the case. Give me a second. Are you using the latest version or the one from yesterday?

p.s. I also know what the convert function go messed up. I add two new identifiers yesterday and forgot to add lowercase versions to check against.

Iā€™m using 2.5.27

This is working for me here. So is the widget array csd in the Misc examples.

<Cabbage>
form size(500, 300), caption("Untitled")
soundfiler bounds(10, 34, 300, 200), file("DutchLadyTalking.aif"), widgetArray("waveform", 2)
button bounds(352, 47, 80, 40), channel("switch")
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -m0d
</CsOptions>
<CsInstruments>
nchnls = 2	
0dbfs = 1


instr SwitchWaveSecure
    String              sprintf "visible(%d)",0
    Soundfiler          sprintf "waveform_ident%d", p5
    chnset              String, Soundfiler

    String              sprintf "visible(%d)",1
    Soundfiler          sprintf "waveform_ident%d", p4
    chnset              String, Soundfiler
endin	
  
  
instr 1 ;set file for second soundfiler object
    chnset "file(\"pianoMood.wav\")", "waveform_ident2"
endin     
                      
instr 2
    kSwitch chnget "switch"
    if changed:k(kSwitch) == 1 then
        if kSwitch == 1 then
            event "i", "SwitchWaveSecure", 0, 0.1, 1, 2
        else
            event "i", "SwitchWaveSecure", 0, 0.1, 2, 1
        endif
    endif
endin                                                    
</CsInstruments>
<CsScore>
i1 0 .1
i2 1 z
</CsScore>
</CsoundSynthesizer>

Hmm. Itā€™s hard to pinpoint this. Just declared my soundfilers individually and it works even though the code it doesnā€™t look very elegant. But that doesnā€™t bother me as long as it works again.
It wasnā€™t just visible() that didnā€™t work, but also sampleRange() and file(), basically all identifiers.

The zooming in only to the beginning of the soundfiler is back though. :exploding_head:
Seems like now I have to have the scrubber somewhat inside the sample. Declaring a negative value to it used to solve this problem.

Thanks, Iā€™ll take a look later. More camelCase teething issues I imagineā€¦

Iā€™m not going to get a chance to look into this today. Iā€™ll add it to my todo list. I hope it doesnā€™t cost you much time.

No worries! I just added some lines as a workaround setting the scrubber at the end of a sample after loading it onto a soundfiler. I donā€™t need the scrubber, had to build my own. Donā€™t remember why. :thinking: :woozy_face:

There was an issue with the showScrubber() identifier, itā€™s fixed now. Would you mind trying the latest build when you get a chance? Youā€™ll see the commit tag relating to showScrubber().

Oh, I didnā€™t even know that identifier. Iā€™ll have a look later. For now I just added some lines that put the scrubber at the end of a sample/ >1sec on shorter samples after loading it into the soundfiler. That just works for now.
At the time Iā€™m more concerned about loading a whole bunch of soundfilers / functiontables from the JSON data / getStateValue Data on init in plugin mode for recall, which is a bit painful. But once I solved this Iā€™ll get back to this one.

Those get/set state value opcodes are very new and relatively untested. It seems that you are once more youā€™re the guinea pig for testing!

It seems like I can recall numbers/k-variables very reliably and apply them to their according parameters. Even the strings are recalled, had a letter missing once at the end though once. My hassle is more around loading the recalled filepaths into soundfilers and function tables.

1 Like

Itā€™s a bit weird with the get/set state value stuff on strings. First of all they only get saved if I put the string again in double quotes, but thatā€™s actually not a problem.

The problem is that once I have stored strings with certain identifiers/keynames like ā€œfilepath(1)ā€ and close and reopen my DAW session, I canā€™t overwrite those anymore. What ever I do then, they always get recalled to the strings that I stored when I set them before I closed my session the first time.

That problem doesnā€™t occur on storing numbers. They always recall the last store I made and that is not due to the DAW just recalling the settings of my sliders, as my sliders have arrays behind them to recall different settings on different samples.

Apart from that, strings get sometimes randomly cut short on recall. Couldnā€™t identify a pattern there yet.

Btw, should I put this into a separate thread that has the topic?

Yeah, or maybe add it to the original get/set state thread? It would be great if you can produce a simple .csd that will let me see the problem in action.