extended test for quoted string within string

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
instr 1
  S1 = {{this is a "string"
  }}
  schedule 2,0,1,S1
endin

instr 2
  prints p4
endin

schedule(2, 1, 1, {{ This is also a "string"
}})
schedule(2, 0.5, 1, "This is simple \"string\" with escaped string inside\n")

</CsInstruments>
<CsScore>
i1 0 1

f0 3
</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
instr 1
  S1 = {{this is a "string"
  }}
  schedule 2,0,1,S1
endin

instr 2
  prints p4
endin

schedule(2, 1, 1, {{ This is also a "string"
}})

</CsInstruments>
<CsScore>
i1 0 1

f0 3
</CsScore>
</CsoundSynthesizer>


*** empty log message ***

*** empty log message ***

<CsoundSynthesizer>
<CsOptions>
csound -m255 -M0 -+rtmidi=null -RWf --midi-key=4 --midi-velocity=5 -o jacko_test.wav
</CsOptions>
<CsInstruments>

; Unit tests for the Jack opcodes.
; To do:
; -- Python score generator and client runner.

sr    	   = 48000
ksmps 	   = 128
nchnls 	   = 2
0dbfs 	   = 1

	   JackoInit		"default", "csound"

	   ; To use ALSA midi ports, use "jackd -Xseq"
	   ; and use "jack_lsp -A -c" or aliases from JackInfo
	   ; to figure out the damn port names.

	   JackoMidiInConnect   "alsa_pcm:in-134-0-Master", "midiin"
	   JackoAudioInConnect 	"aeolus:out.L", "leftin"
	   JackoAudioInConnect 	"aeolus:out.R", "rightin"
	   JackoMidiOutConnect 	"midiout", "aeolus:Midi/in"

           ; Note that Jack enables audio to be output to a regular
 	   ; Csound soundfile and, at the same time, to a sound
	   ; card in real time to the system client via Jack.

       	   JackoAudioOutConnect "leftout", "system:playback_1"
	   JackoAudioOutConnect "rightout", "system:playback_2"
	   JackoInfo

	   ; Turning freewheeling on seems automatically
           ; to turn system playback off. This is good!

	   JackoFreewheel	1
	   JackoOn

	   alwayson		"jackin"

	   instr 1
	   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ichannel   =			p1 - 1
itime 	   = 			p2
iduration  = 			p3
ikey 	   = 			p4
ivelocity  = 			p5
	   JackoNoteOut 	"midiout", ichannel, ikey, ivelocity
	   print 		itime, iduration, ichannel, ikey, ivelocity
	   endin

	   instr jackin
	   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	   JackoTransport	3, 1.0
aleft 	   JackoAudioIn		"leftin"
aright 	   JackoAudioIn 	"rightin"

	   ; Aeolus uses MIDI controller 98 to control stops.
           ; Only 1 data value byte is used, not the 2 data
	   ; bytes often used  with NRPNs.
           ; The format for control mode is 01mm0ggg:
	   ; mm 10 to set stops, 0, ggg group (or Division, 0 based).
	   ; The format for stop selection is 000bbbbb:
	   ; bbbbb for button number (0 based).

	   ; Mode to enable stops for Divison I: b1100010 (98
           ; [this controller VALUE is a pure coincidence]).

	   JackoMidiOut          "midiout", 176, 0, 98, 98

	   ; Stops: Principal 8 (0), Principal 4 (1) , Flote 8 (8) , Flote 2 (10)

	   JackoMidiOut          "midiout", 176, 0, 98, 0
	   JackoMidiOut          "midiout", 176, 0, 98, 1
	   JackoMidiOut          "midiout", 176, 0, 98, 8
	   JackoMidiOut          "midiout", 176, 0, 98, 10

	   ; Sends audio coming in from Aeolus out
	   ; not only to the Jack system out (sound card),
	   ; but also to the output soundfile.
           ; Note that in freewheeling mode, "leftout"
           ; and "rightout" simply go silent.

 	   JackoAudioOut 	"leftout", aleft
	   JackoAudioOut 	"rightout", aright
	   outs  		aright, aleft
	   endin

</CsInstruments>
<CsScore>

i 1 1 30 60 60
i 1 2 30 64 60
i 1 3 30 71 60
e 2

</CsScore>
</CsoundSynthesizer>


git is a mess

git is a mess

<CsoundSynthesizer>
<CsOptions>
-d
</CsOptions>
<CsInstruments>

opcode Test,k,[k]

kS[] xin
k1 = kS[0]
   xout k1

endop

instr 1

kS[] init 2
ks[0] = 1
k2 Test kS
   printk2 k2

endin

</CsInstruments>
<CsScore>

i1 0 1

</CsScore>
</CsoundSynthesizer>
<bsbPanel>
 Widgets
 <objectName/>
 <x>614</x>
 <y>61</y>
 <width>695</width>
 <height>747</height>
 <visible>true</visible>
 <uuid/>
 <bgcolor mode="nobackground">
  <r>231</r>
  <g>46</g>
  255
 </bgcolor>
 <bsbObject version="2" type="BSBVSlider">
  <objectName>slider1</objectName>
  <x>5</x>
  <y>5</y>
  <width>20</width>
  <height>100</height>
  <uuid>{fe924818-39b1-44b5-b240-331a49ca0049}</uuid>
  <visible>true</visible>
  <midichan>0</midichan>
  <midicc>-3</midicc>
  <minimum>0.00000000</minimum>
  <maximum>1.00000000</maximum>
  <value>0.00000000</value>
  <mode>lin</mode>
  <mouseControl act="jump">continuous</mouseControl>
  <resolution>-1.00000000</resolution>
  <randomizable group="0">false</randomizable>
 </bsbObject>
</bsbPanel>
<bsbPresets>
</bsbPresets>
<MacGUI>
ioView nobackground {59367, 11822, 65535}
ioSlider {5, 5} {20, 100} 0.000000 1.000000 0.000000 slider1
</MacGUI>

<CsoundSynthesizer>
<CsOptions>
-d
</CsOptions>
<CsInstruments>

opcode Test,k,[k]

kS[] xin
k1 = kS[0]
   xout ks1

endop

instr 1

;kS[] init 2
; ks[0] = 1
;k2 Test kS[]
   ;printk2 k2

endin

</CsInstruments>
<CsScore>

i1 0 1

