no message

no message

<CsoundSynthesizer>

<CsOptions>
-odac
</CsOptions>

<CsInstruments>

sr= 44100
kr = 4410
ksmps = 10
nchnls= 2

instr 1

kfreq    expon      p5, p3, p6
kinterval expon      p7, p3, p8
kglissdur line     p9, p3, p10

idir = p11
iphs = p12
iwin = p13

kph phasor idir/kglissdur, iphs

kamp1   tablei kph, iwin, 1, 0, 1
kpa1    tablei kph, 3, 1, 0, 1
kifreq1  = kfreq                                     ; plays base_freq
aout1   oscili  kamp1,kifreq1,1                      ;
aout1l = kpa1*aout1
aout1r = -(kpa1-1)*aout1

kamp2   tablei kph, iwin, 1, .1, 1
kpa2    tablei kph, 3, 1, .1, 1
kifreq2  = kifreq1*kinterval                           ; plays base_freq * interval
aout2   oscili  kamp2,kifreq2,1
aout2l = kpa2*aout2
aout2r = -(kpa2-1)*aout2

kamp3   tablei kph, iwin, 1, .2, 1                        ; 2/10 table offset
kpa3    tablei kph, 3, 1, .2, 1
kifreq3  = kifreq2*kinterval                           ; plays base_freq * interval^2
aout3   oscili  kamp3,kifreq3,1
aout3l = kpa3*aout3
aout3r = -(kpa3-1)*aout3

kamp4   tablei kph, iwin, 1, .3, 1
kpa4    tablei kph, 3, 1, .3, 1
kifreq4  = kifreq3*kinterval
aout4   oscili  kamp4,kifreq4,1
aout4l = kpa4*aout4
aout4r = -(kpa4-1)*aout4

kamp5   tablei kph, iwin, 1, .4, 1
kpa5    tablei kph, 3, 1, .4, 1
kifreq5  = kifreq4*kinterval
aout5   oscili  kamp5,kifreq5,1
aout5l = kpa5*aout5
aout5r = -(kpa5-1)*aout5

kamp6   tablei kph, iwin, 1, .5, 1
kpa6    tablei kph, 3, 1, .5, 1
kifreq6  = kifreq5*kinterval
aout6   oscili  kamp6,kifreq6,1
aout6l = kpa6*aout6
aout6r = -(kpa6-1)*aout6

kamp7   tablei kph, iwin, 1, .6, 1
kpa7    tablei kph, 3, 1, .6, 1
kifreq7  = kifreq6*kinterval
aout7   oscili  kamp7,kifreq7,1
aout7l = kpa7*aout7
aout7r = -(kpa7-1)*aout7

kamp8   tablei kph, iwin, 1, .7, 1
kpa8    tablei kph, 3, 1, .7, 1
kifreq8  = kifreq7*kinterval
aout8   oscili  kamp8,kifreq8,1
aout8l = kpa8*aout8
aout8r = -(kpa8-1)*aout8

kamp9   tablei kph, iwin, 1, .8, 1
kpa9    tablei kph, 3, 1, .8, 1
kifreq9  = kifreq8*kinterval
aout9   oscili  kamp9,kifreq9,1
aout9l = kpa9*aout9
aout9r = -(kpa9-1)*aout9

kamp10   tablei kph, iwin, 1, .9, 1
kpa10    tablei kph, 3, 1, .9, 1
kifreq10  = kifreq9*kinterval
aout10   oscili  kamp10,kifreq10,1
aout10l = kpa10*aout10
aout10r = -(kpa10-1)*aout10

kline linen ampdb(p4)*32767, p14, p3, p14

;kpleft = (sqrt(2)/2)*(1-kpan/sqrt(1+(kpan*kpan)))
;kpright = (sqrt(2)/2)* (1+kpan/sqrt(1+(kpan*kpan)))

aright = aout1r+aout2r+aout3r+aout4r+aout5r+aout6r+aout7r+aout8r+aout9r+aout10r
aleft =  aout1l+aout2l+aout3l+aout4l+aout5l+aout6l+aout7l+aout8l+aout9l+aout10l
     outs    aleft*kline, aright*kline

endin

instr 2

kfreq    expon      p5, p3, p6
kinterval expon      p7, p3, p8
kglissdur line     p9, p3, p10
idir = p11
iphs = p12
iwin = p13
iq = p15
isrc = p16

if isrc == 1 goto noise
asig diskin "sound.wav", 1, 0, 1
asig = asig/2000
goto next
noise: asig rand 1

next:
kph phasor idir/kglissdur, iphs

kamp1   tablei kph, iwin, 1, 0, 1
kpa1    tablei kph, 3, 1, 0, 1
kifreq1  = kfreq                                     ; plays base_freq
aout1   reson asig,kifreq1,kifreq1/iq,2
aout1 = kamp1*aout1
aout1l = kpa1*aout1
aout1r = -(kpa1-1)*aout1

kamp2   tablei kph, iwin, 1, .1, 1
kpa2    tablei kph, 3, 1, .1, 1
kifreq2  = kifreq1*kinterval                           ; plays base_freq * interval
aout2   reson asig,kifreq2,kifreq2/iq,2
aout2 = kamp2*aout2
aout2l = kpa2*aout2
aout2r = -(kpa2-1)*aout2

kamp3   tablei kph, iwin, 1, .2, 1                        ; 2/10 table offset
kpa3    tablei kph, 3, 1, .2, 1
kifreq3  = kifreq2*kinterval                           ; plays base_freq * interval^2
aout3   reson asig,kifreq3,kifreq3/iq,2
aout3 = kamp3*aout3
aout3l = kpa3*aout3
aout3r = -(kpa3-1)*aout3

kamp4   tablei kph, iwin, 1, .3, 1
kpa4    tablei kph, 3, 1, .3, 1
kifreq4  = kifreq3*kinterval
aout4   reson asig,kifreq4,kifreq4/iq,2
aout4 = kamp4*aout4
aout4l = kpa4*aout4
aout4r = -(kpa4-1)*aout4

kamp5   tablei kph, iwin, 1, .4, 1
kpa5    tablei kph, 3, 1, .4, 1
kifreq5  = kifreq4*kinterval
aout5   reson asig,kifreq5,kifreq5/iq,2
aout5 = kamp5*aout5
aout5l = kpa5*aout5
aout5r = -(kpa5-1)*aout5

kamp6   tablei kph, iwin, 1, .5, 1
kpa6    tablei kph, 3, 1, .5, 1
kifreq6  = kifreq5*kinterval
aout6   reson asig,kifreq6,kifreq6/iq,2
aout6 = kamp6*aout6
aout6l = kpa6*aout6
aout6r = -(kpa6-1)*aout6

kamp7   tablei kph, iwin, 1, .6, 1
kpa7    tablei kph, 3, 1, .6, 1
kifreq7  = kifreq6*kinterval
aout7   reson asig,kifreq7,kifreq7/iq,2
aout7 = kamp7*aout7
aout7l = kpa7*aout7
aout7r = -(kpa7-1)*aout7

kamp8   tablei kph, iwin, 1, .7, 1
kpa8    tablei kph, 3, 1, .7, 1
kifreq8  = kifreq7*kinterval
aout8   reson asig,kifreq8,kifreq8/iq,2
aout8 = kamp8*aout8
aout8l = kpa8*aout8
aout8r = -(kpa8-1)*aout8

kamp9   tablei kph, iwin, 1, .8, 1
kpa9    tablei kph, 3, 1, .8, 1
kifreq9  = kifreq8*kinterval
aout9   reson asig,kifreq9,kifreq9/iq,2
aout9 = kamp9*aout9
aout9l = kpa9*aout9
aout9r = -(kpa9-1)*aout9

kamp10   tablei kph, iwin, 1, .9, 1
kpa10    tablei kph, 3, 1, .9, 1
kifreq10  = kifreq9*kinterval
aout10   reson asig,kifreq10,kifreq10/iq,2
aout10 = kamp10*aout10
aout10l = kpa10*aout10
aout10r = -(kpa10-1)*aout10

kline linen ampdb(p4)*32767, p14, p3, p14

;kpleft = (sqrt(2)/2)*(1-kpan/sqrt(1+(kpan*kpan)))
;kpright = (sqrt(2)/2)* (1+kpan/sqrt(1+(kpan*kpan)))

aright = aout1r+aout2r+aout3r+aout4r+aout5r+aout6r+aout7r+aout8r+aout9r+aout10r
aleft =  aout1l+aout2l+aout3l+aout4l+aout5l+aout6l+aout7l+aout8l+aout9l+aout10l
     outs    aleft*kline, aright*kline

endin

instr 3

kfreq0    expon      p5, p3, p6
kinterval expon      p7, p3, p8
kglissdur line     p9, p3, p10
koct line  p16, p3, p17
idir = p11
iphs = p12
iwin = p13
iq  = p15
idur = .04
iris = .007
idec = .003
iolaps = 1000

kph phasor idir/kglissdur, iphs
kran randi kfreq0*0.005, 4
kfreq = kfreq0+kran

kamp1   tablei kph, iwin, 1, 0, 1
kpa1    tablei kph, 3, 1, 0, 1
kifreq1  = kfreq0*kinterval
aout1   fof  kamp1, kfreq, kifreq1, koct, kifreq1/iq, iris, idur, idec, iolaps, 1, 4, p3
aout1l = kpa1*aout1
aout1r = -(kpa1-1)*aout1

kamp2   tablei kph, iwin, 1, .1, 1
kpa2    tablei kph, 3, 1, .1, 1
kifreq2  = kifreq1*kinterval                           ; plays base_freq * interval
aout2  fof  kamp2, kfreq, kifreq2, koct, kifreq2/iq, iris, idur, idec, iolaps, 1, 4, p3
aout2l = kpa2*aout2
aout2r = -(kpa2-1)*aout2

