Cabbage Logo
Back to Cabbage Site

Show single waveform in stereo soundfiler

When displaying a stereo file in soundfiler, it shows both channel waveforms. Works great, but for my project, I would prefer to limit soundfiler to only display 1 waveform.

Is this possible?

This is how I set the soundfiler:

<Cabbage>
form caption("Stretch") size(600, 500), guiMode("queue"), pluginId("1287"), colour (0,100,0)
soundfiler bounds(110, 52, 300, 200), channel("filer1"), colour(188, 188, 188), tableBackgroundColour(62, 71, 86), showScrubber(0)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
    gSfile cabbageGet "LAST_FILE_DROPPED"

    if (changed(gSfile) == 1) then
        cabbageSet 1, "filer1", sprintfk("file(%s)", gSfile)
    endif
endin
</CsInstruments>
<CsScore>
f0 z

i1 0 z
</CsScore>
</CsoundSynthesizer>

I thought mono files were displayed as a single waveform?

You’re correct, I notice that now. Most of my files are stereo. Would still be useful to force it to only display one waveform if you have a mono sampler, such as a granular synth? I think this is standard for most plugins?

So it should only show the left channel on these instances, is that what you’re using, or do you mix down to mono?

Currently, I am actually using both channels, so it makes sense to show both. But if I were to only display one, I would assume a mix down to mono would work?

In terms of UI design it can be messy when you show several.

Some examples of this solution:


538116

I understand the UI concerns. The simplest would be to draw a single channel rather than having to create a new audio buffer, mix down to mono, and replace the existing audio buffer with the new one. But it will be odd if there are big difference between the channels.

So I took a pretty simple approach here. If you use displayType("mono") it will draw both channel on top of each other, which basically provides a mixed down display. Thankfully I didn’t have to go messing with new buffers and things like that. I just triggered a new build, let me know if it works Ok.

Tested now, but I don’t think it works?

Edit: Nevermind, it works great :stuck_out_tongue_closed_eyes: Thank you for the elegant solution that I’m sure several people will use in the future :+1: