OK, Here goes… What I’ve got so far on these tests…
<Cabbage>
form caption("Untitled") size(600, 400), colour(58, 110, 182), pluginid("def1")
gentable bounds(28, 16, 500, 136) tablenumber(1, 2) amprange(-20, 20, 1, 1) tablecolour:1(255, 0, 0, 255) tablecolour:2(0, 255, 0, 255)
gentable bounds(28, 200, 500, 136) tablenumber(1, 2) amprange(-20, 20, 1, 1) samplerange(0, 127) tablecolour:1(255, 0, 0, 255) tablecolour:2(0, 255, 0, 255) identchannel("magnifyer")
nslider bounds(28, 350, 60, 24) channel("vieworigin") range(0, 8192, 0, 1, 1)
nslider bounds(88, 350, 60, 24) channel("viewsize") range(0, 8192, 255, 1, 1)
button bounds(150, 352, 20, 20) channel("viewlock") latched(1) text("") colour:0(64, 64, 64, 255) colour:1(200, 40, 255, 255)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1
giLatoo[] fillarray -0.966918, 2.87988, 0.756145, 0.744728, 0.1, 0.1
opcode latoo2, ii, i
ix xin
iA = giLatoo[0]
iB = giLatoo[1]
iC = giLatoo[2]
iD = giLatoo[3]
iX = giLatoo[4]
iY = giLatoo[5]
iNx = sin(iY * iB) + (iC * sin(iX * iB))
iNy = sin(iX * iA) + (iD * sin(iY * iA))
giLatoo[4] = iNx
giLatoo[5] = iNy
xout iNx, iNy
endop
;; this is the root instr for controlling the gui
instr 1
iLen1 = ftlen(1)
iLen2 = ftlen(2)
iCount = 0
prints "iLen1: %f iLen2: %f\n", iLen1, iLen2
until iCount > iLen1 do
iX, iY latoo2 1
tableiw iX, iCount, 1
tableiw iY, iCount, 2
; prints "iX: %f iY: %f\n", iX, iY
iCount = iCount + 1
od
endin
instr 3
kVsize chnget "viewsize"
kVorigin chnget "vieworigin"
kVlocked chnget "viewlock"
kTrig metro 1
if kTrig == 1 then
printks "kVsize: %d kVorigin: %d kVlocked: %d\n", 0, kVsize, kVorigin, kVlocked
endif
if changed(kVsize, kVorigin) == 1 then
if changed(kVlocked) == 1 then
if kVlocked == 0 then
chnset kVorigin + 255, "viewsize"
endif
endif
if kVlocked == 1 then
kVsize = kVorigin + 255
chnset kVsize, "viewsize"
endif
Smessage sprintfk "samplerange(%d, %d)", kVorigin, kVsize
printks "%s\n", 0, Smessage
chnset Smessage, "magnifyer"
endif
endin
</CsInstruments>
<CsScore>
f1 0 8192 -10 0
f2 0 8192 -10 0
i1 0 z
i3 0 z
</CsScore>
</CsoundSynthesizer>