-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 0 0 435 149 true 240 240 240 plot2 370 74 360 220 {0c6062cd-26ee-44ec-8b8c-2e57adfd1916} true 0 -3 255 193 3 0.00 plot1 8 74 360 220 {de99af7a-d3d5-4e8f-a18a-86c66ec2481b} true 0 -3 255 153 0 0.00 7 11 271 56 {cb8cacc9-7f4f-4465-af4f-b8c31fca1acb} true 0 -3 center top Arial 36 3 67 67 67 255 255 255 false 1 0 10 360 460 127 {ce9539a1-5f6f-4a93-8e67-2e45899088cb} true 0 -3 left top Liberation Sans 12 3 52 52 52 68 68 68 false 3 0 11 320 121 38 {c9cdfd2b-7f5d-48bf-91c5-c6172252fdc4} true 0 -3 left top Liberation Sans 20 3 67 67 67 255 255 255 false 1 0