kamp3   tablei kph, iwin, 1, .2, 1                        ; 2/10 table offset
kpa3    tablei kph, 3, 1, .2, 1
kifreq3  = kifreq2*kinterval                           ; plays base_freq * interval^2
aout3   fof  kamp3,kfreq, kifreq3, koct, kifreq3/iq, iris, idur, idec, iolaps, 1, 4, p3
aout3l = kpa3*aout3
aout3r = -(kpa3-1)*aout3

kamp4   tablei kph, iwin, 1, .3, 1
kpa4    tablei kph, 3, 1, .3, 1
kifreq4  = kifreq3*kinterval
aout4   fof  kamp4,kfreq, kifreq4, koct, kifreq4/iq, iris, idur, idec, iolaps, 1, 4, p3
aout4l = kpa4*aout4
aout4r = -(kpa4-1)*aout4

kamp5   tablei kph, iwin, 1, .4, 1
kpa5    tablei kph, 3, 1, .4, 1
kifreq5  = kifreq4*kinterval
aout5   fof  kamp5,kfreq, kifreq5, koct, kifreq5/iq, iris, idur, idec, iolaps, 1, 4, p3
aout5l = kpa5*aout5
aout5r = -(kpa5-1)*aout5

kamp6   tablei kph, iwin, 1, .5, 1
kpa6    tablei kph, 3, 1, .5, 1
kifreq6  = kifreq5*kinterval
aout6   fof  kamp6,kfreq, kifreq6, koct, kifreq6/iq, iris, idur, idec, iolaps, 1, 4, p3
aout6l = kpa6*aout6
aout6r = -(kpa6-1)*aout6

kamp7   tablei kph, iwin, 1, .6, 1
kpa7    tablei kph, 3, 1, .6, 1
kifreq7  = kifreq6*kinterval
aout7   fof  kamp7,kfreq, kifreq7, koct, kifreq7/iq, iris, idur, idec, iolaps, 1, 4, p3
aout7l = kpa7*aout7
aout7r = -(kpa7-1)*aout7

kamp8   tablei kph, iwin, 1, .7, 1
kpa8    tablei kph, 3, 1, .7, 1
kifreq8  = kifreq7*kinterval
aout8  fof kamp8,kfreq, kifreq8, koct, kifreq8/iq, iris, idur, idec, iolaps, 1, 4, p3
aout8l = kpa8*aout8
aout8r = -(kpa8-1)*aout8

kamp9   tablei kph, iwin, 1, .8, 1
kpa9    tablei kph, 3, 1, .8, 1
kifreq9  = kifreq8*kinterval
aout9   fof  kamp9,kfreq, kifreq9, koct, kifreq9/iq, iris, idur, idec, iolaps, 1, 4, p3
aout9l = kpa9*aout9
aout9r = -(kpa9-1)*aout9

kamp10   tablei kph, iwin, 1, .9, 1
kpa10    tablei kph, 3, 1, .9, 1
kifreq10  = kifreq9*kinterval
aout10   fof  kamp10,kfreq, kifreq10, koct, kifreq10/iq, iris, idur, idec, iolaps, 1, 4, p3
aout10l = kpa10*aout10
aout10r = -(kpa10-1)*aout10

kline linen ampdb(p4)*20000, p14, p3, p14

;kpleft = (sqrt(2)/2)*(1-kpan/sqrt(1+(kpan*kpan)))
;kpright = (sqrt(2)/2)* (1+kpan/sqrt(1+(kpan*kpan)))

aright = aout1r+aout2r+aout3r+aout4r+aout5r+aout6r+aout7r+aout8r+aout9r+aout10r
aleft =  aout1l+aout2l+aout3l+aout4l+aout5l+aout6l+aout7l+aout8l+aout9l+aout10l
     outs    aleft*kline, aright*kline

endin

</CsInstruments>

<CsScore>

; senoide
f1 0 4096 10 1 ;0 .8 0 .4 0 .6 0 .2
f4 0 4097 5  .000001 4096 1

f21 0 4096 20 5 ;blackman
f22 0 4096 20 6 ;gauss
f23 0 4096 20 3 ;triang

f3 0 512 7 0.00001 128 0.00001 256 1 128 1

;     dur amp      fr1 fr2   int1 int2 sp1 sp2 idir iphs iwin att/dec
i2 0.5  62  -12  1000 1100  1.3 1.1  18  .6   1  .75     22    2   500 1
i1 45   40  -16  1050  980  1.04 1.06  1   4  -1   .1     23    8
i2 50   30   -13  800  500  1.03 1.5   .3  10  1   0     21     2  250 1
i1 65   36   -13  100   110  1.6  1.01  2   4   -1  .5    22    1
i2 75   25   -18   800  950  1.5 1.15   .9  2  -1  .7    23    9   50  1
i1 87  20   -15   1200 1100  1.3 1.09 1   3   1   .25    21    2
i3 95  20   -13    110  130  1.55  1.2  4  2   -1  .5    23    3   20 0 0
i1 100  30   -18   5000 7000  1.004 1.09 2   1   -1  0    23    4
i2 105  20   -15   4000 4500  1.1   1.17  1.3  .8  1  0   21    6 100 1
i2 115  27   -24   2500 1000  1.1   1.3   5    8   -1 .75 22    4  50 1
i1 123  22   -18   2000 2050  1.008 1.02  .3   3   1  0   21    2
i3 125   6   -20    800  850  1.1  1.3    6  6   -1  .5    22    3  500 0 0

</CsScore>

</CsoundSynthesizer>
<MacOptions>
Version: 3
Render: Real
Ask: Yes
Functions: ioObject
Listing: Window
WindowBounds: 634 268 400 140
CurrentView: io
IOViewEdit: On
Options:
</MacOptions>

<MacGUI>
ioView nobackground {65535, 65535, 65535}
ioSlider {5, 5} {20, 100} 0.000000 1.000000 0.000000 slider1
ioSlider {45, 5} {20, 100} 0.000000 1.000000 0.000000 slider2
ioSlider {85, 5} {20, 100} 0.000000 1.000000 0.000000 slider3
ioSlider {125, 5} {20, 100} 0.000000 1.000000 0.000000 slider4
ioSlider {165, 5} {20, 100} 0.000000 1.000000 0.000000 slider5
</MacGUI>

error: pathspec 'examples/hommage.csd' did not match any file(s) known to git


Added new synth, developed in Csound

Added new synth, developed in Csound

; Vox Output
;
; The bedrock of this file comes from the fof example in the Csound Opcode Help
;
; Tasks:
;   -Figure out how to end notes by changing kamp at end of notes
;   -Add more formants for richer sound

<CsoundSynthesizer>
<CsOptions>
;-odac ;;;realtime audio out
;-iadc ;;;realtime audio in
</CsOptions>
<CsInstruments>

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

alwayson "Vox"       ; Vox instrument only ends when score ends/program stops running
giOSC OSCinit 6007
giSine    ftgen 1, 0, 16384, 10, 1
giSigmoid ftgen 2, 0, 1024,  19, 0.5, 0.5, 270, 0.5

instr Vox
	; Combine five formants together to create
	; a transformation from an alto-"a" sound
	; to an alto-"i" sound.
	; Values common to all of the formants.
	koct init 0
	kris init 0.003
	kdur init 0.02
	kdec init 0.007
	iolaps = 100
	itotdur = 3600

	;kamp init 1
	kfund init 300
	knotedur init 3600

	;Listen for OSC messages
	ktrig OSClisten giOSC, "/note", "ff", kfund, knotedur

	; First formant.
	k1amp = ampdb(0)
	;k1form line 800, p3, 350
	k1form init 800
	k1band line 80, i(knotedur), 50

	; Second formant.
	k2amp line ampdb(-4), i(knotedur), ampdb(-20)
	;k2form line 1150, p3, 1700
	k2form init 1150
	k2band line 90, i(knotedur), 100

	; Third formant.
	k3amp line ampdb(-20), i(knotedur), ampdb(-30)
	;k3form line 2800, p3, 2700
	k3form init 2800
	k3band init 120

	; Fourth formant.
	k4amp init ampdb(-36)
	;k4form line 3500, p3, 3700
	k4form init 3500
	k4band line 130, i(knotedur), 150

	; Fifth formant.
	k5amp init ampdb(-60)
	k5form init 4950
	k5band line 140, i(knotedur), 200

	a1 fof k1amp, kfund, k1form, koct, k1band, kris, kdur, kdec, iolaps, giSine, giSigmoid, itotdur
	a2 fof k2amp, kfund, k2form, koct, k2band, kris, kdur, kdec, iolaps, giSine, giSigmoid, itotdur
	a3 fof k3amp, kfund, k3form, koct, k3band, kris, kdur, kdec, iolaps, giSine, giSigmoid, itotdur
	a4 fof k4amp, kfund, k4form, koct, k4band, kris, kdur, kdec, iolaps, giSine, giSigmoid, itotdur
	a5 fof k5amp, kfund, k5form, koct, k5band, kris, kdur, kdec, iolaps, giSine, giSigmoid, itotdur

	; Combine all of the formants together
	asig sum (a1+a2+a3+a4+a5) ;* 13000
	outs asig, asig
endin

</CsInstruments>
<CsScore>
e 3600 ; Program runs for an hour
</CsScore>
</CsoundSynthesizer>
<bsbPanel>
 Widgets
 <objectName/>
 <x>100</x>
 <y>100</y>
 <width>320</width>
 <height>240</height>
 <visible>true</visible>
 <uuid/>
 <bgcolor mode="nobackground">
  <r>255</r>
  <g>255</g>
  255
 </bgcolor>
</bsbPanel>
<bsbPresets>
</bsbPresets>

error: pathspec 'voice_synth.csd' did not match any file(s) known to git


Adding a few ftables to plot

Adding a few ftables to plot

iOS/Csound iOS Examples/Csound iOS Examples/ViewControllers/Waveview/Waveviewtest.csd

error: pathspec 'iOS/Csound' did not match any file(s) known to git
error: pathspec 'Examples/Csound' did not match any file(s) known to git
error: pathspec 'Examples/ViewControllers/Waveview/Waveviewtest.csd' did not match any file(s) known to git


Commenting

Commenting

error: pathspec 'Aluminum' did not match any file(s) known to git
error: pathspec 'March/Aluminum' did not match any file(s) known to git
error: pathspec 'March.csd' did not match any file(s) known to git


no message

no message

<CsoundSynthesizer>
<CsOptions>
csound -f -h -+rtmidi=null -M0 -d -n -m7 temp.orc temp.sco
</CsOptions>
<CsInstruments>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; O R C H E S T R A   F O R   V S T   P L U G I N   U S E
; Copyright (c) 2005 by Michael Gogins.
; All rights reserved.
;
; There is one input buss for each effect,
; and each instrument has a send to each buss.
;
; Mixer levels are set with instr 1.
;
; Numbered instruments range from 2 through 100.
;
; Effects range from 200 up.
;
; Incorporated instruments can be named and wrapped
; with numbered instrument definitions.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; HEADER
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

sr                      =                       44100
; Adjust ksmps for best balance between performance and stability.
ksmps                                   =                       30
nchnls                  =                       2
0dbfs                   =                       32767

; Note that -1 dB for float is 29205.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Tables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Waveform for the string-pad
giwave                  ftgen                   1, 0, 8193,     10,     1, .5, .33, .25,  .0, .1,  .1, .1
gisine                  ftgen                   2, 0, 65537,    10,     1
giharpsichord           ftgen                   0, 0, 8193,     7,      -1, 1024, 1, 1024, -1 ; Kelley harpsichord.
gicosine                ftgen                   0, 0, 65537,    11,     1 ; Cosine wave. Get that noise down on the most widely used table!
giexponentialrise       ftgen                   0, 0, 8193,     5,      .001, 513, 1 ; Exponential rise.
githirteen              ftgen                   0, 0, 8193,     9,      1, .3, 0
giln                    ftgen                   0, 0, 8193,     -12,    20.0 ; Unscaled ln(I(x)) from 0 to 20.0.
gibergeman              ftgen                   0, 0, 8193,     10,     .28, 1, .74, .66, .78, .48, .05, .33, .12, .08, .01, .54, .19, .08, .05, .16, .01, .11, .3, .02, .2 ; Bergeman f1
gicookblank             ftgen                   0, 0, 8193,     10,     0 ; Blank wavetable for some Cook FM opcodes.
gicook3                 ftgen                   0, 0, 8193,     10,     1, .4, .2, .1, .1, .05
gikellyflute            ftgen                   0, 0, 8193,     10,     1, .25, .1 ; Kelley flute.
gichebychev             ftgen                   0, 0, 8193,     -7,     -1, 150, .1, 110, 0, 252, 0
giffitch1               ftgen                   0, 0, 8193,     10,     1
giffitch2               ftgen                   0, 0, 8193,     5,      1, 1024, .01
giffitch3               ftgen                   0, 0, 8193,     5,      1, 1024, .001
; Rotor Tables
gitonewheel1            ftgen                   0, 0, 8193,     10,     1, .02, .01
gitonewheel2            ftgen                   0, 0, 8193,     10,     1, 0, .2, 0, .1, 0, .05, 0, .02
; Rotating Speaker Filter Envelopes
gitonewheel3            ftgen                   0, 0, 8193,     7,      0, 110, 0, 18, 1, 18, 0, 110, 0
gitonewheel4            ftgen                   0, 0, 8193,     7,      0, 80, .2, 16, 1, 64, 1, 16, .2, 80, 0
; Distortion Tables
gitonewheel5            ftgen                   0, 0, 8193,     8,      -.8, 336, -.78,  800, -.7, 5920, .7,  800, .78, 336, .8
gitonewheel6            ftgen                   0, 0, 8193,     8       -.8, 336, -.76, 3000, -.7, 1520, .7, 3000, .76, 336, .8

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Instruments
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

                        instr                   1 ; Tone wheel organ by Mikelson
                        mididefault             60, p3
                        midinoteonoct           p4, p5
; Pitch.
ifrequency              =                       cpsoct(p4)
; Amplitude.
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 16.0
; Constant-power pan.
iangle                  =                       p6 / 2.0
ijunk7                  =                       p7
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
ileftpan                =                       sqrt(2.0) / 2.0 * (cos(iangle) + sin(iangle)) * iamplitude;
irightpan               =                       sqrt(2.0) / 2.0 * (cos(iangle) - sin(iangle)) * iamplitude;
iattack                 =                       .05
isustain                =                       p3
irelease                =                       .1
iduration               =                       iattack + isustain + irelease
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iphase                  =                       p2
ikey                    =                       12 * int(p4 - 6) + 100 * (p4 - 6)
ifqc                    =                       ifrequency
; The lower tone wheels have increased odd harmonic content.
iwheel1                 =                       ((ikey - 12) > 12 ? gitonewheel1 : gitonewheel2)
iwheel2                 =                       ((ikey +  7) > 12 ? gitonewheel1 : gitonewheel2)
iwheel3                 =                        (ikey       > 12 ? gitonewheel1 : gitonewheel2)
iwheel4                 =                       1
;  Start Dur   Amp   Pitch SubFund Sub3rd Fund 2nd 3rd 4th 5th 6th 8th
;i1   0    6    200    8.04   8       8     8    8   3   2   1   0   4
asubfund                oscili                  8, .5*ifqc,      iwheel1, iphase/(ikey-12)
asub3rd                 oscili                  8, 1.4983*ifqc,  iwheel2, iphase/(ikey+7)
afund                   oscili                  8, ifqc,         iwheel3, iphase/ikey
a2nd                    oscili                  8, 2*ifqc,       iwheel4, iphase/(ikey+12)
a3rd                    oscili                  3, 2.9966*ifqc,  iwheel4, iphase/(ikey+19)
a4th                    oscili                  2, 4*ifqc,       iwheel4, iphase/(ikey+24)
a5th                    oscili                  1, 5.0397*ifqc,  iwheel4, iphase/(ikey+28)
a6th                    oscili                  0, 5.9932*ifqc,  iwheel4, iphase/(ikey+31)
a8th                    oscili                  4, 8*ifqc,       iwheel4, iphase/(ikey+36)
asignal                 =                       kdamping * (asubfund + asub3rd + afund + a2nd + a3rd + a4th + a5th + a6th + a8th)
asig1                   =                       asignal * irightpan
asig2                   =                       asignal * ileftpan
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

						instr                   Xanadu1
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kvib        oscili       1/120, ipch/50, gisine       ;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
kf1         expon       .1, p3, 1.0             ;exponential from 0.1 to 1.0
kf2         expon       1.0, p3, .1             ;exponential from 1.0 to 0.1
adump       delayr      2.0                     ;set delay line of 2.0 sec
atap1       deltapi     kf1                     ;tap delay line with kf1 func.
atap2       deltapi     kf2                     ;tap delay line with kf2 func.
ad1         deltap      2.0                     ;delay 2 sec.
ad2         deltap      1.1                     ;delay 1.1 sec.
            delayw      ag                      ;put ag signal into delay line.
            outs        agleft+atap1+ad1, agright+atap2+ad2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   2 ; Xanadu instr 1
                        mididefault             60, p3
                        midinoteonoct           p4, p5
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
; Envelope initialization.
iattack                 =                       0.005
isustain                =                       p3
irelease                =                       0.05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iduration               =                       p3 + iattack + irelease
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 2000.
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       (sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))) * iamplitude
ileftgain               =                       (sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))) * iamplitude
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
asig1, asig2            subinstr                "Xanadu1", p4, pchoct(p4)
asig1                   =                       asig1 * kdamping * irightgain
asig2                   =                       asig2 * kdamping * ileftgain
						outs					asig1, asig2
                        endin

                        instr                   Xanadu2
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5 - 4)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kvib        oscili       1/80, 6.1, gisine       ;vibrato
iattack                 =                       0.05
isustain                =                       p3
irelease                =                       0.05
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ag          pluck       1000, cpsoct(ioct + kvib), 1000,gisine, 1
agleft      pluck       1000, cpsoct(ioct+ishift), 1000,gisine, 1
agright     pluck       1000, cpsoct(ioct-ishift), 1000,gisine, 1
adump       delayr      0.4                     ;set delay line of 0.3 sec
ad1         deltap      0.1                     ;delay 100 msec.
ad2         deltap      0.2                     ;delay 200 msec.
            delayw      ag * kdamping                      ;put ag sign into del line.
            outs        kdamping *(agleft+ad1), kdamping*(agright+ad2)
endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   3 ; Xanadu instr 2
                        mididefault             60, p3
                        midinoteonoct           p4, p5
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
; Envelope initialization.
iattack                 =                       0.05
isustain                =                       p3
irelease                =                       0.05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iduration               =                       p3 + iattack + irelease
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 600.
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       (sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))) * iamplitude
ileftgain               =                       (sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))) * iamplitude
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
asig1, asig2            subinstr                "Xanadu2", p4, pchoct(p4)
asig1                   =                       asig1 * kdamping * irightgain
asig2                   =                       asig2 * kdamping * ileftgain
						outs					asig1, asig2
endin

                        instr                   Xanadu3