</CsScore>
</CsoundSynthesizer>
<bsbPanel>
 Widgets
 <objectName/>
 <x>614</x>
 <y>61</y>
 <width>695</width>
 <height>747</height>
 <visible>true</visible>
 <uuid/>
 <bgcolor mode="nobackground">
  <r>231</r>
  <g>46</g>
  255
 </bgcolor>
 <bsbObject version="2" type="BSBVSlider">
  <objectName>slider1</objectName>
  <x>5</x>
  <y>5</y>
  <width>20</width>
  <height>100</height>
  <uuid>{fe924818-39b1-44b5-b240-331a49ca0049}</uuid>
  <visible>true</visible>
  <midichan>0</midichan>
  <midicc>-3</midicc>
  <minimum>0.00000000</minimum>
  <maximum>1.00000000</maximum>
  <value>0.00000000</value>
  <mode>lin</mode>
  <mouseControl act="jump">continuous</mouseControl>
  <resolution>-1.00000000</resolution>
  <randomizable group="0">false</randomizable>
 </bsbObject>
</bsbPanel>
<bsbPresets>
</bsbPresets>
<MacGUI>
ioView nobackground {59367, 11822, 65535}
ioSlider {5, 5} {20, 100} 0.000000 1.000000 0.000000 slider1
</MacGUI>


Got to work on Windows, removed irrelevancies, commented.

<CsoundSynthesizer>
<CsOptions>

; Audio     Audio
; output    output
; software  hardware  Audio        MIDI
; buffer    buffer    output       input
; frames    frames    port number  port number

; Command-line options for Windows:

  -b100     -B100     -o dac8      -M 0

</CsOptions>
<CsInstruments>

; Sample frames per second.

sr = 44100

; Sample frames per control period.

ksmps = 100

; Audio output channel.

nchnls = 1

; Output amplitudes will be normalized so 32767 is maximum.

0dbfs = 32767

; Allocate global sine wave table for oscillators.

giafno ftgen 1,          0,      65537,  10,     1

instr 1
			; Note duration is -1 for MIDI (note stays on till turned off), or else comes from the score.
                        mididefault             -1, p3
			; p4 is MIDI key translated to linear octaves, p5 is MIDI velocity, or else comes from the score.
                        midinoteonoct           p4, p5
			; Print pfield values.
                        print                   p2, p3, p4, p5
			; Simple sine wave instrument.
a1                      oscili                  ampdb(p5), cpsoct(p4), giafno
                        out                     a1
endin

</CsInstruments>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
csound -b100 -B100 -odac:plughw:0 -M3
</CsOptions>
<CsInstruments>
sr = 44100
kr = 441
ksmps = 100
nchnls = 1
0dbfs = 32767
iafno ftgen 1,          0,      65537,  10,     1 ; Sine wave.
print ampdb(80)

instr 1,2,3 ; Filtered noise, Michael Bergeman
; INITIALIZATION
                        mididefault             20, p3
                        midinoteonoct           p4, p5
                        print                   p2, p3, p4, p5
a1                      oscili                  ampdb(p4), cpsoct(p4), iafno
                        out                     a1
endin

</CsInstruments>
<CsScore>
f 0 1000

</CsScore>
</CsoundSynthesizer>


no message

no message

<CsoundSynthesizer>
<CsOptions>
csound -RWfo chuas_oscillator.wav
</CsOptions>
<CsInstruments
sr              =           44100
ksmps           =           100
nchnls          =           2
0dbfs           =           10000

gibuzztable     ftgen       1, 0, 16384, 10, 1

                instr 1
                ; sys_variables = system_vars(5:12); % L,R0,C2,G,Ga,Gb,E,C1 or p8:p15
                ; integ_variables = [system_vars(14:16),system_vars(1:2)]; % x0,y0,z0,dataset_size,step_size or p17:p19, p4:p5
istep_size 	    =           p5
iL 	            =           p8
iR0             =           p9
iC2             =           p10
iG 	            =           p11
iGa             =           p12
iGb             =           p13
iE              =           p14
iC1             =           p15
iI3             =           p17
iV2             =           p18
iV1             =           p19
iattack         =           0.02
isustain        =           p3
irelease        =           0.02
p3              =           iattack + isustain + irelease
iscale          =           1.0
adamping        linseg	    0.0, iattack, iscale, isustain, iscale, irelease, 0.0
aguide          buzz        5000, 440, sr/440, gibuzztable
aI3, aV2, aV1   chuap       iL, iR0, iC2, iG, iGa, iGb, iE, iC1, iI3, iV2, iV1, istep_size
asignal         balance     aV2, aguide
                outs        adamping * asignal, adamping * asignal
                endin
</CsInstruments>
<CsScore>
;        Adapted from ABC++ MATLAB example data.
i 1 0 20 1500 .1   -1 -1 -0.00707925 0.00001647 100  1 -.99955324 -1.00028375 1 -.00222159 204.8 -2.36201596260071 3.08917625807226e-03 3.87075614929199 7 .4 .004 1 86 30; torus attractor ( gallery of attractors )
i 1 + 20 1500 .425  0 -1  1.3506168  0              -4.50746268737 -1 2.4924 .93 1 1 0 -22.28662665 .009506608 -22.2861576 32 10 2 20 86 30 ; heteroclinic orbit
i 1 + 20 1024 .05  -1 -1  0.00667    0.000651    10 -1 .856 1.1 1 .06 51.2 -20.200590133667 .172539323568344 -4.07686233520508 2.5 10 .2 1 66 81 ; periodic attractor (torus breakdown route)
i 1 + 20 1024	0.05	-1	-1	0.00667	0.000651	10	-1	0.856	1.1	1	0.1	153.6	21.12496758	0.03001749	0.515828669	2.5	10	0.2	1	66	81	 ; torus attractor (torus breakdown route)'
</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
csound -RWfo chuas_oscillator.wav
</CsOptions>
<CsInstruments
sr              =           44100
ksmps           =           100
nchnls          =           2
0dbfs           =           10000

gibuzztable     ftgen       1, 0, 16384, 10, 1

                instr 1
                ; Adapted from ABC++ MATLAB example data.
                ; sys_variables = system_vars(5:12); % L,R0,C2,G,Ga,Gb,E,C1 or p8:p15
                ; integ_variables = [system_vars(14:16),system_vars(1:2)]; % x0,y0,z0,dataset_size,step_size or p17:p19, p4:p5
