diff options
Diffstat (limited to 'examples/FLknob.csd')
-rw-r--r-- | examples/FLknob.csd | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/examples/FLknob.csd b/examples/FLknob.csd new file mode 100644 index 0000000..de3bf79 --- /dev/null +++ b/examples/FLknob.csd @@ -0,0 +1,67 @@ +<CsoundSynthesizer> +<CsOptions> +; Select audio/midi flags here according to platform +; Audio out Audio in No messages +-odac -iadc -d ;;;RT audio I/O +; For Non-realtime ouput leave only the line below: +; -o FLknob.wav -W ;;; for file output any platform +</CsOptions> +<CsInstruments> + +; A sine with oscillator with flknob controlled frequency +sr = 44100 +kr = 441 +ksmps = 100 +nchnls = 1 + +FLpanel "Frequency Knob", 900, 400, 50, 50 + ; Minimum value output by the knob + imin = 200 + ; Maximum value output by the knob + imax = 5000 + ; Logarithmic type knob selected + iexp = -1 + ; Knob graphic type (1=3D knob) + itype = 1 + ; Display handle (-1=not used) + idisp = -1 + ; Width of the knob in pixels + iwidth = 70 + ; Distance of the left edge of the knob + ; from the left edge of the panel + ix = 70 + ; Distance of the top edge of the knob + ; from the top of the panel + iy = 125 + + gkfreq, ihandle FLknob "Frequency", imin, imax, iexp, itype, idisp, iwidth, ix, iy +; End of panel contents +FLpanelEnd +; Run the widget thread! +FLrun + +; Set the widget's initial value +FLsetVal_i 300, ihandle + +instr 1 + iamp = 15000 + ifn = 1 + asig oscili iamp, gkfreq, ifn + out asig +endin + + +</CsInstruments> +<CsScore> + +; Function table that defines a single cycle +; of a sine wave. +f 1 0 1024 10 1 + +; Instrument 1 will play a note for 1 hour. +i 1 0 3600 +e + + +</CsScore> +</CsoundSynthesizer> |