;; -*- cscsd-current-processing : "csound to dac" -*-
<About> ===================================================================

This demo, to be used within Emacs in Surmulot, demonstrates the graphical
edition of envelopes within a CSD, and the storage of Surmulot widgets.

(see [[info:surmulot.info:Widgets]] for an overview of widgets)

The f1 statement in the score has been generated by an [[info:surmulot.info:Envelope%20editor][Envelope editor]], and
this editor has been stored in the CSD in a specific WIDGET area.
 
To invoke it back, do "Stored widgets-> f1 edition" in the "Widgets" menu
... or click here: [[elisp:(surmulot-widget-restore "f1 edition")]]

You can now modify the envelope. For example, from the widget menu do
"selection -> duplicate (with start)" and input 8 at the prompt.

To test the effect, do "emacs -> insert as f-table" from the widget menu. 
This will refresh the f1 statement. 
Hear the result by clicking [[elisp:(cscsd-process)]].

You may now want to store the widget in the CSD. Do so by selecting
item "Store" in the corresponding submenu of the emacs "Widgets" menu.

Note that all these operations did not change the CSD file; only the buffer
has been modified. Do not save the changes since this file is part of the
documentation !

================================================================== </About>

<CsoundSynthesizer>
<CsOptions>
-dodac
</CsOptions>
<CsInstruments>

; Initialize the global variables.
sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

; Instrument #1.
instr 1
  kamp	    =  25000
  kcps	    =  440
  ifn	    =  1

  ; Play the wave stored in Table #1.
  kfo	    oscil     200, 5, ifn
  a1	    oscil     kamp, kcps + kfo, ifn
	    out	      a1
endin


</CsInstruments>
<CsScore>
f1 0 1025 -7 0 25 0.146 22 0.252 20 0.329 17 0.383 17 0.427 15 0.458 15 0.482 12 0.498 12 0.51 12 0.52 15 0.528 20 0.535 45 0.538 28 0.252 25 0.043 22 -0.107 19 -0.214 19 -0.301 17 -0.361 17 -0.408 14 -0.44 14 -0.464 14 -0.483 17 -0.499 22 -0.512 50 -0.518 30 -0.312 27 -0.162 24 -0.054 21 0.023 21 0.086 18 0.129 18 0.163 15 0.185 15 0.203 15 0.217 18 0.228 24 0.237 54 0.242 20 0.176 18 0.128 16 0.094 14 0.069 14 0.05 12 0.036 12 0.025 10 0.018 10 0.012 10 0.008 12 0.004 16 0.001 37 0


; Play Instrument #1 for 2 seconds.
i 1 0 2
e


</CsScore>
</CsoundSynthesizer>

<WIDGET>f1 edition
Envelope Editor
'H4sIAAAAAAAAAK1WW2wUVRieszN79lZmt1BKH0Q3piY12AioSEh0l0tbS7ahsBW8YZydObaHzs6MZ2ZLl8RQIj4gKIqJBnxREwNETdAoqYZkARMIUYxoeEIjYDAxKqBRxIiu5zKz020w8YFN9+/81/P9l/nPJiRJ6oRqjzWGTNtBPQb2bJKmwq43jiZz9Xo9Tp+jzKoFZpYRpI0O2tjyHtAsw0TpLun87fkrSaqVmJ0EmGEUZoaIZrlmRUeWt9w2baJwJeD/RCx1wCbOSM+4hywX25YckQEA7MvUMpzZb1Bf7FVXYN2jeo1UmXOEnaIIk9RS17V1rDE1bDcofF0z8SZkrBtBVh/RSiVkRDKy9BHsmKYsegR5+ghVA9A4MbEG6Z5mDZtI8FGep5q7tOXqLVuuZtXavpe9Qxs2SxkZdKi5yzmZ/am5vfdczM87cFjkPTMoY1gohhr46WdapHnpbP5A9uzHvGSM9ANGV1HVxrAGFPUrYbosB2Z0LBI8fSeAUyhxAeeH4fkte/S8mjv5fre6VunwpRfu/bljNKvmTp1+5+BvKJmJggKV7jt1X+zW2Wrui8rz+xdtaPNxtZ1bOXvL0A3Gdfap8tP3L1mp1r69bfuvD9W6fOmlyvpDy+apta+7fj+687Eugevse9vmFhf3qrVv3tp27UT2cR9XIuskDm+6wbg+O7wQ76gvoof+tXj/QOedQvr55Oofn715Us2drz5zZMHpdwWuk5NvL7j4Iq3tucmvluyYcdzHVX/ivPT6lRuLq7bzusMWSINhY7j4SDXepxicE45cv+Uh4tgmfzP4/EHQzRCATEw+zr5cSAHIF+LBSxuDsx608BgirmYWtHLJ0Iqm7UEwLiY7sQK7o4PEHq9CKNQAtm7E3shyU3PdtdSNnrUkPmXYAWx/tFxZtb7berJi8Xe4e7ybxQTxADWAcwq4jD1kLHUcE+sU8BhaRQxEYIJo2EXGkB3GlIUjha2M80eW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