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 249 230 706 474 true 138 149 156 graph 389 98 292 142 {22cb97ab-2ca3-4c1d-8261-438750bdafb7} true 0 -3 5 graph_ft 1.00000000 1.00000000 1.00000000 1.00000000 lin lin true 69 4 559 40 {8089dfa0-23c8-499b-9574-c5448e6c9b31} true 0 -3 center Helvetica 24 3 0 0 0 191 204 234 noborder 1 1 7 41 376 199 {0c1459a8-a5dd-4f20-8ac4-c6db15ad3fbc} true 0 -3 left Arial 14 3 0 0 0 191 204 234 noborder 5 1 tabnum 479 244 45 25 {c5184ca2-1e56-4172-93fb-2cb07b8446d9} true 0 -3 left Lucida Grande 12 0 0 0 255 255 255 1.00000000 1 5 false 3 390 244 91 26 {713fa927-1f41-48d2-9a62-9917b1394f7a} true 0 -3 right Arial 10 3 0 0 0 255 255 255 noborder 1 1 388 276 294 80 {83a3100c-6bc8-4953-8812-8b41812f6028} true 0 -3 left Nimbus Sans L 12 3 0 0 0 191 204 234 noborder 5 1 spectrum 543 249 20 20 {856bd0e3-fab2-4aea-bfbf-109f1707a92c} true 0 -3 true 559 247 111 27 {fd65e87a-e8e2-4111-a0c9-3a4b758ac437} true 0 -3 left Arial 10 3 0 0 0 255 255 255 noborder 1 1 graph_direct 8 245 373 142 {5812135b-97d7-4337-8654-8d72fdba2a8a} true 0 -3 0 graph_direct_table 1.00000000 1.00000000 1.00000000 1.00000000 lin lin true graph_direct 98 395 80 25 {4fc79c4a-802a-4463-8920-823beabf229c} true 0 -3 left DejaVu Sans 12 0 0 0 255 255 255 1.00000000 -5 5 false 0 graph_direct_table 290 395 80 25 {688dfcfc-c8da-4815-b9ad-952c95e4caac} true 0 -3 left DejaVu Sans 12 0 0 0 255 255 255 1.00000000 0 10 false -1 27 395 73 26 {18951768-4bc4-46c5-99bc-68bd75158ed4} true 0 -3 right Arial 10 3 0 0 0 255 255 255 noborder 1 1 181 395 111 25 {e241df28-b3f8-488a-aaba-4072ea72e73c} true 0 -3 right Arial 10 3 0 0 0 255 255 255 noborder 1 1 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