# How to use display?

**URL:** <https://forum.cabbageaudio.com/t/how-to-use-display/4808>\
**Category:** Csound Noobs\
**Created:** [16 May 2025 17:57 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808 "2025-05-16T17:57:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MikHulk](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mikhulk/32/4206_2.png) [@MikHulk](https://forum.cabbageaudio.com/u/MikHulk)\
**Post date:** [16 May 2025 17:57 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/1 "2025-05-16T17:57:06Z")

</div>

Hello,

I am trying to work with csound display opcode and the display widget. I have this file:

```
<Cabbage> bounds(0, 0, 0, 0)
form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1"), colour(140, 160, 170, 130)

checkbox bounds(308, 22, 80, 17), text("On/Off"), channel("onoff"), , fontColour:0(0, 0, 0, 255), fontColour:1(0, 0, 0, 255), colour:1(255, 255, 0, 255)
rslider bounds(8, 6, 68, 65) channel("osc1Gain") range(0, 1, 0, 1, 0.001) text("1 gain") textColour(218, 217, 221, 255)
rslider bounds(80, 6, 68, 65) channel("osc2Gain") range(0, 1, 0, 1, 0.001) text("2 gain") textColour(218, 217, 221, 255)
rslider bounds(152, 6, 68, 65) channel("osc3Gain") range(0, 1, 0, 1, 0.001) text("3/2 gain") textColour(218, 217, 221, 255)
rslider bounds(224, 6, 68, 65) channel("osc4Gain") range(0, 1, 0, 1, 0.001) text("5/4 gain") textColour(218, 217, 221, 255)
rslider bounds(8, 80, 68, 65) channel("osc1Fine") range(0, 1, 0, 1, 0.001) text("1 Fine") textColour(218, 217, 221, 255)
rslider bounds(80, 80, 68, 65) channel("osc2Fine") range(0, 1, 0, 1, 0.001) text("2 Fine") textColour(218, 217, 221, 255)
rslider bounds(152, 80, 68, 65) channel("osc3Fine") range(0, 1, 0, 1, 0.001) text("3/2 Fine") textColour(218, 217, 221, 255)
rslider bounds(224, 80, 68, 65) channel("osc4Fine") range(0, 1, 0, 1, 0.001) text("5/4 Fine") textColour(218, 217, 221, 255)
rslider bounds(306, 52, 81, 75) channel("freq") range(50, 1000, 100, 1, 0.001) colour(238, 123, 155, 255) outlineColour(111, 173, 23, 255) markerColour(160, 209, 92, 255) text("Main Freq") textColour(226, 138, 213, 255)

signaldisplay bounds(8, 156, 378, 134) colour("white") displayType("waveform"), backgroundColour(0, 100, 0), signalVariable("a5", "a6"), channel("display")

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n --displays -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

gisine	ftgen	0, 0, 4096, 10, 1
instr 1
    koscgain1 chnget "osc1Gain"
    koscgain2 chnget "osc2Gain"
    koscgain3 chnget "osc3Gain"
    koscgain4 chnget "osc4Gain"
    koscfine1 chnget "osc1Fine"
    koscfine2 chnget "osc2Fine"
    koscfine3 chnget "osc3Fine"
    koscfine4 chnget "osc4Fine"
    kfreq chnget "freq"
    konoff chnget "onoff"
        
    

    a1 oscili koscgain1, kfreq * (1 + koscfine1), gisine
    a2 oscili koscgain2, kfreq * (1 + koscfine2) * 2 , gisine
    a3 oscili koscgain3, kfreq * (1 + koscfine3) * (3 / 2), gisine
    a4 oscili koscgain4, kfreq * (1 + koscfine4) * (5 / 4), gisine
    a5 oscili a1 * a2, gisine
    a6 oscili a3 * a4, gisine

    kAntiClick	portk konoff, 0.25
    aout = kAntiClick * (a5 + a6)
    
    outs aout, aout
    display aout, 1, 1, 1
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
; f1 0 16384 10 1 0
i 1 0 [60*60*24*7] ;instrument that reads in widget data
</CsScore>
</CsoundSynthesizer>

```

I would like see the waveform produced in a4 and a5. Sadly the display show nothing. I am sure I missed something. Maybe because the sound is continuous and I need something to trigger the “display”. How can I achieve what I want ?

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 May 2025 19:10 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/2 "2025-05-16T19:10:49Z")

</div>

This took a while to work out. The problem is with your Csound code. You’re passing a function table handle as the frequency. Here is an updated version, although it’s only displaying `aout`.