istep_size 	    =           p5
iL 	            =           p8
iR0             =           p9
iC2             =           p10
iG 	            =           p11
iGa             =           p12
iGb             =           p13
iE              =           p14
iC1             =           p15
iI3             =           p17
iV2             =           p18
iV1             =           p19
iattack         =           0.02
isustain        =           p3
irelease        =           0.02
p3              =           iattack + isustain + irelease
iscale          =           1.0
adamping        linseg	    0.0, iattack, iscale, isustain, iscale, irelease, 0.0
aguide          buzz        5000, 440, sr/440, gibuzztable
aI3, aV2, aV1   chuap       iL, iR0, iC2, iG, iGa, iGb, iE, iC1, iI3, iV2, iV1, istep_size
asignal         balance     aV2, aguide
                outs        adamping * asignal, adamping * asignal
                endin
</CsInstruments>
<CsScore>
i 1 0 20 1500 .1   -1 -1 -0.00707925 0.00001647 100  1 -.99955324 -1.00028375 1 -.00222159 204.8 -2.36201596260071 3.08917625807226e-03 3.87075614929199 7 .4 .004 1 86 30; torus attractor ( gallery of attractors )
i 1 + 20 1500 .425  0 -1  1.3506168  0              -4.50746268737 -1 2.4924 .93 1 1 0 -22.28662665 .009506608 -22.2861576 32 10 2 20 86 30 ; heteroclinic orbit
i 1 + 20 1024 .05  -1 -1  0.00667    0.000651    10 -1 .856 1.1 1 .06 51.2 -20.200590133667 .172539323568344 -4.07686233520508 2.5 10 .2 1 66 81 ; periodic attractor (torus breakdown route)
i 1 + 20 1024	0.05	-1	-1	0.00667	0.000651	10	-1	0.856	1.1	1	0.1	153.6	21.12496758	0.03001749	0.515828669	2.5	10	0.2	1	66	81	 ; torus attractor (torus breakdown route)'
</CsScore>
</CsoundSynthesizer>


no message

no message

<CsoundSynthesizer>
<CsOptions>
csound -R -W -Z -f
</CsOptions>
<CsInstruments>
sr          =           88200
ksmps       =           1
nchnls      =           2
;--------------------------------------------------------
;Instrument 1 : plucked strings chorused left/right and
;       pitch-shifted and delayed taps thru exponential
;       functions, and delayed.
;--------------------------------------------------------

            instr       1
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kvib        poscil      1/120, ipch/50, 1      ;vibrato
ag          pluck       2000, cpsoct(ioct+kvib), 1000, 1, 1
agleft      pluck       2000, cpsoct(ioct+ishift), 1000, 1, 1
agright     pluck       2000, cpsoct(ioct-ishift), 1000, 1, 1
adamping    linsegr     0.0, 0.006, 1.0, p3 - 0.066, 1.0, 0.06, 0.0
ag          =           adamping * ag
agleft      =           adamping * agleft
agright     =           adamping * agright
af1         expon       .1, p3, 1.0             ;exponential from 0.1 to 1.0
af2         expon       1.0, p3, .1             ;exponential from 1.0 to 0.1
adump       delayr      2.0                     ;set delay line of 2.0 sec
atap1       deltap3     af1                     ;tap delay line with kf1 func.
atap2       deltap3     af2                     ;tap delay line with kf2 func.
ad1         deltap3     2.0                     ;delay 2 sec.
ad2         deltap3     1.1                     ;delay 1.1 sec.
            delayw      ag                      ;put ag signal into delay line.
            outs        agleft+atap1+ad1, agright+atap2+ad2
            endin
;-------------------------------------------------------------
;Instrument 2 : plucked strings chorused left/right and
;       pitch-shifted with fixed delayed taps.
;------------------------------------------------------------

            instr       2
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kvib        poscil      1/120, ipch/50, 1       ;vibrato
ag          pluck       1000, cpsoct(ioct+kvib), 1000, 1, 1
agleft      pluck       1000, cpsoct(ioct+ishift), 1000, 1, 1
agright     pluck       1000, cpsoct(ioct-ishift), 1000, 1, 1
adamping    linsegr     0.0, 0.006, 1.0, p3 - 0.066, 1.0, 0.06, 0.0
ag          =           adamping * ag
agleft      =           adamping * agleft
agright     =           adamping * agright
adump       delayr      0.3                     ;set delay line of 0.3 sec
ad1         deltap3     0.1                     ;delay 100 msec.
ad2         deltap3     0.2                     ;delay 200 msec.
            delayw      ag                      ;put ag sign into del line.
            outs        agleft+ad1, agright+ad2
            endin
;-----------------------------------------------------------
;Instrument 3 : New FM algorithm, modified to produce large timbre
;               shifts using modulation of I and r. Detuned chorusing employed.
;-----------------------------------------------------------
            instr       3
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
aadsr       linsegr     0, p3/3, 1.0, p3/3, 1.0, p3/3, 0 ;ADSR envelope
amodi       linseg      0, p3/3, 5, p3/3, 3, p3/3, 0 ;ADSR envelope for I
amodr       linseg      p6, p3, p7              ;r moves from p6->p7 in p3 sec.
a1          =           amodi*(amodr-1/amodr)/2
a1ndx       =           abs(a1*2/20)            ;a1*2 is normalized from 0-1.
a2          =           amodi*(amodr+1/amodr)/2
a3          tablei      a1ndx, 3, 1             ;lookup tbl in f3, normal index
ao1         poscil      a1, ipch, 2             ;cosine
a4          =           exp(-0.5*a3+ao1)
ao2         poscil      a2*ipch, ipch, 2        ;cosine
aoutl       poscil      1000*aadsr*a4, ao2+cpsoct(ioct+ishift), 1 ;fnl outleft
aoutr       poscil      1000*aadsr*a4, ao2+cpsoct(ioct-ishift), 1 ;fnl outright
            outs        aoutl, aoutr
            endin

</CsInstruments>
<CsScore>
;       Score for final project in Digital Audio Processing
;       ---------------------------------------------------

;           Piece entitled :  X A N A D U (short version)
;                           Joseph T. Kung, 12/12/88
;            Instruments modified for higher precision
;                         Michael Gogins, 07/22/2006

;           The first part of the score will specify all function
;       tables used in the piece. The second part specifies
;       the instruments and notes. The latter is divided into
;       7 sections, each playing a chord on a different
;                 instrument.
;       The chords are uncommon guitar chords that use the open
;       B and E strings often. These will be transposed by
;       octaves on some chords.

;       Each instrument will play a chord for 15 seconds. The
;                 timbre
;       of the instrument will change in that interval and join
;       with the next instrument/chord sequence. Instrument 3
;       uses a modified FM synthesis technique. This is joined
;       by an additional plucked-string instrument
;       (instruments 1 and 2).