ishift      =           .00666667               ;shift it 8/1200.
ipch        =           cpspch(p5)              ;convert parameter 5 to cps.
ioct        =           octpch(p5)              ;convert parameter 5 to oct.
kadsr       linseg      0, p3/3, 1.0, p3/3, 1.0, p3/3, 0 ;ADSR envelope
kmodi       linseg      0, p3/3, 5, p3/3, 3, p3/3, 0 ;ADSR envelope for I
kmodr       linseg      p6, p3, p7              ;r moves from p6->p7 in p3 sec.
a1          =           kmodi*(kmodr-1/kmodr)/2
a1ndx       =           abs(a1*2/20)            ;a1*2 is normalized from 0-1.
a2          =           kmodi*(kmodr+1/kmodr)/2
a3          tablei      a1ndx,giln, 1             ;lookup tbl in f3, normal index
ao1         oscili       a1, ipch, gicosine             ;cosine
a4          =           exp(-0.5*a3+ao1)
ao2         oscili       a2*ipch, ipch, gicosine        ;cosine
aoutl       oscili       1000*kadsr*a4, ao2+cpsoct(ioct+ishift), gisine ;fnl outleft
aoutr       oscili       1000*kadsr*a4, ao2+cpsoct(ioct-ishift), gisine ;fnl outright
            outs        aoutl, aoutr
            endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   4 ; Xanadu instr 3
                        mididefault             60, p3
                        midinoteonoct           p4, p5
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
; Envelope initialization.
iattack                 =                       0.05
isustain                =                       p3
irelease                =                       0.05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iduration               =                       p3 + iattack + irelease
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 2400.
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       (sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))) * iamplitude
ileftgain               =                       (sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))) * iamplitude
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
asig1, asig2            subinstr                "Xanadu3", p4, pchoct(p4), 5.07, 0.5, 1.7
asig1                   =                       asig1 * kdamping * irightgain
asig2                   =                       asig2 * kdamping * ileftgain
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   5 ; Tone wheel organ by Mikelson
                        mididefault             60, p3
                        midinoteonoct           p4, p5
; Pitch.
ifrequency              =                       cpsoct(p4)
; Amplitude.
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 16.0
; Constant-power pan.
iangle                  =                       p6 / 2.0
ijunk7                  =                       p7
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
ileftpan                =                       sqrt(2.0) / 2.0 * (cos(iangle) + sin(iangle)) * iamplitude;
irightpan               =                       sqrt(2.0) / 2.0 * (cos(iangle) - sin(iangle)) * iamplitude;
iattack                 =                       .05
isustain                =                       p3
irelease                =                       .1
iduration               =                       iattack + isustain + irelease
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iphase                  =                       p2
ikey                    =                       12 * int(p4 - 6) + 100 * (p4 - 6)
ifqc                    =                       ifrequency
; The lower tone wheels have increased odd harmonic content.
iwheel1                 =                       ((ikey - 12) > 12 ? gitonewheel1 : gitonewheel2)
iwheel2                 =                       ((ikey +  7) > 12 ? gitonewheel1 : gitonewheel2)
iwheel3                 =                        (ikey       > 12 ? gitonewheel1 : gitonewheel2)
iwheel4                 =                       1
;  Start Dur   Amp   Pitch SubFund Sub3rd Fund 2nd 3rd 4th 5th 6th 8th
;i1   0    6    200    8.04   8       8     8    8   3   2   1   0   4
asubfund                oscili                  8, .5*ifqc,      iwheel1, iphase/(ikey-12)
asub3rd                 oscili                  8, 1.4983*ifqc,  iwheel2, iphase/(ikey+7)
afund                   oscili                  8, ifqc,         iwheel3, iphase/ikey
a2nd                    oscili                  8, 2*ifqc,       iwheel4, iphase/(ikey+12)
a3rd                    oscili                  3, 2.9966*ifqc,  iwheel4, iphase/(ikey+19)
a4th                    oscili                  2, 4*ifqc,       iwheel4, iphase/(ikey+24)
a5th                    oscili                  1, 5.0397*ifqc,  iwheel4, iphase/(ikey+28)
a6th                    oscili                  0, 5.9932*ifqc,  iwheel4, iphase/(ikey+31)
a8th                    oscili                  4, 8*ifqc,       iwheel4, iphase/(ikey+36)
asignal                 =                       kdamping * (asubfund + asub3rd + afund + a2nd + a3rd + a4th + a5th + a6th + a8th)
asig1                   =                       asignal * irightpan
asig2                   =                       asignal * ileftpan
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   6 ; Guitar, Michael Gogins
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       .01
isustain                =                       p3
irelease                =                       .05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 5
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
kamp                    linseg                  0.0, iattack, iamplitude, isustain, iamplitude, irelease, 0.0
asigcomp                pluck                   kamp, 440, 440, 0, 1
asig                    pluck                   kamp, ifrequency, ifrequency, 0, 1
af1                     reson                   asig, 110, 80
af2                     reson                   asig, 220, 100
af3                     reson                   asig, 440, 80
aout                    balance                 0.6 * af1+ af2 + 0.6 * af3 + 0.4 * asig, asigcomp
kexp                    expseg                  1.0, iattack, 2.0, isustain, 1.0, irelease, 1.0
kenv                    =                       kexp - 1.0
asig1                   =                       aout * ileftgain * kenv * kdamping,
asig2                   =                       aout* irightgain * kenv * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   7 ; Harpsichord, James Kelley
                        mididefault             60, p3
                        midinoteonoct           p4, p5
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
; Envelope initialization.
iattack                 =                       0.005
isustain                =                       p3
irelease                =                       0.05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iduration               =                       p3 + iattack + irelease
ifrequency              =                       cpsoct(p4 + 1)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 2.0
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; KONTROL
kenvelope               transeg                 0, iamplitude, iduration, -3, 1.0, irelease, -2.5, 0
; AUDIO
apluck                  pluck                   iamplitude, ifrequency, ifrequency, 0, 1
aharp                   oscili                  kenvelope, ifrequency, giharpsichord
aharp2                  balance                 apluck, aharp
aoutsignal              =                       apluck + aharp2
asig1                   =                       aoutsignal * ileftgain * kdamping
asig2                   =                       aoutsignal * irightgain * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   8 ; Heavy metal model, Perry Cook
                        mididefault             60, p3
                        midinoteonoct           p4, p5
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
iattack                 =                       0.01
idecay                  =                       2.0
isustain                =                       p3
irelease                =                       0.125
                        ; xtratim                       iattack + idecay + irelease
p3                      =                       iattack + iattack + idecay + irelease
kdamping                linsegr                 0.0, iattack, 1.0, idecay + isustain, 1.0, irelease, 0.0
iindex                  =                       1
icrossfade              =                       3
ivibedepth              =                       0.02
iviberate               =                       4.8
ifn1                    =                       gisine
ifn2                    =                       giexponentialrise
ifn3                    =                       githirteen
ifn4                    =                       gisine
ivibefn                 =                       gicosine
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 32.0
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta)) * iamplitude
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta)) * iamplitude
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; AUDIO
adecay                  transeg                 0.0, iattack, 4, 1.0, idecay, -4, 0.1, irelease, -4, 0.0
asignal                 fmmetal                 0.1, ifrequency, iindex, icrossfade, ivibedepth, iviberate, ifn1, ifn2, ifn3, ifn4, ivibefn
asig1                   =                       asignal * ileftgain * kdamping * adecay
asig2                   =                       asignal * irightgain * kdamping * adecay
						outs					asig1, asig2
endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   9 ; Xing by Andrew Horner
; p4 pitch in octave.pch
; original pitch        = A6
; range                 = C6 - C7
; extended range        = F4 - C7
                        mididefault             60, p3
                        midinoteonoct           p4, p5
                        ; print                 p2, p3, p4, p5, p7, p8, p9, p10, p11
isine                   =                       1
iinstrument             =                       p1
istarttime              =                       p2
isustain                =                       p3
iattack                 =                       .005
irelease                =                       .06
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ioctave                 =                       p4
ifrequency              =                       cpsoct(ioctave)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 875.0
iphase                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
ixpan                   =                       p7
iradians                =                       ixpan * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
iypan                   =                       p8
izpan                   =                       p9
imason                  =                       p10
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11

idur                    =                       p3
ifreq                   =                       ifrequency
iamp                    =                       iamplitude
inorm                   =                       32310

aamp1                   linseg                  0,.001,5200,.001,800,.001,3000,.0025,1100,.002,2800,.0015,1500,.001,2100,.011,1600,.03,1400,.95,700,1,320,1,180,1,90,1,40,1,20,1,12,1,6,1,3,1,0,1,0
kdevamp1                linseg                  0, .05, .3, idur - .05, 0
kdev1                   oscili                  kdevamp1, 6.7, gisine, .8
amp1                    =                       aamp1 * (1 + kdev1)

aamp2                   linseg                  0,.0009,22000,.0005,7300,.0009,11000,.0004,5500,.0006,15000,.0004,5500,.0008,2200,.055,7300,.02,8500,.38,5000,.5,300,.5,73,.5,5.,5,0,1,1
kdevamp2                linseg                  0,.12,.5,idur-.12,0
kdev2                   oscili                  kdevamp2, 10.5, gisine, 0
amp2                    =                       aamp2 * (1 + kdev2)

aamp3                   linseg                  0,.001,3000,.001,1000,.0017,12000,.0013,3700,.001,12500,.0018,3000,.0012,1200,.001,1400,.0017,6000,.0023,200,.001,3000,.001,1200,.0015,8000,.001,1800,.0015,6000,.08,1200,.2,200,.2,40,.2,10,.4,0,1,0
kdevamp3                linseg                  0, .02, .8, idur - .02, 0
kdev3                   oscili                  kdevamp3, 70, gisine ,0
amp3                    =                       aamp3 * (1 + kdev3),

awt1                    oscili                  amp1, ifreq, gisine
awt2                    oscili                  amp2, 2.7 * ifreq, gisine
awt3                    oscili                  amp3, 4.95 * ifreq, gisine
asig                    =                       awt1 + awt2 + awt3
krel                    linenr                  1,0, idur, .06
asig                    =                       asig * krel * (iamp / inorm)
asig1                   =                       asig * ileftgain * kdamping *.005
asig2                   =                       asig * irightgain * kdamping *.005
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   10 ; FM modulated left and right detuned chorusing, Thomas Kung
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       0.333333
irelease                =                       0.25
isustain                =                       p3
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 400
iphase                  =                       p6
; Constant-power pan.
; x location ranges from hard left = -1 through center = 0 to hard right = 1.
; angle of pan ranges from hard left = - pi / 2 through center = 0 to hard right = pi / 2.
ix                      =                       p7
iangle                  =                       ix * 3.14159265359 / 2.0
ileftpan                =                       sqrt(2.0) / 2.0 * (cos(iangle) + sin(iangle))
irightpan               =                       sqrt(2.0) / 2.0 * (cos(iangle) - sin(iangle))
iy                      =                       p8
iz                      =                       p9
imason                  =                       p10
ihomogeneity            =                       p11
ip6                     =                       0.3
ip7                     =                       2.2
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; shift it.
ishift                  =                       4.0 / 12000
; convert parameter 5 to cps.
ipch                    =                       cpsoct(p4)
; convert parameter 5 to oct.
ioct                    =                       p4
; KONTROL
kadsr                   linen                   1.0, iattack, irelease, 0.01
kmodi                   linseg                  0, iattack, 5, isustain, 2, irelease, 0
; r moves from ip6 to ip7 in p3 secs.
kmodr                   linseg                  ip6, p3, ip7
; AUDIO
a1                      =                       kmodi * (kmodr - 1 / kmodr) / 2
; a1*2 is argument normalized from 0-1.
a1ndx                   =                       abs(a1 * 2 / 20)
a2                      =                       kmodi * (kmodr + 1 / kmodr) / 2
; Look up table is in f43, normalized index.
a3                      tablei                  a1ndx, giln, 1
; Cosine
ao1                     oscili                  a1, ipch, gicosine
a4                      =                       exp(-0.5 * a3 + ao1)
; Cosine
ao2                     oscili                  a2 * ipch, ipch, gicosine
; Final output left
aoutl                   oscili                  iamplitude * kadsr * a4, ao2 + cpsoct(ioct + ishift), gisine
; Final output right
aoutr                   oscili                  iamplitude * kadsr * a4, ao2 + cpsoct(ioct - ishift), gisine
asig1                   =                       ileftpan * aoutl * kdamping
asig2                   =                       irightpan * aoutr * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   11 ; String pad
; String-pad borrowed from the piece "Dorian Gray",
; http://akozar.spymac.net/music/ Modified to fit my needs
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
    ij1=p1
    ij2=p2
    ij3=p3
    ij4=p4
    ij5=p5
    ij6=p6
    ij7=p7
    ij8=p8
    ij9=p9
    ij10=p10
    ij11=p11
  ihz  = cpsoct(p4)
  idb  = p5
  ipos = p7
  iamp = ampdb(idb) * 1.5

  ; Slow attack and release
  kctrl   linseg  0, p3*0.5, iamp, p3*.5, 0
  ; Slight chorus effect
  afund   oscili   kctrl, ihz,      giwave       ; audio oscillator
  acel1   oscili   kctrl, ihz - .1, giwave       ; audio oscillator - flat
  acel2   oscili   kctrl, ihz + .1, giwave       ; audio oscillator - sharp
  asig    =   afund + acel1 + acel2

  ; Cut-off high frequencies depending on midi-velocity
  ; (larger velocity implies more brighter sound)
  asig butterlp asig, (p5-60)*40+900

  ; Panning
  ippan =       ipos*1.570796325  ; half of PI (radians of 90o angle)
  ipleft        =       cos(ippan)        ; half sign "down"
  ipright       =       sin(ippan)        ; half sign "up"
  ; print giwave,ihz,iamp,ipos,ipleft,ipright
  asig1 = asig*ipleft;
  asig2 = asig*ipright;
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   12 ; Filtered chorus, Michael Bergeman
                        ; print                 p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
; Original pfields
; p1 p2 p3 p4 p5 p6 p7 p8 p9
; ins st dur db func at dec freq1 freq2
iattack                 =                       0.03
isustain                =                       p3
irelease                =                       0.52
                        ; xtratim                       iattack + irelease
p3                      =                       p3 + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ip4                     =                       p5
idb                     =                       ampdb(p5) * 1.5
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
ip5                     =                       gibergeman
ip3                     =                       p3
ip6                     =                       p3 * .25
ip7                     =                       p3 * .75
ip8                     =                       cpsoct(p4 - .01)
ip9                     =                       cpsoct(p4 + .01)
ip10                    =                       p10
isc                     =                       idb * .333
k1                      line                    40, p3, 800
k2                      line                    440, p3, 220
k3                      linen                   isc, ip6, p3, ip7
k4                      line                    800, ip3,40
k5                      line                    220, ip3,440
k6                      linen                   isc, ip6, ip3, ip7
k7                      linen                   1, ip6, ip3, ip7
a5                      oscili                  k3, ip8, ip5
a6                      oscili                  k3, ip8 * .999, ip5
a7                      oscili                  k3, ip8 * 1.001, ip5
a1                      =                       a5 + a6 + a7
a8                      oscili                  k6, ip9, ip5
a9                      oscili                  k6, ip9 * .999, ip5
a10                     oscili                  k6, ip9 * 1.001, ip5
a11                     =                       a8 + a9 + a10
a2                      butterbp                a1, k1, 40
a3                      butterbp                a2, k5, k2 * .8
a4                      balance                 a3, a1
a12                     butterbp                a11, k4, 40
a13                     butterbp                a12, k2, k5 * .8
a14                     balance                 a13, a11
a15                     reverb2                 a4, 5, .3
a16                     reverb2                 a4, 4, .2
a17                     =                       (a15 + a4) * ileftgain * k7
a18                     =                       (a16 + a4) * irightgain * k7
asig1                   =                       a17 * kdamping
asig2                   =                       a18 * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   13 ; Plain plucked string, Michael Gogins
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       .002
isustain                =                       p3
irelease                =                       .075
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 1.25
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
kenvelope               transeg                 0, iattack, -4, iamplitude,  isustain, -4, iamplitude / 10.0, irelease, -4, 0
aexcite                 oscili                  1, 1, gisine
;asignal1               wgpluck                 ifrequency * 1.00003, 1.0, .5, .1, 10, 1000, aexcite
;asignal2               wgpluck                 ifrequency * 0.99997, 1.0, .5, .1, 10, 1000, aexcite
asignal1                pluck                   1, ifrequency, ifrequency * 1.002, 0, 1
asignal2                pluck                   1, ifrequency * 1.003, ifrequency, 0, 1
apluckout               =                       (asignal1 + asignal2) * kenvelope
asig1                   =                       ileftgain * apluckout * kdamping
asig2                   =                       irightgain * apluckout * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr 14                ; Rhodes electric piano model, Perry Cook
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       0.01
isustain                =                       p3
irelease                =                       0.125
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iindex                  =                       4
icrossfade              =                       3
ivibedepth              =                       0.2
iviberate               =                       6
ifn1                    =                       gisine
ifn2                    =                       gicosine
ifn3                    =                       gisine
ifn4                    =                       gicookblank
ivibefn                 =                       gisine
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 1.25
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; AUDIO
asignal                 fmrhode                 iamplitude, ifrequency, iindex, icrossfade, ivibedepth, iviberate, ifn1, ifn2, ifn3, ifn4, ivibefn
asig1                   =                       ileftgain * asignal * kdamping
asig2                   =                       irightgain * asignal * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr 15                ; Tubular bell model, Perry Cook
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       0.01
isustain                =                       p3
irelease                =                       0.125
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
iindex                  =                       1
icrossfade              =                       2
ivibedepth              =                       0.2
iviberate               =                       6
ifn1                    =                       gisine
ifn2                    =                       gicook3
ifn3                    =                       gisine
ifn4                    =                       gisine
ivibefn                 =                       gicosine
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 2.0
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; AUDIO
asignal                 fmbell                  1.0, ifrequency, iindex, icrossfade, ivibedepth, iviberate, ifn1, ifn2, ifn3, ifn4, ivibefn
asig1                   =                       ileftgain * asignal * iamplitude * kdamping
asig2                   =                       irightgain * asignal * iamplitude * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   16 ; FM moderate index, Michael Gogins
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
icarrier                =                       1
iratio                  =                       1.25
ifmamplitude            =                       8
index                   =                       5.4
iattack                 =                       0.02
isustain                =                       p3
irelease                =                       0.05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency              =                       cpsoct(p4)
ifrequencyb             =                       ifrequency * 1.003
icarrierb               =                       icarrier * 1.004
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5)
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
kindenv                 expseg                  .000001, iattack, 1, isustain, .125, irelease, .000001
        kindex                  =                       kindenv * index * ifmamplitude
aouta                   foscili                 iamplitude, ifrequency, icarrier, iratio, index, 1
aoutb                   foscili                 iamplitude, ifrequencyb, icarrierb, iratio, index, 1
; Plus amplitude correction.
afmout                  =                       (aouta + aoutb) * kindenv
asig1                   =                       ileftgain * afmout * kdamping
asig2                   =                       irightgain * afmout * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   17 ; FM moderate index 2, Michael Gogins
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
icarrier                =                       1
iratio                  =                       1
ifmamplitude            =                       6
index                   =                       2.5
iattack                 =                       0.02
isustain                =                       p3
irelease                =                       0.05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency              =                       cpsoct(p4)
ifrequencyb             =                       ifrequency * 1.003
icarrierb               =                       icarrier * 1.004
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5)
ijunk6                  =                       p6
; Constant-power pan.
; x location ranges from hard left = -1 through center = 0 to hard right = 1.
; angle of pan ranges from hard left = - pi / 2 through center = 0 to hard right = pi / 2.
ix                      =                       p7
iangle                  =                       ix * 3.14159265359 / 2.0
ileftpan                =                       sqrt(2.0) / 2.0 * (cos(iangle) + sin(iangle))
irightpan               =                       sqrt(2.0) / 2.0 * (cos(iangle) - sin(iangle))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; KONTROL
kindenv                 expseg                  .000001, iattack, 1.0, isustain, .0125, irelease, .000001
kindex                  =                       kindenv * index * ifmamplitude - .000001
; AUDIO
aouta                   foscili                 iamplitude, ifrequency, icarrier, iratio, index, 1
aoutb                   foscili                 iamplitude, ifrequencyb, icarrierb, iratio, index, 1
; Plus amplitude correction.
afmout                  =                       (aouta + aoutb) * kindenv
asig1                   =                       ileftpan * afmout * kdamping
asig2                   =                       irightpan * afmout * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   18 ; Guitar, Michael Gogins
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       .01
isustain                =                       p3
irelease                =                       .05
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ifrequency              =                       cpsoct(p4)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 5
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
kamp                    linseg                  0.0, iattack, iamplitude, isustain, iamplitude, irelease, 0.0
asigcomp                pluck                   kamp, 440, 440, 0, 1
asig                    pluck                   kamp, ifrequency, ifrequency, 0, 1
af1                     reson                   asig, 110, 80
af2                     reson                   asig, 220, 100
af3                     reson                   asig, 440, 80
aout                    balance                 0.6 * af1+ af2 + 0.6 * af3 + 0.4 * asig, asigcomp
kexp                    expseg                  1.0, iattack, 2.0, isustain, 1.0, irelease, 1.0
kenv                    =                       kexp - 1.0
asig1                   =                       aout * ileftgain * kenv * kdamping,
asig2                   =                       aout* irightgain * kenv * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   19 ;  Flute, James Kelley
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
; Do some phasing.
icpsp1                  =                       cpsoct(p4 - .0002)
icpsp2                  =                       cpsoct(p4 + .0002)
; Normalize to 80 dB = ampdb(80).
ip6                     =                       ampdb(p5)
ijunk6                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
iradians                =                       p7 * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
iattack                 =                       0.04
isustain                =                       p3
irelease                =                       0.15
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ip4                     =                       0
                        if                      (ip4 == int(ip4 / 2) * 2) goto initslurs
                        ihold
initslurs:
iatttm                  =                       0.09
idectm                  =                       0.1
isustm                  =                       p3 - iatttm - idectm
idec                    =                       ip6
ireinit                 =                       -1
                        if                      (ip4 > 1) goto checkafterslur
ilast                   =                       0
checkafterslur:
                        if                      (ip4 == 1 || ip4 == 3) goto doneslurs
idec                    =                       0
ireinit                 =                       0
; KONTROL
doneslurs:
                        if                      (isustm <= 0)   goto simpleenv
kamp                    linseg                  ilast, iatttm, ip6, isustm, ip6, idectm, idec, 0, idec
                        goto                    doneenv
simpleenv:
kamp                    linseg                  ilast, p3 / 2,ip6, p3 / 2, idec, 0, idec
doneenv:
ilast                   =                       ip6
; Some vibrato.
kvrandamp               rand                    .1
kvamp                   =                       (8 + p4) *.06 + kvrandamp
kvrandfreq              rand                    1
kvfreq                  =                       5.5 + kvrandfreq
kvbra                   oscili                  kvamp, kvfreq, 1, ireinit
kfreq1                  =                       icpsp1 + kvbra
kfreq2                  =                       icpsp2 + kvbra
; Noise for burst at beginning of note.
knseenv                 expon                   ip6 / 4, .2, 1
; AUDIO
anoise1                 rand                    knseenv
anoise                  tone                    anoise1, 200
a1                      oscili                  kamp, kfreq1, gikellyflute, ireinit
a2                      oscili                  kamp, kfreq2, gikellyflute, ireinit
a3                      =                       a1 + a2 + anoise
asig1                   =                       a3 * ileftgain * kdamping
asig2                   =                       a3 * irightgain * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   20 ; Delayed plucked string, Michael Gogins
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iattack                 =                       0.02
isustain                =                       p3
irelease                =                       0.15
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ioctave                 =                       p4
ihertz                  =                       cpsoct(ioctave)
; Detuning of strings by 4 cents each way.
idetune                 =                       4.0 / 1200.0
ihertzleft              =                       cpsoct(ioctave + idetune)
ihertzright             =                       cpsoct(ioctave - idetune)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5)
ijunk6                  =                       p6
; Constant-power pan.
; x location ranges from hard left = -1 through center = 0 to hard right = 1.
; Angle of pan ranges from hard left = - pi / 2 through center = 0 to hard right = pi / 2.
ix                      =                       p7
iangle                  =                       ix * 3.14159265359 / 2.0
ileftpan                =                       sqrt(2.0) / 2.0 * (cos(iangle) + sin(iangle))
irightpan               =                       sqrt(2.0) / 2.0 * (cos(iangle) - sin(iangle))
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
; INITIALIZATION
igenleft                =                       gisine
igenright               =                       gicosine
; KONTROL
kvibrato                oscili                  1.0 / 120.0, 7.0, 1
; AUDIO
kexponential            expseg                  1.0, p3 + iattack, 0.0001, irelease, .0001
kenvelope               =                       (kexponential - 0.0001) * kdamping
ag                      pluck                   iamplitude, cpsoct(ioctave + kvibrato), 200, igenleft, 1
agleft                  pluck                   iamplitude, ihertzleft, 200, igenleft, 1
agright                 pluck                   iamplitude, ihertzright, 200, igenright, 1
imsleft                 =                       0.2 * 1000
imsright                =                       0.21 * 1000
adelayleft              vdelay                  ag * kenvelope, imsleft, imsleft + 100
adelayright             vdelay                  ag * kenvelope, imsright, imsright + 100
asignal                 =                       kdamping * (agleft + adelayleft + agright + adelayright)
; Highpass filter to exclude speaker cone excursions.
asignal1                butterhp                asignal, 32.0
asignal2                balance                 asignal1, asignal
asig1                   =                       ileftpan * asignal * kdamping
asig2                   =                       irightpan * asignal * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   21 ; Melody (Chebyshev / FM / additive), Jon Nelson
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
; Pitch.
i1                      =                       cpsoct(p4)
; Amplitude.
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) * 1.0 / 5000.0
; Constant-power pan.
iangle                  =                       p6 / 2.0
ijunk7                  =                       p7
ijunk8                  =                       p8
ijunk9                  =                       p9
ijunk10                 =                       p10
ijunk11                 =                       p11
ileftpan                =                       sqrt(2.0) / 2.0 * (cos(iangle) + sin(iangle)) * iamplitude;
irightpan               =                       sqrt(2.0) / 2.0 * (cos(iangle) - sin(iangle)) * iamplitude;
;ip6                    =                       cheby no
ip6                     =                       gichebychev
iattack                 =                       .05
isustain                =                       p3
irelease                =                       .1
iduration               =                       iattack + isustain + irelease
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linseg                  0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
k100                    randi                   1,10
k101                    oscili                  1, 5 + k100, gisine
k102                    linseg                  0, .5, 1, (iduration - .5), 1
k100                    =                       i1 + (k101 * k102)
; Envelope for driving oscillator.
k1                      linenr                  .5, iduration * .3, iduration * .2, 0.01
k2                      line                    1, iduration, .5
k1                      =                       k2 * k1
; Amplitude envelope.
k10                     expseg                  .0001, iattack, iamplitude, isustain, iamplitude * .8, irelease, .0001
k10                     =                       (k10 - .0001) * kdamping
; Power to partials.
k20                     linseg                  1.485, iattack, 1.5, (isustain + irelease), 1.485
;a1-3 are for cheby with p6=1-4
a1                      oscili                  k1, k100 - .025, gicook3
; Tables a1 to fn13, others normalize,
a2                      tablei                  a1, ip6, 1, .5
a3                      balance                 a2, a1
; Try other waveforms as well.
a4                      foscil                  1, k100 + .04, 1, 2.005, k20, gisine
a5                      oscili                  1, k100, gisine
a6                      =                       ((a3 * .1) + (a4 * .1) + (a5 * .8)) * k10
a7                      comb                    a6, .5, 1 / i1
a8                      =                       (a6 * .9) + (a7 * .1)
a9          balance         a8, a1 * 32767.0
asig1                   =                       (a9 * ileftpan) * kdamping
asig2                   =                       (a9 * irightpan) * kdamping
						outs					asig1, asig2
                        endin

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                        instr                   22 ; Enhanced FM bell, John ffitch
                        ; print                         p2, p3, p4, p5, p6, p7, p8, p9, p10, p11
                        mididefault             60, p3
                        midinoteonoct           p4, p5
iinstrument             =                       p1
istarttime              =                       p2
iattack                 =                       .005
isustain                =                       p3
irelease                =                       .06
                        ; xtratim                       iattack + irelease
p3                      =                       isustain + iattack + irelease
kdamping                linsegr                 0.0, iattack, 1.0, isustain, 1.0, irelease, 0.0
ioctave                 =                       p4
ifrequency              =                       cpsoct(ioctave)
; Normalize so iamplitude for p5 of 80 == ampdb(80).
iamplitude              =                       ampdb(p5) / 3
iphase                  =                       p6
; Constant-power pan.
ipi                     =                       4.0 * taninv(1.0)
ixpan                   =                       p7
iradians                =                       ixpan * ipi / 2.0
itheta                  =                       iradians / 2.0
; Translate angle in [-1, 1] to left and right gain factors.
irightgain              =                       sqrt(2.0) / 2.0 * (cos(itheta) + sin(itheta))
ileftgain               =                       sqrt(2.0) / 2.0 * (cos(itheta) - sin(itheta))
iypan                   =                       p8
izpan                   =                       p9
imason                  =                       p10
ihomogeneity            =                       p11
idur                    =                       15
iamp                    =                       iamplitude
ifenv                   =                       giffitch2                       ; BELL SETTINGS:
ifdyn                   =                       giffitch3                       ; AMP AND INDEX ENV ARE EXPONENTIAL
ifq1                    =                       cpsoct(p4 - 1) * 5              ; DECREASING, N1:N2 IS 5:7, imax=10
if1                     =                       giffitch1                               ; DURATION = 15 sec
ifq2                    =                       cpsoct(p4 - 1) * 7
if2                     =                       giffitch1
imax                    =                       10
aenv                    oscili                  iamp, 1 / idur, ifenv           ; ENVELOPE
adyn                    oscili                  ifq2 * imax, 1 / idur, ifdyn    ; DYNAMIC
anoise                  rand                    50
amod                    oscili                  adyn + anoise, ifq2, if2        ; MODULATOR
acar                    oscili                  aenv, ifq1 + amod, if1          ; CARRIER
                        timout                  0.5, idur, noisend
knenv                   linseg                  iamp, 0.2, iamp, 0.3, 0
anoise3                 rand                    knenv
anoise4                 butterbp                anoise3, iamp, 100
anoise5                 balance                 anoise4, anoise3
noisend:
arvb                    nreverb                 acar, 2, 0.1
asignal                 =                       acar + anoise5 + arvb
asig1                   =                       asignal * ileftgain * kdamping
asig2                   =                       asignal * irightgain * kdamping
						outs					asig1, asig2
                        endin
</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>

error: pathspec 'examples/CsoundVST-nomixer.csd' did not match any file(s) known to git


Added example to assets.

Added example to assets.

error: pathspec 'android/CSDPlayer/assets/Csound6AndroidExamples/Boulanger/trapped.csd' did not match any file(s) known to git


test25

<CsoundSynthesizer>

<CsInstruments>
;
sr=44100
ksmps=1
nchnls=2

	instr 1	;untitled
  ; Capture the highest amplitude in the "beats.wav" file.
  asig soundin "beats.wav"
  kp peak asig

  ; Print out the peak value once per second.
  printk 1, kp

  out asig
endin

</CsInstruments>

<CsScore>

i 1 0 3
e

</CsScore>

</CsoundSynthesizer>

error: pathspec 'tests/test25.csd' did not match any file(s) known to git


added CSD test by Joachim Heintz that has var definition within if-then blocks

/****************************************************************************
ift, iftlen StrayNumToFt Stray [, iftno [, isep1 [, isep2]]]
Converts a string-array which just consists of numbers or simple math expressions to a function table

Puts all numbers in Stray (which must not contain non-numerical elements) in a function table and returns its variable ift (which is produced by iftno, default=0) and the length of the elements written iftlen. (An empty string as input writes a function table of size=1 to avoid an error but returns 0 as length of elements written.) Simple binary math expressions using +, -, *, /, ^ and % are allowed, with just one parenthesis in total (see the examples below).
Elements are defined by two seperators as ASCII coded characters: isep1 defaults to 32 (= space), isep2 defaults to 9 (= tab). If just one seperator is used, isep2 equals isep1.
Requires csound 5.15 or higher, and the UDOs StrayLen, StrExpr1 and StrExpr2

Stray - a string as array
iftno - like in an ftgen statement: if 0 (which is also the default) an automatic number is generated by Csound; if any positive number, this is then the number of the function table
isep1 - the first seperator (default=32: space)
isep2 - the second seperator (default=9: tab)
ift - the number of the function table which has been created
iftlen - the length of the elements written to the function table (usually this equals the length of the function table; just an empty string as input will create a function table of size=1 but with iftlen=0)
****************************************************************************/

<CsoundSynthesizer>
<CsOptions>
-n -m0
</CsOptions>
<CsInstruments>

  opcode StrayLen, i, Sjj
;returns the number of elements in Stray. elements are defined by two seperators as ASCII coded characters: isep1 defaults to 32 (= space), isep2 defaults to 9 (= tab). if just one seperator is used, isep2 equals isep1
Stray, isepA, isepB xin
;;DEFINE THE SEPERATORS
isep1     =         (isepA == -1 ? 32 : isepA)
isep2     =         (isepA == -1 && isepB == -1 ? 9 : (isepB == -1 ? isep1 : isepB))
Sep1      sprintf   "%c", isep1
Sep2      sprintf   "%c", isep2
;;INITIALIZE SOME PARAMETERS
ilen      strlen    Stray
icount    =         0; number of elements
iwarsep   =         1
indx      =         0
 if ilen == 0 igoto end ;don't go into the loop if String is empty
loop:
Snext     strsub    Stray, indx, indx+1; next sign
isep1p    strcmp    Snext, Sep1; returns 0 if Snext is sep1
isep2p    strcmp    Snext, Sep2; 0 if Snext is sep2
 if isep1p == 0 || isep2p == 0 then; if sep1 or sep2
iwarsep   =         1; tell the log so
 else 				; if not
  if iwarsep == 1 then	; and has been sep1 or sep2 before
icount    =         icount + 1; increase counter
iwarsep   =         0; and tell you are ot sep1 nor sep2
  endif
 endif
          loop_lt   indx, 1, ilen, loop
end:      xout      icount
  endop

  opcode StrExpr1, i, S
Str       xin
isum      strindex  Str, "+"; sum
idif      strindex  Str, "-"; difference
ipro      strindex  Str, "*"; product
irat      strindex  Str, "/"; ratio
ipow      strindex  Str, "^"; power
imod      strindex  Str, "%"; modulo
 if ipow > 0 then
ifirst    strindex  Str, "^"
S1        strsub    Str, 0, ifirst
S2        strsub    Str, ifirst+1
i1        strtod    S1
i2        strtod    S2
ires      =         i1 ^ i2
 elseif imod > 0 then
ifirst    strindex  Str, "%"
S1        strsub    Str, 0, ifirst
S2        strsub    Str, ifirst+1
i1        strtod    S1
i2        strtod    S2
ires      =         i1 % i2
 elseif ipro > 0 then
ifirst    strindex  Str, "*"
S1        strsub    Str, 0, ifirst
S2        strsub    Str, ifirst+1
i1        strtod    S1
i2        strtod    S2
ires      =         i1 * i2
 elseif irat > 0 then
ifirst    strindex  Str, "/"
S1        strsub    Str, 0, ifirst
S2        strsub    Str, ifirst+1
i1        strtod    S1
i2        strtod    S2
ires      =         i1 / i2
 elseif isum > 0 then
ifirst    strindex  Str, "+"
S1        strsub    Str, 0, ifirst
S2        strsub    Str, ifirst+1
i1        strtod    S1
i2        strtod    S2
ires      =         i1 + i2
 elseif idif > -1 then
ifirst    strrindex Str, "-";(last occurrence: -3-4 is possible, but not 3--4)
S1        strsub    Str, 0, ifirst
S2        strsub    Str, ifirst+1
iS1len    strlen    S1
 if iS1len == 0 then ;just a negative number
inum      strtod    S2
ires      =         -inum
 else
ifirst    strtod    S1
isec      strtod    S2
ires      =         ifirst - isec
  endif
 else
ires      strtod    Str
 endif
          xout      ires
  endop

  opcode StrExpr2, i, S
Sin       xin
ilen      strlen    Sin
;if a parenthesis can be found
iparenth  strindex  Sin, "("
if iparenth > -1 then
  ;if in first half and no '-' preceeds
  if iparenth == 0 then
    ;then first element ends in ")"
iprend    strindex   Sin, ")"
S1        strsub     Sin, 1, iprend
    ;convert this element into a number
i1        StrExpr1   S1
    ;append the rest and convert again
S2        strsub     Sin, iprend+2
Sep       strsub     Sin, iprend+1, iprend+2
Scoll     sprintf    "%f%s%s", i1, Sep, S2
ires      StrExpr1   Scoll
  ;if in first half and '-' preceeds
  elseif iparenth == 1 then
    ;then first element ends in ")"
iprend    strindex   Sin, ")"
S1        strsub     Sin, 2, iprend
    ;convert this element into a number
i1        StrExpr1   S1
i1        =          -i1
    ;append the rest and convert again
S2        strsub     Sin, iprend+2
Sep       strsub     Sin, iprend+1, iprend+2
Scoll     sprintf    "%f%s%s", i1, Sep, S2
ires      StrExpr1   Scoll
  ;if the parenthesis is in the second half
  else
    ;isolate first element and the conjunction
S1        strsub     Sin, 0, iparenth-1
Sep       strsub     Sin, iparenth-1, iparenth
    ;convert the second element
S2        strsub     Sin, iparenth+1, ilen-1
i2        StrExpr1   S2
      ;if subtraction and i2 negative, convert to addition
isepminus strcmp     Sep, "-"
      if i2 < 0 && isepminus == 0 then
i2        =          -i2
Sep       =          "+"
      endif
    ;convert the whole
Scoll     sprintf    "%s%s%f", S1, Sep, i2
ires      StrExpr1   Scoll
  endif
;if no parenthesis, simply convert
else
ires      StrExpr1   Sin
endif
          xout       ires
  endop

  opcode StrayNumToFt, ii, Sojj
  ;requires the UDOs StrayLen, StrExpr1 and StrExpr2
Stray, iftno, isepA, isepB xin
;;DEFINE THE SEPERATORS
isep1     =         (isepA == -1 ? 32 : isepA)
isep2     =         (isepA == -1 && isepB == -1 ? 9 : (isepB == -1 ? isep1 : isepB))
Sep1      sprintf   "%c", isep1
Sep2      sprintf   "%c", isep2
;;CREATE A FUNCTION TABLE
iftlen    StrayLen  Stray, isep1, isep2
 if iftlen == 0 then
          prints    "WARNING! StrayNumToFt got empty string as input. Function table with length=1 created, but iftlen=0 returned.\n"
iftl      =         1
 else
iftl      =         iftlen
 endif
ift       ftgen     iftno, 0, -iftl, -2, 0
;;INITIALIZE SOME PARAMETERS
ilen      strlen    Stray
istartsel =         -1; startindex for searched element
iel       =         -1; number of element in Stray and ift
iwarleer  =         1; is this the start of a new element
indx      =         0 ;character index
inewel    =         0 ;new element to find
;;LOOP
 if ilen == 0 igoto end ;don't go into the loop if Stray is empty
loop:
Schar     strsub    Stray, indx, indx+1; this character
isep1p    strcmp    Schar, Sep1; returns 0 if Schar is sep1
isep2p    strcmp    Schar, Sep2; 0 if Schar is sep2
is_sep    =         (isep1p == 0 || isep2p == 0 ? 1 : 0) ;1 if Schar is a seperator
 ;END OF STRING AND NO SEPARATORS BEFORE?
 if indx == ilen && iwarleer == 0 then
Sel       strsub    Stray, istartsel, -1
inewel    =         1
 ;FIRST CHARACTER OF AN ELEMENT?
 elseif is_sep == 0 && iwarleer == 1 then
istartsel =         indx ;if so, set startindex
iwarleer  =         0 ;reset info about previous separator
iel       =         iel+1 ;increment element count
 ;FIRST SEPERATOR AFTER AN ELEMENT?
 elseif iwarleer == 0 && is_sep == 1 then
Sel       strsub    Stray, istartsel, indx ;get element
inewel    =         1 ;tell about
iwarleer  =         1 ;reset info about previous separator
 endif
 ;WRITE THE ELEMENT TO THE TABLE
 if inewel == 1 then
inum      StrExpr2  Sel ;convert expression to number
          tabw_i    inum, iel, ift ;write to ift
 endif
inewel    =         0
          loop_le   indx, 1, ilen, loop
end:
          xout      ift, iftlen
  endop

  opcode TbDmpSmpS, 0, iiSo
;prints the content of a table in a simple way, with an additional string as 'introduction'
ifn, iprec, String, ippr xin; function table, float precision while printing, String, parameters per row (maximum = 32)
ippr      =         (ippr == 0 ? 10 : ippr)
iend      =         ftlen(ifn)
indx      =         0
Sformat   sprintf   "%%.%df, ", iprec
Sdump     sprintf   "%s[", String
loop:
ival      tab_i     indx, ifn
Snew      sprintf   Sformat, ival
Sdump     strcat    Sdump, Snew
imod      =         (indx+1) % ippr
 if imod == 0 && indx != iend-1 then
          puts      Sdump, 1
Sdump     =         ""
 endif
          loop_lt   indx, 1, iend, loop
ilen      strlen    Sdump
Slast     strsub    Sdump, 0, ilen-2
		printf_i	"%s]\n", 1, Slast
  endop

instr 1
Stray     strget    p4
          printf_i  "\nStray = '%s'\n", 1, Stray
ipcnt     pcount
if ipcnt == 4 then
ift, ilen StrayNumToFt Stray
elseif ipcnt == 5 then
ift, ilen StrayNumToFt Stray, p5
elseif ipcnt == 6 then
ift, ilen StrayNumToFt Stray, p5, p6
elseif ipcnt == 7 then
ift, ilen StrayNumToFt Stray, p5, p6, p7
endif
          prints    "ift# = %d, iftlen = %d%n", ift, ilen
          TbDmpSmpS ift, 5, "table content = "
endin

</CsInstruments>
<CsScore>
i 1 0 .01 "1 -2 3 4 5 6 7"
i . + . "1.2  	2+3.45  6.7/-8.09 "
i . + . "  	15%12  -5-3   "
i . + . "	 2^0.6	 2^(1/12) 2^(-1/12)  	16 32"
i . + . "123*-4.56	 "
i . + . "123*(-4.56)	 "
i . + . "	 "
i . + . ""
i . + . "-(1+2.7)*-3 2^-(-1/-12) -(-3.10*-65)/-3.4567 27%5"
i . + . "1+2.7 2^(1/12) 3.10*65 27%5"
i . + . "1+2.7 2^(1/12) 3.10*65 27%6" 13 ;write table number 13
i . + . "1+2.7,2^(1/12),3.10*65,27%7" 0 44 ;just commas are seperators
i . + . "1+2.7, 2^(1/12), 3.10*65, 27%8" 0 44 ;no problem to write spaces though
i . + . "1+2.7,2^(1/12)|3.10*65,27%9" 0 44 124 ;commas and '|' are seperators
e
</CsScore>
</CsoundSynthesizer>

returns:

Stray = '1 -2 3 4 5 6 7'
ift# = 101, iftlen = 7
table content = [1.00000, -2.00000, 3.00000, 4.00000, 5.00000, 6.00000, 7.00000]

Stray = '1.2  	2+3.45  6.7/-8.09 '
ift# = 102, iftlen = 3
table content = [1.20000, 5.45000, -0.82818]

Stray = '  	15%12  -5-3   '
ift# = 103, iftlen = 2
table content = [3.00000, -8.00000]

Stray = '	 2^0.6	 2^(1/12) 2^(-1/12)  	16 32'
ift# = 104, iftlen = 5
table content = [1.51572, 1.05946, 0.94387, 16.00000, 32.00000]

Stray = '123*-4.56	 '
ift# = 105, iftlen = 1
table content = [-560.88000]

Stray = '123*(-4.56)	 '
ift# = 106, iftlen = 1
table content = [-560.88000]

Stray = '	 '
WARNING! StrayNumToFt got empty string as input. Function table with length=1 created, but iftlen=0 returned.
ift# = 107, iftlen = 0
table content = [0.00000]

Stray = ''
WARNING! StrayNumToFt got empty string as input. Function table with length=1 created, but iftlen=0 returned.
ift# = 108, iftlen = 0
table content = [0.00000]

Stray = '-(1+2.7)*-3 2^-(-1/-12) -(-3.10*-65)/-3.4567 27%5'
ift# = 109, iftlen = 4
table content = [11.10000, 0.94387, 58.29259, 2.00000]

Stray = '1+2.7 2^(1/12) 3.10*65 27%5'
ift# = 110, iftlen = 4
table content = [3.70000, 1.05946, 201.50000, 2.00000]

Stray = '1+2.7 2^(1/12) 3.10*65 27%6'
ift# = 13, iftlen = 4
table content = [3.70000, 1.05946, 201.50000, 3.00000]

Stray = '1+2.7,2^(1/12),3.10*65,27%7'
ift# = 111, iftlen = 4
table content = [3.70000, 1.05946, 201.50000, 6.00000]

Stray = '1+2.7, 2^(1/12), 3.10*65, 27%8'
ift# = 112, iftlen = 4
table content = [3.70000, 1.05946, 201.50000, 3.00000]

Stray = '1+2.7,2^(1/12)|3.10*65,27%9'
ift# = 113, iftlen = 4
table content = [3.70000, 1.05946, 201.50000, 0.00000]
<bsbPanel>
 Widgets
 <objectName/>
 <x>100</x>
 <y>100</y>
 <width>320</width>
 <height>240</height>
 <visible>true</visible>
 <uuid/>
 <bgcolor mode="nobackground">
  <r>255</r>
  <g>255</g>
  255
 </bgcolor>
</bsbPanel>
<bsbPresets>
</bsbPresets>

error: pathspec 'tests/commandline/contrib/StrayNumToFt.csd' did not match any file(s) known to git


no message

no message

error: pathspec 'examples/CsoundVST-nomixer-flags.csd' did not match any file(s) known to git


First attempt at OSC listener

First attempt at OSC listener

<CsoundSynthesizer>

<CsInstruments>
instr 1
    OSCinit     7070
endin

instr 2
        ki init 0
    kk OSClisten "/foo/bar", "i", ki
endin

</CsInstruments>

<CsScore>
i1 0 1
i2 0 10
e
</CsScore>

</CsoundSynthesizer>

error: pathspec 'examples/oscrecv.csd' did not match any file(s) known to git


added array test within UDO

added array test within UDO

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

opcode OscBank,a,kki

setksmps 1
au init 0
kph[] init inum
kcnt init 0
kfr,kamp,inum xin

until kcnt == inum do
au += sin(kph[kcnt])       ; this line segfaults
kph[kcnt] = kph[kcnt] + kfr*kcnt*(2*$M_PI)/sr  ; this line segfaults
kcnt += 1
od
xout au*kamp
au = 0
kcnt = 0

endop

instr 1

aout OscBank 440, .5, 8

outs aout, aout

endin

</CsInstruments>
<CsScore>
i1 0 .5
</CsScore>
</CsoundSynthesizer>

error: pathspec 'tests/commandline/test_arrays_in_udo.csd' did not match any file(s) known to git