```
<Cabbage> 
form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1"), colour(140, 160, 170, 130)

signaldisplay bounds(8, 156, 378, 134), colour("white") displayType("waveform"), backgroundColour(147, 210, 0), zoom(-1), signalVariable("aout"), channel("display")

checkbox bounds(308, 22, 80, 17), text("On/Off"), channel("onoff"), value(1), fontColour:0(0, 0, 0, 255), fontColour:1(0, 0, 0, 255), colour:1(255, 255, 0, 255)
rslider bounds(8, 6, 68, 65) channel("osc1Gain") range(0, 1, 0.5, 1, 0.001) text("1 gain") textColour(218, 217, 221, 255)
rslider bounds(80, 6, 68, 65) channel("osc2Gain") range(0, 1, 0.7, 1, 0.001) text("2 gain") textColour(218, 217, 221, 255)
rslider bounds(152, 6, 68, 65) channel("osc3Gain") range(0, 1, 0.5, 1, 0.001) text("3/2 gain") textColour(218, 217, 221, 255)
rslider bounds(224, 6, 68, 65) channel("osc4Gain") range(0, 1, 0, 1, 0.001) text("5/4 gain") textColour(218, 217, 221, 255)
rslider bounds(8, 80, 68, 65) channel("osc1Fine") range(0, 1, 0, 1, 0.001) text("1 Fine") textColour(218, 217, 221, 255)
rslider bounds(80, 80, 68, 65) channel("osc2Fine") range(0, 1, 0.5, 1, 0.001) text("2 Fine") textColour(218, 217, 221, 255)
rslider bounds(152, 80, 68, 65) channel("osc3Fine") range(0, 1, 0, 1, 0.001) text("3/2 Fine") textColour(218, 217, 221, 255)
rslider bounds(224, 80, 68, 65) channel("osc4Fine") range(0, 1, 0, 1, 0.001) text("5/4 Fine") textColour(218, 217, 221, 255)
rslider bounds(306, 52, 81, 75) channel("freq") range(50, 1000, 100, 1, 0.001) colour(238, 123, 155, 255) outlineColour(111, 173, 23, 255) markerColour(160, 209, 92, 255) text("Main Freq") textColour(226, 138, 213, 255)

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n --displays 
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1
    koscgain1 chnget "osc1Gain"
    koscgain2 chnget "osc2Gain"
    koscgain3 chnget "osc3Gain"
    koscgain4 chnget "osc4Gain"
    koscfine1 chnget "osc1Fine"
    koscfine2 chnget "osc2Fine"
    koscfine3 chnget "osc3Fine"
    koscfine4 chnget "osc4Fine"
    kfreq chnget "freq"
    konoff chnget "onoff"
        
    cabbageSet "display", "displayType(\"waveform\")"

    a1 oscili koscgain1, kfreq * (1 + koscfine1), -1
    a2 oscili koscgain2, kfreq * (1 + koscfine2) * 2, -1
    a3 oscili koscgain3, kfreq * (1 + koscfine3) * (3 / 2), -1
    a4 oscili koscgain4, kfreq * (1 + koscfine4) * (5 / 4), -1
    a5 oscili a1 * a2, 1
    a6 oscili a3 * a4, 1

    kAntiClick	portk konoff, 0.25
    aout = kAntiClick * (a5 + a6)
    
    
    display aout, .1, 1
    outs aout, aout
    
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
; f1 0 16384 10 1 0
i 1 1 [60*60*24*7] ;instrument that reads in widget data
</CsScore>
</CsoundSynthesizer>
```

---

<div class="post-metadata">