;   The Function Tables
;   -------------------
;All functions are post-normalized (max value is 1) if p4 is
;POSITIVE.

f1 0 65536 10 1      ;sine wave
f2 0 65536 11 1      ;cosine wave
f3 0 65536 -12 20.0  ;unscaled ln(I(x)) from 0 to 20.0

;-----------------------------------------------------------

;----- This section comprises all the new FM sounds -----------

;F#7addB chord on a guitar
i3 0 15 0 7.06 2.0 0.2  ;F#
i3 . . . 8.01 . .   ;C# above
i3 . . . 8.06 . .   ;F# octave above 1st one
i3 . . . 8.10 . .   ;Bb next one up
i3 . . . 8.11 . .   ;B
i3 . . . 9.04 . .   ;E

;D6add9 chord on a guitar
i3 7.5 15 0 6.02 1.7 0.5    ;D
i3 . . . 6.09 . .   ;A above
i3 . . . 7.02 . .   ;D octave above 1st one
i3 . . . 7.06 . .   ;F# next one up
i3 . . . 6.11 . .   ;B
i3 . . . 7.04 . .   ;E

;Bmajadd11 chord on a guitar
i3 15 15 0 7.11 1.4 0.8 ;B
i3 . . . 8.06 . .   ;F# above
i3 . . . 8.11 . .   ;B octave above 1st one
i3 . . . 9.03 . .   ;D# next one up
i3 . . . 8.11 . .   ;B
i3 . . . 9.04 . .   ;E;

;Amajadd9 chord on a guitar
i3 22.5 15 0 6.09 1.1 1.1   ;A
i3 . . . 7.04 . .   ;E above
i3 . . . 8.09 . .   ;A octave above 1st one
i3 . . . 8.01 . .   ;C# next one up
i3 . . . 7.11 . .   ;B
i3 . . . 8.04 . .   ;E

;Bmajadd11 chord on a guitar
i3 30 15 0 6.11 0.8 1.4 ;B
i3 . . . 7.06 . .   ;F# above
i3 . . . 7.11 . .   ;B octave above 1st one
i3 . . . 8.03 . .   ;D# next one up
i3 . . . 7.11 . .   ;B
i3 . . . 8.04 . .   ;E;

;Gmaj6 chord on a guitar
i3 37.5 15 0 5.07 0.5 1.7   ;G
i3 . . . 6.02 . .   ;D above
i3 . . . 6.07 . .   ;G octave above 1st one
i3 . . . 6.11 . .   ;B on G string
i3 . . . 6.11 . .   ;B
i3 . . . 7.04 . .   ;E

;F#7addB chord on a guitar
i3 45 15 0 7.06 0.2 2.0 ;F#
i3 . . . 8.01 . .   ;C# above
i3 . . . 8.06 . .   ;F# octave above 1st one
i3 . . . 8.10 . .   ;Bb next one up
i3 . . . 8.11 . .   ;B
i3 . . . 9.04 . .   ;E

; This section adds the plucked chords to the beginning of each
; section.

;F#7addB chord on a guitar
i1 0 10 0 8.06  ;F#
i1 0.1 . . 9.01 ;C# above
i1 0.2 . . 9.06 ;F# octave above 1st one
i1 0.3 . . 9.10 ;Bb next one up
i1 0.4 . . 9.11 ;B
i1 0.5 . . 10.04    ;E

;D6add9 chord on a guitar
i2 7.5 10 0 8.02    ;D
i2 7.6 . . 8.09     ;A above
i2 7.7 . . 9.02     ;D octave above 1st one
i2 7.8 . . 9.06     ;F# next one up
i2 7.9 . . 9.11     ;B
i2 8.0 . . 10.04    ;E

;Bmajadd11 chord on a guitar
i2 15 10 0 8.11     ;B
i2 15.1 . . 9.06    ;F# above
i2 15.2 . . 9.11    ;B octave above 1st one
i2 15.3 . . 10.03   ;D# next one up
i2 15.4 . . 9.11    ;B
i2 15.5 . . 10.04   ;E;

;Amajadd9 chord on a guitar
i2 22.5 10 0 8.09   ;A
i2 22.6 . . 9.04    ;E above
i2 22.7 . . 10.09   ;A octave above 1st one
i2 22.8 . . 10.01   ;C# next one up
i2 22.9 . . 9.11    ;B
i2 23.0 . . 10.04   ;E

;Bmajadd11 chord on a guitar
i2 30 10 0 8.11     ;B
i2 30.1 . . 9.06    ;F# above
i2 30.2 . . 9.11    ;B octave above 1st one
i2 30.3 . . 10.03   ;D# next one up
i2 30.4 . . 9.11    ;B
i2 30.5 . . 10.04   ;E;

;Gmaj6 chord on a guitar
i2 37.5 10 0 8.07   ;G
i2 37.6 . . 9.02    ;D above
i2 37.7 . . 9.07    ;G octave above 1st one
i2 37.8 . . 9.11    ;B on G string
i2 37.9 . . 9.11    ;B
i2 38.0 . . 10.04   ;E

;F#7addB chord on a guitar
i1 45 10 0 9.06     ;F#
i1 45.1 . . 10.01   ;C# above
i1 45.2 . . 10.06   ;F# octave above 1st one
i1 45.3 . . 10.10   ;Bb next one up
i1 45.4 . . 10.11   ;B
i1 45.5 . . 11.04   ;E
e

</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
csound -RWZfo Xanadu-high-resolution.wav temp.orc temp.sco
</CsOptions>
<CsInstruments>
sr          =           88200
ksmps       =           1
nchnls      =           2
;--------------------------------------------------------
;Instrument 1 : plucked strings chorused left/right and
;       pitch-shifted and delayed taps thru exponential
;       functions, and delayed.
;--------------------------------------------------------

            instr       1
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kvib        poscil       1/120, ipch/50, 1       ;vibrato
ag          pluck       2000, cpsoct(ioct+kvib), 1000, 1, 1
agleft      pluck       2000, cpsoct(ioct+ishift), 1000, 1, 1
agright     pluck       2000, cpsoct(ioct-ishift), 1000, 1, 1
af1         expon       .1, p3, 1.0             ;exponential from 0.1 to 1.0
af2         expon       1.0, p3, .1             ;exponential from 1.0 to 0.1
adump       delayr      2.0                     ;set delay line of 2.0 sec
atap1       deltap3     af1                     ;tap delay line with kf1 func.
atap2       deltap3     af2                     ;tap delay line with kf2 func.
ad1         deltap3     2.0                     ;delay 2 sec.
ad2         deltap3     1.1                     ;delay 1.1 sec.
            delayw      ag                      ;put ag signal into delay line.
            outs        agleft+atap1+ad1, agright+atap2+ad2
            endin
