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

This demo, to be used within Emacs in Surmulot, demonstrates the interactive
edition of sound wave and envelope within a CSD.

Before modifying anything here, please save this buffer into another file, so
that there is no risk to alter this piece of documentation...

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. To test the effect, do "insert as f-table"
from the "emacs" submenu in the envelope editor. This will refresh the f1
statement. Hear the result by clicking [[elisp:(cscsd-process)]].

Similarly, another widget has been stored; it is a function editor (see
[[info:surmulot.info:Function%20editor][Function editor]]) which has been used to create the sound wave read by the 
soundin opcode.

Let's play with it: do [[elisp:(surmulot-widget-restore "wave")]]. From the widget
menu "f1" submenu you can select "play" to hear the function as a sound. 

Now still from the "f1" menu select the top item and change the formula to 
"((((x + 0.5) * 500) * (((10 * x) fractionPart) sin)) sin)",
then select "insert as file" and accept the proposed file name. This will 
update the CsFileB area used to feed the soundin opcode.

Hear how it sounds: [[elisp:(cscsd-process)]].

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

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

sr = 44100
kr = 44100
ksmps = 1
nchnls = 1

instr 1
  asig	    soundin   "asound.wav"
  kamp	    oscil1    0, 1, p3, 1
	    out	      asig * kamp
endin


</CsInstruments>
<CsScore>
f1 0 1025 -7 0 5 0.006 2 0.017 2 0.032 2 0.05 2 0.073 2 0.103 2 0.148 2 0.204 2 0.285 2 0.402 2 0.547 3 0.747 3 0.991 12 0.777 12 0.609 12 0.479 12 0.378 12 0.299 12 0.237 12 0.189 12 0.152 12 0.123 12 0.1 15 0.08 22 0.058 37 0.038 49 0.027 19 0.028 19 0.03 19 0.033 19 0.037 19 0.043 25 0.052 37 0.07 56 0.103 248 0.272 37 0.29 25 0.3 19 0.306 19 0.311 19 0.315 19 0.317 19 0.318 6 0.318 6 0.247 6 0.192 6 0.149 6 0.116 6 0.09 6 0.069 6 0.054 6 0.041 6 0.032 6 0.024 8 0.017 12 0.01 19 0.004 26 0


i 1 0 4
e

</CsScore>

<CsFileB filename=asound.wav>
[encoded data, 238315 characters]
XwqD6iwpUeaClBoYa+qbWc2dfRgEYYDYENd+AAAAAAAA
</CsFileB>

</CsoundSynthesizer>

<WIDGET>f1 edition
Envelope Editor
'[encoded data, 5820 characters]'</WIDGET>

<WIDGET>wave
Function Editor
'H4sIAAAAAAAAAJ1VzW/jRBT3+GNiN2nqdNkWgYByQLAslcoJCZDa3W6LkFo2kF16ACQm8TQdcGzLnuw2t0p8iAN3OHDnhoAr0nJAQtz4B7ghLnApB4SQgOx82c5LFiGw5Il/7735vfdmXt4LLMt6GK+8tD9OBpylyV7EeJqvCOkT5M7S9nQ69cW3haSdi73dNE5zV4pdIdhonjnIm0pdC7cP0zw72TvlNCkEkWPbCCFHvFLt4NUXI5pwxifXmHJE8omkaEv6+41N80pRpANGpB7f12fDIc1743w0jlN+xKIh5UsymNCxPsTLEcvpgF9jRRaTifSFkFI0o5wM9xLSj2lka4kwSMd8PycjKh0FuHlQS2QU1j0WNPelvWbCKSuoSpPrqL1uyhIubOz3xYLuVGGkGQhjLdKx7qajbMxVkjeY9v+eMujEpOCH6big3bRgUh866KrkfEoavWN4NcsLOTO8oU6vK/zRnDNa6LsKD+bEOCgyMqD7LI7FMaJfnPLEWoYgjdlgIjdj3OoNckoTTaHTdHqUq4OQN4aROXD70rxsxQrR6heXzU0t6pXLICZ9Gtc5NPtpHonL5pOY6vBbPTbKYnpVyVHoWpvuhm9bpuwwakzPzs7U7SiCFXMxcyc3e58iIvtTnUvwiigdkgxjKu3alnnaX5//vPXMA8Ouku6ERrr968Xvv/vp48+RojiXma1VqV+Sqb2pvGhuX1SVqnApc+XimTCdl6tqsgHyShTIZalEDtDZADUXLSuEgSUCumWAGovIA5xVnP5inB4waAKDFkDQchnoHgQhtIHuAtA9BFBHIRVoKVoHBo8AdBGgELjp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