-odac
sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1
/*
This is the example file for the Table Plot Widget
This widget allows to visualize the contents of a table in
real-time. To set the table number to plot send the table
number to its channel. To update the plot just send -1 and
the last set table will be updated.
The widget also accepts string values. The table can be set
via "@set tablenumber" and it can be updated via "@update"
*/
; Create two empty tables
gi1 ftgen 0, 0, 1024, 2, 0
gi2 ftgen 0, 0, 512, 2, 0
chn_k "plot1", "w"
chn_k "plot2", "w"
instr 1
ktab1 init gi1
ktab2 init gi2
; switch tables every five seconds
if metro(1/2) == 1 then
ktab1, ktab2 = ktab2, ktab1
endif
; Modify the tables
ilen = ftlen(gi1)
; We fill a table with an aplitude varying sine wave at k-rate
kamp = linlin(oscil:k(1, 0.1), 1, 8, -1, 1)
kval oscil kamp, 15
kidx = timeinstk() % ilen
tablew kval, kidx, gi1
; The second table is filled with realtime audio input
aidx phasor sr/ftlen(gi2)
tablew inch(1)*2, aidx, gi2, 1
; Update rate of the plots. NB: the widget update rate in
; CsoundQt is limited to 30 fps, so any update faster than
; than will have no effect other than time aliasing
ktrig metro 24
chnset ktrig == 1 ? -1 : ktab1, "plot1"
chnset ktrig == 1 ? -1 : ktab2, "plot2"
endin
schedule 1, 0.1, 3600, gi1, gi2
00435149true240240240plot237074360220{0c6062cd-26ee-44ec-8b8c-2e57adfd1916}true0-325519330.00plot1874360220{de99af7a-d3d5-4e8f-a18a-86c66ec2481b}true0-325515300.0071127156{cb8cacc9-7f4f-4465-af4f-b8c31fca1acb}true0-3centertop
Arial
363676767255255255false1010360460127{ce9539a1-5f6f-4a93-8e67-2e45899088cb}true0-3lefttop
Liberation Sans
123525252686868false301132012138{c9cdfd2b-7f5d-48bf-91c5-c6172252fdc4}true0-3lefttop
Liberation Sans
203676767255255255false10