;-------------------------------------------------------------
;Instrument 2 : plucked strings chorused left/right and
;       pitch-shifted with fixed delayed taps.
;------------------------------------------------------------

            instr       2
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kvib        poscil       1/120, ipch/50, 1       ;vibrato
ag          pluck       1000, cpsoct(ioct+kvib), 1000, 1, 1
agleft      pluck       1000, cpsoct(ioct+ishift), 1000, 1, 1
agright     pluck       1000, cpsoct(ioct-ishift), 1000, 1, 1
adump       delayr      0.3                     ;set delay line of 0.3 sec
ad1         deltap3     0.1                     ;delay 100 msec.
ad2         deltap3     0.2                     ;delay 200 msec.
            delayw      ag                      ;put ag sign into del line.
            outs        agleft+ad1, agright+ad2
            endin
;-----------------------------------------------------------
;Instrument 3 : New FM algorithm, modified to produce large timbre
;               shifts using modulation of I and r. Detuned chorusing employed.
;-----------------------------------------------------------
            instr       3
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
aadsr       linseg      0, p3/3, 1.0, p3/3, 1.0, p3/3, 0 ;ADSR envelope
amodi       linseg      0, p3/3, 5, p3/3, 3, p3/3, 0 ;ADSR envelope for I
amodr       linseg      p6, p3, p7              ;r moves from p6->p7 in p3 sec.
a1          =           amodi*(amodr-1/amodr)/2
a1ndx       =           abs(a1*2/20)            ;a1*2 is normalized from 0-1.
a2          =           amodi*(amodr+1/amodr)/2
a3          tablei      a1ndx, 3, 1             ;lookup tbl in f3, normal index
ao1         poscil      a1, ipch, 2             ;cosine
a4          =           exp(-0.5*a3+ao1)
ao2         poscil      a2*ipch, ipch, 2        ;cosine
aoutl       poscil      1000*aadsr*a4, ao2+cpsoct(ioct+ishift), 1 ;fnl outleft
aoutr       poscil      1000*aadsr*a4, ao2+cpsoct(ioct-ishift), 1 ;fnl outright
            outs        aoutl, aoutr
            endin

</CsInstruments>
<CsScore>
;       Score for final project in Digital Audio Processing
;       ---------------------------------------------------

;           Piece entitled :  X A N A D U (short version)
;                           Joseph T. Kung, 12/12/88
;            Instruments modified for higher precision
;                         Michael Gogins, 07/22/2006

;           The first part of the score will specify all function
;       tables used in the piece. The second part specifies
;       the instruments and notes. The latter is divided into
;       7 sections, each playing a chord on a different
;                 instrument.
;       The chords are uncommon guitar chords that use the open
;       B and E strings often. These will be transposed by
;       octaves on some chords.

;       Each instrument will play a chord for 15 seconds. The
;                 timbre
;       of the instrument will change in that interval and join
;       with the next instrument/chord sequence. Instrument 3
;       uses a modified FM synthesis technique. This is joined
;       by an additional plucked-string instrument
;       (instruments 1 and 2).

;   The Function Tables
;   -------------------
;All functions are post-normalized (max value is 1) if p4 is
;POSITIVE.

f1 0 65536 10 1      ;sine wave
f2 0 65536 11 1      ;cosine wave
f3 0 65536 -12 20.0  ;unscaled ln(I(x)) from 0 to 20.0

;-----------------------------------------------------------

;----- This section comprises all the new FM sounds -----------

;F#7addB chord on a guitar
i3 0 15 0 7.06 2.0 0.2  ;F#
i3 . . . 8.01 . .   ;C# above
i3 . . . 8.06 . .   ;F# octave above 1st one
i3 . . . 8.10 . .   ;Bb next one up
i3 . . . 8.11 . .   ;B
i3 . . . 9.04 . .   ;E

;D6add9 chord on a guitar
i3 7.5 15 0 6.02 1.7 0.5    ;D
i3 . . . 6.09 . .   ;A above
i3 . . . 7.02 . .   ;D octave above 1st one
i3 . . . 7.06 . .   ;F# next one up
i3 . . . 6.11 . .   ;B
i3 . . . 7.04 . .   ;E

;Bmajadd11 chord on a guitar
i3 15 15 0 7.11 1.4 0.8 ;B
i3 . . . 8.06 . .   ;F# above
i3 . . . 8.11 . .   ;B octave above 1st one
i3 . . . 9.03 . .   ;D# next one up
i3 . . . 8.11 . .   ;B
i3 . . . 9.04 . .   ;E;

;Amajadd9 chord on a guitar
i3 22.5 15 0 6.09 1.1 1.1   ;A
i3 . . . 7.04 . .   ;E above
i3 . . . 8.09 . .   ;A octave above 1st one
i3 . . . 8.01 . .   ;C# next one up
i3 . . . 7.11 . .   ;B
i3 . . . 8.04 . .   ;E

;Bmajadd11 chord on a guitar
i3 30 15 0 6.11 0.8 1.4 ;B
i3 . . . 7.06 . .   ;F# above
i3 . . . 7.11 . .   ;B octave above 1st one
i3 . . . 8.03 . .   ;D# next one up
i3 . . . 7.11 . .   ;B
i3 . . . 8.04 . .   ;E;

;Gmaj6 chord on a guitar
i3 37.5 15 0 5.07 0.5 1.7   ;G
i3 . . . 6.02 . .   ;D above
i3 . . . 6.07 . .   ;G octave above 1st one
i3 . . . 6.11 . .   ;B on G string
i3 . . . 6.11 . .   ;B
i3 . . . 7.04 . .   ;E

;F#7addB chord on a guitar
i3 45 15 0 7.06 0.2 2.0 ;F#
i3 . . . 8.01 . .   ;C# above
i3 . . . 8.06 . .   ;F# octave above 1st one
i3 . . . 8.10 . .   ;Bb next one up
i3 . . . 8.11 . .   ;B
i3 . . . 9.04 . .   ;E

; This section adds the plucked chords to the beginning of each
; section.

;F#7addB chord on a guitar
i1 0 10 0 8.06  ;F#
i1 0.1 . . 9.01 ;C# above
i1 0.2 . . 9.06 ;F# octave above 1st one
i1 0.3 . . 9.10 ;Bb next one up
i1 0.4 . . 9.11 ;B
i1 0.5 . . 10.04    ;E

;D6add9 chord on a guitar
i2 7.5 10 0 8.02    ;D
i2 7.6 . . 8.09     ;A above
i2 7.7 . . 9.02     ;D octave above 1st one
i2 7.8 . . 9.06     ;F# next one up
i2 7.9 . . 9.11     ;B
i2 8.0 . . 10.04    ;E

;Bmajadd11 chord on a guitar
i2 15 10 0 8.11     ;B
i2 15.1 . . 9.06    ;F# above
i2 15.2 . . 9.11    ;B octave above 1st one
i2 15.3 . . 10.03   ;D# next one up
i2 15.4 . . 9.11    ;B
i2 15.5 . . 10.04   ;E;

;Amajadd9 chord on a guitar
i2 22.5 10 0 8.09   ;A
i2 22.6 . . 9.04    ;E above
i2 22.7 . . 10.09   ;A octave above 1st one
i2 22.8 . . 10.01   ;C# next one up
i2 22.9 . . 9.11    ;B
i2 23.0 . . 10.04   ;E

;Bmajadd11 chord on a guitar
i2 30 10 0 8.11     ;B
i2 30.1 . . 9.06    ;F# above
i2 30.2 . . 9.11    ;B octave above 1st one
i2 30.3 . . 10.03   ;D# next one up
i2 30.4 . . 9.11    ;B
i2 30.5 . . 10.04   ;E;

;Gmaj6 chord on a guitar
i2 37.5 10 0 8.07   ;G
i2 37.6 . . 9.02    ;D above
i2 37.7 . . 9.07    ;G octave above 1st one
i2 37.8 . . 9.11    ;B on G string
i2 37.9 . . 9.11    ;B
i2 38.0 . . 10.04   ;E

;F#7addB chord on a guitar
i1 45 10 0 9.06     ;F#
i1 45.1 . . 10.01   ;C# above
i1 45.2 . . 10.06   ;F# octave above 1st one
i1 45.3 . . 10.10   ;Bb next one up
i1 45.4 . . 10.11   ;B
i1 45.5 . . 11.04   ;E
e

</CsScore>
</CsoundSynthesizer>


Removed -g option to speed up testing in CsoundVST.


Added GUI editing.

Added GUI editing.

<CsoundSynthesizer>
<CsOptions>
csound -odac4 temp.orc temp.sco
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

; gihandle1 vstinit "c:/projects/music/library/polyiblit.dll", 1
gihandle1 vstinit "c:/Program Files/Steinberg/Cubase SX/vstplugins/Synths/Cheeze Machine/Cheeze Machine.dll", 1
vstedit gihandle1

instr 1
ichannel = p1 - 1
ikey = p4
ivelocity = p5
vstnote gihandle1, ichannel, ikey, ivelocity, p3
ain1 = 0
ab1, ab2 vstplug gihandle1, ain1, ain1
outs ab1, ab2
endin
</CsInstruments>
<CsScore>
i 1 0 10 60 60
i 1 2 1 72 60
i 1 2 2 64 60
i 1 15 15 60.375 60
i 1 15 15 64 60
i 1 18 15 36 60
i 1 15 400 62 60
</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
csound -RWdo temp.wav temp.orc temp.sco
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

; gihandle1 vstinit "c:/projects/music/library/polyiblit.dll", 1
gihandle1 vstinit "c:/Program Files/Steinberg/Cubase SX/vstplugins/Synths/Cheeze Machine/Cheeze Machine.dll", 1

instr 1
ichannel = p1 - 1
ikey = p4
ivelocity = p5
vstnote gihandle1, ichannel, ikey, ivelocity, p3
ain1 = 0
ab1, ab2 vstplug gihandle1, ain1, ain1
outs ab1, ab2
endin
</CsInstruments>
<CsScore>
i 1 0 10 60 60
i 1 2 1 72 60
i 1 2 2 64 60
i 1 15 15 60.375 60
i 1 15 15 64 60
i 1 18 15 36 60
i 1 15 15 62 60
</CsScore>
</CsoundSynthesizer>


no message

no message

<CsoundSynthesizer>
<CsOptions>
csound -RWfo chuas_oscillator.wav
</CsOptions>
<CsInstruments>
sr              =           44100
ksmps           =           100
nchnls          =           2
0dbfs           =           10000

gibuzztable     ftgen       1, 0, 16384, 10, 1

                instr 1
                ; sys_variables = system_vars(5:12); % L,R0,C2,G,Ga,Gb,E,C1 or p8:p15
                ; integ_variables = [system_vars(14:16),system_vars(1:2)]; % x0,y0,z0,dataset_size,step_size or p17:p19, p4:p5
istep_size 	    =           p5
iL 	            =           p8
iR0             =           p9
iC2             =           p10
iG 	            =           p11
iGa             =           p12
iGb             =           p13
iE              =           p14
iC1             =           p15
iI3             =           p17
iV2             =           p18
iV1             =           p19
iattack         =           0.02
isustain        =           p3
irelease        =           0.02
p3              =           iattack + isustain + irelease
iscale          =           1.0
adamping        linseg	    0.0, iattack, iscale, isustain, iscale, irelease, 0.0
aguide          buzz        5000, 440, sr/440, gibuzztable
aI3, aV2, aV1   chuap       iL, iR0, iC2, iG, iGa, iGb, iE, iC1, iI3, iV2, iV1, istep_size
asignal         balance     aV2, aguide
                outs        adamping * asignal, adamping * asignal
                endin
</CsInstruments>
<CsScore>
;        Adapted from ABC++ MATLAB example data.
i 1 0 20 1500 .1   -1 -1 -0.00707925 0.00001647 100  1 -.99955324 -1.00028375 1 -.00222159 204.8 -2.36201596260071 3.08917625807226e-03 3.87075614929199 7 .4 .004 1 86 30; torus attractor ( gallery of attractors )
i 1 + 20 1500 .425  0 -1  1.3506168  0              -4.50746268737 -1 2.4924 .93 1 1 0 -22.28662665 .009506608 -22.2861576 32 10 2 20 86 30 ; heteroclinic orbit
i 1 + 20 1024 .05  -1 -1  0.00667    0.000651    10 -1 .856 1.1 1 .06 51.2 -20.200590133667 .172539323568344 -4.07686233520508 2.5 10 .2 1 66 81 ; periodic attractor (torus breakdown route)
i 1 + 20 1024	0.05	-1	-1	0.00667	0.000651	10	-1	0.856	1.1	1	0.1	153.6	21.12496758	0.03001749	0.515828669	2.5	10	0.2	1	66	81	 ; torus attractor (torus breakdown route)'
</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
csound -RWfo chuas_oscillator.wav
</CsOptions>
<CsInstruments
sr              =           44100
ksmps           =           100
nchnls          =           2
0dbfs           =           10000

