Cabbage Logo
Back to Cabbage Site

Problems with signaldisplay

What’s wrong at this code

bounds(0, 0, 0, 0)
form caption(“Untitled”) size(450, 450), colour(58, 110, 182), pluginid(“def1”)
rslider bounds(0, 0, 80, 120) range(0.05, 12, 1, 0.5, 0.01) increment(0.01) channel(“Rate”) text(“Rate [Hz]”) value(1) valuetextbox(1)
rslider bounds(80, 0, 80, 120) range(1, 32, 1, 1, 1) increment(1) channel(“MaxInter”) text(“Max-Intervall [n]”) value(1) valuetextbox(1)
rslider bounds(160, 0, 80, 120) range(1, 32, 1, 1, 1) increment(1) channel(“MaxSpr”) text(“Max-Sprungweite [n]”) value(1) valuetextbox(1)
rslider bounds(240, 0, 120, 120) range(0.001, 1, 1, 0.7, 0.001) increment(0.001) channel(“MaxErr”) text(“Max-Zulässiger-Fehler [n]”) value(1) valuetextbox(1)
button bounds(0, 125, 360, 80), channel(“button1”), text(“Decodieren enable”, “Decodieren disable”), colour:0(255, 255, 0, 255) fontcolour:0(255, 0, 255, 255) fontcolour:1(0, 255, 0, 255) colour:1(255, 0, 0, 255)
signaldisplay bounds(0, 200, 360, 170), colour(“lime”), backgroundcolour(“black”), displaytype(“waveform”), signalvariable(“kT”)

-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5 ; Initialize the global variables. ksmps = 32 nchnls = 2 0dbfs = 1

;instrument will be triggered by keyboard widget
instr 1

kRate chnget “Rate”
kST chnget “MaxInter”
kSD chnget “MaxSpr”
kSG chnget “MaxErr”
kF = 440 / 123.45

kTrig metro kRate
if kTrig == 1 then

if kF < 1 then
kF = 1 / kF
endif

kB1 = 0
kT = 1
kSG = 0.01
while ( ( kT < kST ) && ( kB1 == 0 )) do
kTT = ( kT + 1) / kT
kSE = 0
while ( (kSE < kSD ) && (kB1 == 0)) do
kSE = kSE + 1

; kkk#####
kZ = exp(log(kTT)kSE)
kZ2= kZ
(1+kSG)
kZ1 = kZ * (1-kSG)
if ( kZ1 < kF ) && ( kF < kZ2) then
kB1 = 1
endif
; kkk#####
od

kT = kT + 1
od

printk 0, kT
display kT, .5, 1
endif
endin

;causes Csound to run for about 7000 years... f0 z i1 0 z

Thanks in advance

Mungo1981

Ok. I see:
The options section is failed.
It must be:
-n -d -+rtmidi=NULL -M0 -m0d --displays
The code word / flag:
–displays
Is importent

Ok, I’m silly.
It’s a mercury effect. When I explain the Problem to anybody else I will find the Answer by my self.
The Solution:

  1. Put:
    –display
    to the Options Section
  2. Set the
    iprd to a higher but not to hig Value.
    Then it might would work.

iprd not to set to an too high Value, because of first iprd Time must be gone before Display will be initialized.

So it’s all Ok now? For sure, it’s always nice to post back with the solutions :wink: