sr = 44100
ksmps = 128
nchnls = 2
0dbfs = 1
instr 20
ktab invalue "tabnum" ; table number selected
kspectrum invalue "spectrum" ;spectrum checkbox
if (ktab>5 || ktab<1) then
ktab = 1 ; only allow existing tables
endif
asig oscilikt 0.2, 440, ktab
outs asig*0.1,asig*0.1
dispfft asig, 0.5, 1024 ;calculate spectrum
if (kspectrum == 1) then
ktab = -5 ;set to show graph index 5
endif
ktrig metro 2
if ktrig == 1 then
outvalue "graph", -ktab ;show appropriate graph
endif
endin
f 1 0 1024 10 1 ;sine
f 2 0 1024 10 1 0.5 0.333
f 3 0 1024 10 1 0 0.333 0 0.25
f 4 0 1024 7 1 512 1 0 -1 512 -1 ;square
f 5 0 1024 7 1 1024 -1 ;saw
i 20 0 3600
249230706474true138149156graph38998292142{22cb97ab-2ca3-4c1d-8261-438750bdafb7}true0-35graph_ft1.000000001.000000001.000000001.00000000linlintrue69455940{8089dfa0-23c8-499b-9574-c5448e6c9b31}true0-3center
Helvetica
243000191204234noborder11741376199{0c1459a8-a5dd-4f20-8ac4-c6db15ad3fbc}true0-3left
Arial
143000191204234noborder51tabnum4792444525{c5184ca2-1e56-4172-93fb-2cb07b8446d9}true0-3left
Lucida Grande
120002552552551.0000000015false33902449126{713fa927-1f41-48d2-9a62-9917b1394f7a}true0-3right
Arial
103000255255255noborder1138827629480{83a3100c-6bc8-4953-8812-8b41812f6028}true0-3left
Nimbus Sans L
123000191204234noborder51spectrum5432492020{856bd0e3-fab2-4aea-bfbf-109f1707a92c}true0-3true1false55924711127{fd65e87a-e8e2-4111-a0c9-3a4b758ac437}true0-3left
Arial
103000255255255noborder11graph_direct8245373142{5812135b-97d7-4337-8654-8d72fdba2a8a}true0-30graph_direct_table1.000000001.000000001.000000001.00000000linlintruegraph_direct983958025{4fc79c4a-802a-4463-8920-823beabf229c}true0-3left
DejaVu Sans
120002552552551.00000000-55false0graph_direct_table2903958025{688dfcfc-c8da-4815-b9ad-952c95e4caac}true0-3left
DejaVu Sans
120002552552551.00000000010false-1273957326{18951768-4bc4-46c5-99bc-68bd75158ed4}true0-3right
Arial
103000255255255noborder1118139511125{e241df28-b3f8-488a-aaba-4072ea72e73c}true0-3right
Arial
103000255255255noborder11
ioView background {35466, 38293, 40092}
ioGraph {389, 98} {292, 142} table 5.000000 1.000000 graph
ioText {69, 4} {559, 40} label 0.000000 0.00100 "" center "Helvetica" 24 {0, 0, 0} {58880, 56576, 54528} nobackground noborder Graph Widget
ioText {7, 41} {376, 199} label 0.000000 0.00100 "" left "Arial" 14 {0, 0, 0} {48896, 52224, 59904} nobackground noborder Graph Widgets display Csound's tables. The currently visible table can be changed by sending values on the widget's channel. Positive values change the table by index and negative values change the table by f-table number. The second channel can be used to display tables by f-table number instead of index. The displayed table can also be changed with the mouse using the menu on the upper left corner. Doing this will produce output on both channels.¬Graph widgets can also show the spectrum from signals using the dispfft opcode, or time varying signals (a-rate and k-rate) using the display opcode.
ioText {479, 244} {45, 25} editnum 3.000000 1.000000 "tabnum" left "" 0 {0, 0, 0} {58880, 56576, 54528} nobackground noborder 3.000000
ioText {390, 244} {91, 26} label 0.000000 0.00100 "" right "Arial" 10 {0, 0, 0} {58880, 56576, 54528} nobackground noborder Use f-table
ioText {388, 276} {294, 80} label 0.000000 0.00100 "" left "Nimbus Sans L" 12 {0, 0, 0} {48896, 52224, 59904} nobackground noborder Note that the numbers in the lower section will only have effect if Csound is running as they pass through Csound, while the ones on the top are connected directly by channel number.
ioCheckbox {543, 249} {20, 20} on spectrum
ioText {559, 247} {111, 27} label 0.000000 0.00100 "" left "Arial" 10 {0, 0, 0} {58880, 56576, 54528} nobackground noborder Show spectrum
ioGraph {8, 245} {373, 142} table 0.000000 1.000000 graph_direct
ioText {91, 395} {80, 25} editnum 0.000000 1.000000 "graph_direct" left "" 0 {0, 0, 0} {58880, 56576, 54528} nobackground noborder 0.000000
ioText {299, 395} {80, 25} editnum 0.000000 1.000000 "graph_direct_table" left "" 0 {0, 0, 0} {58880, 56576, 54528} nobackground noborder 0.000000
ioText {11, 395} {80, 25} label 0.000000 0.00100 "" right "Arial" 10 {0, 0, 0} {58880, 56576, 54528} nobackground noborder Index
ioText {188, 395} {111, 25} label 0.000000 0.00100 "" right "Arial" 10 {0, 0, 0} {58880, 56576, 54528} nobackground noborder F-table number