gibuzztable     ftgen       1, 0, 16384, 10, 1

                instr 1
                ; sys_variables = system_vars(5:12); % L,R0,C2,G,Ga,Gb,E,C1 or p8:p15
                ; integ_variables = [system_vars(14:16),system_vars(1:2)]; % x0,y0,z0,dataset_size,step_size or p17:p19, p4:p5
istep_size 	    =           p5
iL 	            =           p8
iR0             =           p9
iC2             =           p10
iG 	            =           p11
iGa             =           p12
iGb             =           p13
iE              =           p14
iC1             =           p15
iI3             =           p17
iV2             =           p18
iV1             =           p19
iattack         =           0.02
isustain        =           p3
irelease        =           0.02
p3              =           iattack + isustain + irelease
iscale          =           1.0
adamping        linseg	    0.0, iattack, iscale, isustain, iscale, irelease, 0.0
aguide          buzz        5000, 440, sr/440, gibuzztable
aI3, aV2, aV1   chuap       iL, iR0, iC2, iG, iGa, iGb, iE, iC1, iI3, iV2, iV1, istep_size
asignal         balance     aV2, aguide
                outs        adamping * asignal, adamping * asignal
                endin
</CsInstruments>
<CsScore>
;        Adapted from ABC++ MATLAB example data.
i 1 0 20 1500 .1   -1 -1 -0.00707925 0.00001647 100  1 -.99955324 -1.00028375 1 -.00222159 204.8 -2.36201596260071 3.08917625807226e-03 3.87075614929199 7 .4 .004 1 86 30; torus attractor ( gallery of attractors )
i 1 + 20 1500 .425  0 -1  1.3506168  0              -4.50746268737 -1 2.4924 .93 1 1 0 -22.28662665 .009506608 -22.2861576 32 10 2 20 86 30 ; heteroclinic orbit
i 1 + 20 1024 .05  -1 -1  0.00667    0.000651    10 -1 .856 1.1 1 .06 51.2 -20.200590133667 .172539323568344 -4.07686233520508 2.5 10 .2 1 66 81 ; periodic attractor (torus breakdown route)
i 1 + 20 1024	0.05	-1	-1	0.00667	0.000651	10	-1	0.856	1.1	1	0.1	153.6	21.12496758	0.03001749	0.515828669	2.5	10	0.2	1	66	81	 ; torus attractor (torus breakdown route)'
</CsScore>
</CsoundSynthesizer>


Less aggressive normalizing

Less aggressive normalizing

<CsoundSynthesizer>
<CsOptions>
-odac   -iadc   ;;;realtime audio I/O
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 1
0dbfs  = 1

pyinit

instr 1
	pyruni "from clap import ClapAnalyzer"
	pyruni "clap_analyzer = ClapAnalyzer(pattern=[2, 1, 1, 2], deviation_threshold=0.05)"
	pyruni "def clap_detected(): print 'Clap detected'"
	pyruni "def clap_sequence_detected(): print 'Matching clap sequence detected!'"
	pyruni "clap_analyzer.on_clap(clap_detected)"
	pyruni "clap_analyzer.on_clap_sequence(clap_sequence_detected)"

	kLastRms init 0
	kLastAttack init 0
	iRmsDiffThreshold init .1

	kTime times

	aIn in

	kRmsOrig rms aIn

	kSmoothingFreq linseg 5, 1, 0.01 ;quicker smoothing to start with
	kSmoothRms tonek kRmsOrig, kSmoothingFreq
	kSmoothRms max kSmoothRms, 0.001

	aNorm = 0.1 * aIn / a(kSmoothRms)
	;aNorm butterbp aNorm, 12500, 2500

	kRms rms aNorm
	kRmsDiff = kRms - kLastRms

	if (kRmsDiff > iRmsDiffThreshold && kTime - kLastAttack > 0.09) then
		kLastAttack times
		;pyrun "clap_analyzer.clap()"
		pycall "clap_analyzer.clap", kLastAttack
	endif

	out aNorm
	kLastRms = kRms
endin
</CsInstruments>
<CsScore>

i 1 0 50
e
</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
-odac   -iadc   ;;;realtime audio I/O
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 1
0dbfs  = 1

pyinit

instr 1
	pyruni "from clap import ClapAnalyzer"
	pyruni "clap_analyzer = ClapAnalyzer(pattern=[2, 1, 1, 2], deviation_threshold=0.05)"
	pyruni "def clap_detected(): print 'Clap detected'"
	pyruni "def clap_sequence_detected(): print 'Matching clap sequence detected!'"
	pyruni "clap_analyzer.on_clap(clap_detected)"
	pyruni "clap_analyzer.on_clap_sequence(clap_sequence_detected)"

	kLastRms init 0
	kLastAttack init 0
	iRmsDiffThreshold init .1

	kTime times

	aIn in

	kRmsOrig rms aIn

	kSmoothingFreq linseg 5, 1, 0.01 ;quicker smoothing to start with
	kSmoothRms tonek kRmsOrig, kSmoothingFreq
	kSmoothRms max kSmoothRms, 0.0001

	aNorm = 0.1 * aIn / a(kSmoothRms)
	;aNorm butterbp aNorm, 12500, 2500

	kRms rms aNorm
	kRmsDiff = kRms - kLastRms

	if (kRmsDiff > iRmsDiffThreshold && kTime - kLastAttack > 0.09) then
		kLastAttack times
		;pyrun "clap_analyzer.clap()"
		pycall "clap_analyzer.clap", kLastAttack
	endif

	out aNorm
	kLastRms = kRms
endin
</CsInstruments>
<CsScore>

i 1 0 50
e
</CsScore>
</CsoundSynthesizer>


Clean up inlined python code

Clean up inlined python code

<CsoundSynthesizer>
<CsOptions>
-iadc
--nosound
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 1
0dbfs  = 1

pyinit

instr 1