**Author:** ![MikHulk](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mikhulk/32/4206_2.png) [@MikHulk](https://forum.cabbageaudio.com/u/MikHulk)\
**Post date:** [16 May 2025 19:52 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/3 "2025-05-16T19:52:31Z")

</div>

what does “-1” for fn param in oscili exactly do ? In fact I would like to use function table in the future. Is it impossible with display ?

according to documentation frequency is the second parameter no ?

ares **oscili** xamp, xcps[, ifn, iphs]

[https://csound.com/docs/manual/oscili.html](https://csound.com/docs/manual/oscili.html)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [16 May 2025 21:41 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/4 "2025-05-16T21:41:24Z")

</div>

-1 means use a default function table. But you can leave it out. Frequency is the second argument, but if I’m not mistaken you were passing gisine for the second parameter?

---

<div class="post-metadata">

**Author:** ![MikHulk](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mikhulk/32/4206_2.png) [@MikHulk](https://forum.cabbageaudio.com/u/MikHulk)\
**Post date:** [17 May 2025 19:10 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/5 "2025-05-17T19:10:11Z")

</div>

ah yes I got it. here:

```
    a5 oscili a1 * a2, gisine
    a6 oscili a3 * a4, gisine

```

I will try the fix, thanks !

---

<div class="post-metadata">

**Author:** ![MikHulk](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mikhulk/32/4206_2.png) [@MikHulk](https://forum.cabbageaudio.com/u/MikHulk)\
**Post date:** [21 May 2025 20:51 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/6 "2025-05-21T20:51:02Z")

</div>

Hey Rory !

Thank you it works now. In addition to my error with oscilli, I had the “-d” flag in the CS options, which precisely suppresses all display.

it’s an old test I took up not long ago and I think I was originally trying to make a frequency modulation.

I am going to see how to do that properly with csound.

This is the current state of my app:

```
<Cabbage> bounds(0, 0, 0, 0)
form caption("Untitled") size(400, 300), guiMode("queue"), pluginId("def1"), colour(140, 160, 170, 130)

signaldisplay bounds(8, 156, 378, 134), colour(255, 0, 120) displayType("waveform"), backgroundColour(0, 0, 50), zoom(-1), signalVariable("aout"), channel("display")

checkbox bounds(308, 22, 80, 17), text("On/Off"), channel("onoff"), , fontColour:0(0, 0, 0, 255), fontColour:1(0, 0, 0, 255), colour:1(226, 32, 120, 255)
rslider bounds(8, 6, 68, 65) channel("osc1Gain") range(0, 1, 0, 1, 0.001) text("1 gain") textColour(218, 217, 221, 255) colour(217, 84, 76, 255)
rslider bounds(80, 6, 68, 65) channel("osc2Gain") range(0, 1, 0, 1, 0.001) text("2 gain") textColour(218, 217, 221, 255) colour(217, 84, 76, 255)
rslider bounds(152, 6, 68, 65) channel("osc3Gain") range(0, 1, 0, 1, 0.001) text("3/2 gain") textColour(218, 217, 221, 255) colour(217, 84, 76, 255)
rslider bounds(224, 6, 68, 65) channel("osc4Gain") range(0, 1, 0, 1, 0.001) text("5/4 gain") textColour(218, 217, 221, 255) colour(217, 84, 76, 255)
rslider bounds(8, 80, 68, 65) channel("osc1Fine") range(0, 0.1, 0, 1, 0.001) text("1 Fine") textColour(218, 217, 221, 255) colour(176, 23, 226, 255)
rslider bounds(80, 80, 68, 65) channel("osc2Fine") range(0, 0.1, 0, 1, 0.001) text("2 Fine") textColour(218, 217, 221, 255) colour(176, 23, 226, 255)
rslider bounds(152, 80, 68, 65) channel("osc3Fine") range(0, 0.1, 0, 1, 0.001) text("3/2 Fine") textColour(218, 217, 221, 255) colour(176, 23, 226, 255)
rslider bounds(224, 80, 68, 65) channel("osc4Fine") range(0, 0.1, 0, 1, 0.001) text("5/4 Fine") textColour(218, 217, 221, 255) colour(176, 23, 226, 255)
rslider bounds(306, 52, 81, 75) channel("freq") range(50, 200, 100, 0.5, 0.0001) colour(200, 12, 64, 255) outlineColour(111, 173, 23, 255) markerColour(160, 209, 92, 255) text("Main Freq") textColour(226, 138, 213, 255)

</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n --displays -+rtmidi=NULL -M0 -m0 --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables. 
ksmps = 32
nchnls = 2
0dbfs = 1

gisine	ftgen	0, 0, 4096, 10, 1

instr 1
    koscgain1 chnget "osc1Gain"
    koscgain2 chnget "osc2Gain"
    koscgain3 chnget "osc3Gain"
    koscgain4 chnget "osc4Gain"
    koscfine1 chnget "osc1Fine"
    koscfine2 chnget "osc2Fine"
    koscfine3 chnget "osc3Fine"
    koscfine4 chnget "osc4Fine"
    kfreq chnget "freq"
    konoff chnget "onoff"
        
   
    cabbageSet "display", "displayType(\"waveform\")" 

    a1 oscili koscgain1, kfreq * (1 + koscfine1), gisine
    a2 oscili koscgain2, kfreq * (1 + koscfine2) * 2 , gisine
    a3 oscili koscgain3, kfreq * (1 + koscfine3) * (3 / 2), gisine
    a4 oscili koscgain4, kfreq * (1 + koscfine4) * (5 / 4), gisine
    a5 = a1 * a2
    a6 = a3 * a4

    kAntiClick	portk konoff, 0.25
    aout = kAntiClick * (a5 + a6)
    
    outs aout, aout
    display aout, .1, 1
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z
; f1 0 16384 10 1 0
i 1 0 [60*60*24*7] ;instrument that reads in widget data
</CsScore>
</CsoundSynthesizer>

```

I have changed a5 and a6. I want to have a ring modulation here. But I am not sure if it works I have the feeling it just mix the 2 signals. I will try with a function table with more harmonics.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [22 May 2025 08:02 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/7 "2025-05-22T08:02:53Z")

</div>

Looks right to me, your multiplying two signals, which will modulate rather than mix. 👍 Glad you got the display sorted!

---

<div class="post-metadata">

**Author:** ![MikHulk](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mikhulk/32/4206_2.png) [@MikHulk](https://forum.cabbageaudio.com/u/MikHulk)\
**Post date:** [29 May 2025 14:57 UTC](https://forum.cabbageaudio.com/t/how-to-use-display/4808/8 "2025-05-29T14:57:52Z")

</div>

ah cool thanks . Sorry I didn’t see notification.

Thank you for your help