pyruni {{
import os, sys
from clap import ClapAnalyzer

sys.path.append(os.getcwd())
clap_analyzer = ClapAnalyzer(note_lengths=[0.25, 0.125, 0.125, 0.25, 0.25])

def clap_detected():
	print 'Clap detected'

def clap_sequence_detected():
	print 'Matching clap sequence detected!'

clap_analyzer.on_clap(clap_detected)
clap_analyzer.on_clap_sequence(clap_sequence_detected)
}}

kLastRms init 0
kLastAttack init 0
iRmsDiffThreshold init .1

kTime times

aIn in

kRmsOrig rms aIn

kSmoothingFreq linseg 5, 1, 0.01 ;quicker smoothing to start with
kSmoothRms tonek kRmsOrig, kSmoothingFreq
kSmoothRms max kSmoothRms, 0.001

aNorm = 0.1 * aIn / a(kSmoothRms)

kRms rms aNorm
kRmsDiff = kRms - kLastRms

if (kRmsDiff > iRmsDiffThreshold && kTime - kLastAttack > 0.09) then
	kLastAttack times
	pycall "clap_analyzer.clap", kLastAttack
endif

out aNorm
kLastRms = kRms

endin
</CsInstruments>
<CsScore>

i 1 0 500
e
</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
-iadc
--nosound
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 1
0dbfs  = 1

pyinit

instr 1
	pyruni "import os, sys"
	pyruni "sys.path.append(os.getcwd())"
	pyruni "from clap import ClapAnalyzer"
	pyruni "clap_analyzer = ClapAnalyzer(note_lengths=[0.25, 0.125, 0.125, 0.25, 0.25])"
	pyruni "def clap_detected(): print 'Clap detected'"
	pyruni "def clap_sequence_detected(): print 'Matching clap sequence detected!'"
	pyruni "clap_analyzer.on_clap(clap_detected)"
	pyruni "clap_analyzer.on_clap_sequence(clap_sequence_detected)"

	kLastRms init 0
	kLastAttack init 0
	iRmsDiffThreshold init .1

	kTime times

	aIn in

	kRmsOrig rms aIn

	kSmoothingFreq linseg 5, 1, 0.01 ;quicker smoothing to start with
	kSmoothRms tonek kRmsOrig, kSmoothingFreq
	kSmoothRms max kSmoothRms, 0.001

	aNorm = 0.1 * aIn / a(kSmoothRms)

	kRms rms aNorm
	kRmsDiff = kRms - kLastRms

	if (kRmsDiff > iRmsDiffThreshold && kTime - kLastAttack > 0.09) then
		kLastAttack times
		pycall "clap_analyzer.clap", kLastAttack
	endif

	out aNorm
	kLastRms = kRms
endin
</CsInstruments>
<CsScore>

i 1 0 5000
e
</CsScore>
</CsoundSynthesizer>


adding csound PD class

adding csound PD class

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>
sr=44100
kr=44.1
ksmps=1000
nchnls=2
/*
        FLpanel "This Panel contains a Knob and shows its current value",400,300
ih1     FLvalue "This is current value of output of the Knob", 100,20,50,20
gk1,gih  FLknob  "Current value of this Knob is shown in a text field", 80,5000,-1,1, ih1, 90, 150,100
        FLpanelEnd
        FLrun
*/
        instr 1
;        FLsetVal_i 440, gih
a1      oscili  3000, p4, 1
        outs     a1,a1
        endin
</CsInstruments>
<CsScore>
f1 0 1024 10 1
i1 0 2 440

</CsScore>
</CsoundSynthesizer>

<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr=44100
kr=441
ksmps=100
nchnls=2

        FLpanel "This Panel contains a Knob and shows its current value",400,300
ih1     FLvalue "This is current value of output of the Knob", 100,20,50,20
gk1,gih  FLknob  "Current value of this Knob is shown in a text field", 80,5000,-1,1, ih1, 90, 150,100
        FLpanelEnd
        FLrun

        instr 1
        FLsetVal_i 440, gih
a1      oscili  3000, gk1, 1
        outs     a1,a1
        endin
</CsInstruments>
<CsScore>
f1 0 1024 10 1
i1 0 3600

</CsScore>
</CsoundSynthesizer>


simplify a test

simplify a test

<CsoundSynthesizer>

<CsInstruments>
sr = 44100
ksmps = 16
nchnls = 1
0dbfs = 1

giBuzz ftgen 5,0,4096,11,20,1,1
giWFn ftgen 7,0,16384,20,2,1
instr 1
aSig grain3 200, 0, 1, 0.01, 0.5, 80, 300, giBuzz, giWFn, 0, 0
out aSig*0.06
endin
</CsInstruments>

<CsScore>

i 1 0 30
e
</CsScore>

</CsoundSynthesizer>

<CsoundSynthesizer>

<CsInstruments>
sr = 44100
ksmps = 16
nchnls = 1
0dbfs = 1

giBuzz ftgen 5,0,4096,11,20,1,1
giWFn ftgen 7,0,16384,20,2,1
instr 1
aSig grain3 200, 0, 1, 0.01, 0.5, 80, 300, giBuzz, giWFn, 0, 0
out aSig*0.06
endin
</CsInstruments>

<CsScore>

i 1 0 300
e
</CsScore>

</CsoundSynthesizer>


no message

no message

<CsoundSynthesizer>
<CsOptions>
csound -odac6 temp.orc temp.sco
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

; gihandle1 vstinit "c:/projects/music/library/polyiblit.dll", 1
gihandle1 vstinit "c:/Program Files/Steinberg/Cubase SX/vstplugins/Synths/Cheeze Machine/Cheeze Machine.dll", 1
vstedit gihandle1

instr 1
iattack = 0.03
isustain = p3
irelease = 0.05
; To get the right envelope.
p3 = iattack + isustain + irelease
; To get the right cutoff time.
xtratim iattack + irelease
ichannel = p1 - 1
ikey = p4
ivelocity = p5
vstnote gihandle1, ichannel, ikey, ivelocity, p3
ain1 = 0
adamping linseg 0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ab1, ab2 vstaudio gihandle1, ain1, ain1
outs ab1, ab2
endin
</CsInstruments>
<CsScore>
i 1 0 10 60 60
i 1 2 1 72 60
i 1 2.01 2 64 60
i 1 15 15 60.375 60
i 1 15 15 64 60
i 1 18 15 36 60
i 1 20.03 15 80 56
i 1 15 400 62 60

</CsScore>
</CsoundSynthesizer>