<CsoundSynthesizer>
<CsOptions>
 

-odac     
;Uphera by Patrik Zsók

</CsOptions>
<CsInstruments>
 

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

gaout init 0 

instr 1  ;fo granular

insnd   = 10 
ibasfrq = 44100 / ftlen(insnd) ; az insnd fájltulajdonképpen az F névre hallgató table functionre hivatkozik és sr-ként használja

kamp   expseg 0.001, p3/20, .01, p3/20, .01 ;novekedo amplitudo
kpitch line ibasfrq * p7, p3, ibasfrq * p6
kdens  line p4, p3, p5
kaoff  line .1, p3, 0
kpoff  line .1, p3, ibasfrq * 0.01
kgdur  line 4.2, p3, 0.1
imaxgdur =  .5 

asigL  grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0 
asigR  grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0 ;ezek felelnek a szterejo hatásért
       outs asigL*0.4, asigR*0.4

endin 


instr 2   ;fo ambi szinuszok

iatt = p6
idec  = p7  
islev = p8
irel  = p9

iatt2 = p11
idec2  = p12  
islev2 = p13
irel2  = p14

	kenv adsr iatt, idec, islev, irel

	kenv2 adsr iatt2, idec2, islev2, irel2
		  
	a1 oscil kenv*p4, p5, 1    ; p4=amp
	                      ; p5=freq
	af oscil kenv2*p10, p5, 1
	a2 oscil kenv*p4,af+p5, 1  ;modulacio
	
	aL,aR freeverb a2,a2, 0.9, 0.10, sr, 0
	                      
	                     
	outs a2+(aL*p15), a2+(aR*p15)

endin

instr 3 ;masodik granulel ismetleses

insnd   = 11 
ibasfrq = 44100 / ftlen(insnd) ; Use original sample rate of insnd file 

kamp   expseg 0.001, p3/20, .01, p3/20, .01 ;a swell in amplitude
kpitch line ibasfrq * p7, p3, ibasfrq * p6
kdens  line p4, p3, p5
kaoff  line .1, p3, 0
kpoff  line .1, p3, ibasfrq * 0.01
kgdur  line 5.2, p3, 0.1
imaxgdur =  10.9 

ain grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0
kline line 0, p8, 1
aL, aR pan2  ain, kline

;asigL  grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0 
;asigR  grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0 
       outs aL*0.7, aR*0.7 ; 0.7dB (dragonBallnal) limital

endin 

instr 4   ;szinten ismetlesosztalyos szinucc 


iatt = p6
idec  = p7  
islev = p8
irel  = p9 

	kenv adsr iatt, idec, islev, irel  
	a1 oscil kenv*p4, p5, 1    ; p4=amp
	                      ; p5=freq
	af oscil 5, p5, 1
	a2 oscil kenv*p4,af*p5, 2  
	aL,aR freeverb a2,a2, 0.9, 0.10, sr, 0                     
	                     
	outs a2+aL, a2+aR

endin

instr 5 ;ismetleses instru 


iatt = p6
idec  = p7  
islev = p8
irel  = p9 

	kenv adsr iatt, idec, islev, irel  
	a1 oscil kenv*p4, p5, 1    ; p4=amp
	                      ; p5=freq
	af oscil 1000, p5, 1
	a2 oscil kenv*p4,p5, 3  
	aL,aR freeverb a2,a2, 0.9, 0.9, sr, 0                     
	                     
	outs a2+aL, a2+aR ;dry/wet jel

endin


instr 6   ;ismetleses gran

insnd   = 12 
ibasfrq = 44100 / ftlen(insnd) 

kamp   expseg 0.001, p3/20, .01, p3/20, .01
kpitch line ibasfrq * p7, p3, ibasfrq * p6
kdens  line p4, p3, p5
kaoff  line .1, p3, 0
kpoff  line .1, p3, ibasfrq * 0.01
kgdur  line 2.2, p3, 2.5
imaxgdur =  2.9 

iatt = 1.0
idec  = 0.8  
islev = 0.9
irel  = 1.0 

kenv adsr iatt, idec, islev, irel

ain grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0
kline line 1, p8, 0
aL, aR pan2  ain, kline
aL2,aR2 freeverb ain,ain, 0.9, 0.9, sr, 0

;asigL  grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0 
;asigR  grain kamp, kpitch, kdens, kaoff, kpoff, kgdur, insnd, 5, imaxgdur, 0.0 
       outs aL*0.5+aL2*kenv, aR*0.5+aR2*kenv

endin


instr 7   ;egy darab szekvencia ami egy majdnem arpeggio stilust ad de nemm

knote = p5

if (knote == 0) then
  kcps = 110.54
  
elseif (knote == 1) then
  kcps = 221.08

elseif (knote == 2) then
  kcps = 331.62
  
elseif (knote == 3) then
  kcps = 441.16
  
elseif (knote == 4) then
  kcps = 550.7
  
    
endif

iatt = p6
idec  = p7  
islev = p8
irel  = p9 

	kenv adsr iatt, idec, islev, irel  

a1 oscili kenv*p4,kcps, 4

  	out a1,a1

endin

instr 8   ;delayes pitches kis dologka
adel init 0
ilev    = p7			
idelay  = p8 *.001			
ifd	= p9	

ktrans linseg p4, p5, p6
krop adsr 0.3, 0.8, 0.8, 0.2
a1     diskin2 "pad_01.wav", ktrans, 0, 1, 0, 32
adel	delay   a1 + (adel*ifd), idelay
asig	moogvcf	adel, 1500, .6, 1

aL2,aR2 freeverb a1,a1, 0.9, 0.9, sr, 0
       outs a1*krop+(asig*ilev)+aL2, a1*krop+(asig*ilev)+aR2

endin

instr 9 ;timesteches bulika szimpla hullamrepeticiokbol

krep linseg p4, p5, p6
asig soundin "fire_02.wav"
aout waveset asig, krep
     outs aout, aout
  
endin

instr 10 ;ez is de ez pitch-modulacio mega a timesztercs
adel init 0

ktimewarp line 0, p3, 2.7	
kresample init 1		
ibeg = 0			
iwsize = 4410			
irandw = 882			
itimemode = 1			
ioverlap = p4

a1 sndwarp .5, ktimewarp, kresample, 8, ibeg, iwsize, irandw, ioverlap, 9, itimemode


     outs a1*0.4, a1*0.4

endin

</CsInstruments>
<CsScore>
 
f5  0 512  20 2 ; Hanning ablak?
f10 0 16384 1  "hardbeats_3 Sample - 2017-Oct-27.wav" 0 0 0 

f6  0 512  20 2 ; Hanning ablak!
f11 0 16384 1  "nausea Sample - 2017-Mar-09.wav" 0 0 0 

f1         0  4096  	10	 1	
f2         0 16384 10 1 0.5 0.3 0.25 0.2 0.167 0.14 0.125 .111     ;szinuszosszetevos hanghullamok
f3         0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111
f4         0 16384 10 1 0 0.3 0 0.2 0 0.14 0 .111

f8 0 131072 1 "03.wav" 0 0 0	
f9 0 1024 9 0.5 1 0	                                       ;betoltjuk a hangmintakat

f7 0 512  20 2
f12 0 16384 1  "Ajtonyikorgas.wav" 0 0 0

;elso felvonas

i2   9   35    0.02       881.5     		1.1						0.2      0.5          1.0    881.5     		2.3						0.2      0.5          0.5 0

i2   9   35    0.05      882.1  						0.1						0.2      0.05          2.9   882.1  						1.1						0.1      0.05          1.9 0

i2   9    25    0.01      223.2        0.1						0.02      0.5          0.2  400.2        0.4						0.02      0.5          0.01 0

i2   9  20    0.03     222.5           1.5						0.2      0.005          0.5  300.5           1.5						0.2      0.005          0.5 0

i2   9    20    0.04     55          0.01						0.2      0.5          0.5    100          0.1						0.2      0.5          0.05 0

i2 26    25 				0.05    57						1.3						  0.5       0.5          0.5   100          0.01						0.2      0.05          0.5 0

i2 26    25 				0.05    173						1.3						  0.05       0.5          1.5   600.7						3.3						  0.05       0.5          0.5 0

i2 32    25 				0.05    301						5.3						  0.5       0.5          0.5  900.7						2.3						  0.5       0.05          0.05 0

i2 32    25 				0.05    304						4.3						  0.5       0.5          0.5  903.7					1.3						  0.5       0.05          0.05 0

i2 37    25 				0.05    204						1.3						  0.5       0.5          0.5   1200.7						0.3						  0.5       0.05          2.5 0

i2 37   25 				0.05    206						1.3						  0.5       0.5          0.5    1202.7						1.3						  0.5       0.05          0.5 0

i2 41    20 				0.05    114						2.3						  0.5       0.5          0.5   100          0.01						0.02      0.05          0.05 0

i2 41    20 				0.05    116						2.3						  0.5       0.5          0.5   102          1.1						0.2      0.05          1.5 0


;masodik felvonas egyben utolso resz


i2   170   25    0.06       659.5     		1.1						0.2      0.5          1.0    659.5     		0.3						0.2      0.5          0.5 1

i2   170   35    0.06      660.1  						0.1						0.2      0.05          2.9   660.1  						3.1						0.1      0.05          1.9 1

i2   170    25    0.03      164.2        0.1						0.02      0.5          0.2  464.2        1.4						0.02      0.5          0.01 1

i2   170  20    0.05     166.5           1.5						0.2      0.005          0.5  466.5           0.5						0.2      0.005       0.5 1

i2   170   20    0.06     41          0.01						0.2      0.5          0.5    400          2.1						0.2      0.5          0.05 1

i2 196    25 				0.03    44						1.3						  0.5       0.5          0.5   1200          3.01						0.2      0.05          0.5 1

i2 196    25 				0.04    123						1.3						  0.05       0.5          1.5  500.7						1.3						  0.05       0.5          0.5 1

i2 202    25 				0.05    296						5.3						  0.5       0.5          0.5  870.7						0.3						  0.5       0.05          0.05 1

i2 202    25 				0.06    196						4.3						  0.5       0.5          0.5  873.7					0.3						  0.5       0.05          0.05 1

i2 207    25 				0.07    222						1.3						  0.5       0.5          0.5   1600.7						3.3						  0.5       0.05          2.5 1

i2 207   25 				0.04    220						1.3						  0.5       0.5          0.5    1602.7						2.3						  0.5       0.05          0.5 1

i2 211    20 				0.06    123						2.3						  0.5       0.5          0.5   400          1.01						0.02      0.05          0.05 1

i2 210    20 				0.03    125						2.3						  0.5       0.5          0.5   402          4.1						0.2      0.05          1.5 1


;granularos dolog maszkalasa
{ 2 SMARK

i1 [9 + 10 *$SMARK.] [20 + 10 *$SMARK.] [0.01+ 10 *$SMARK.] [10+ 10 *$SMARK.] 0.1 6.5
}


;granular
{ 3 SMiRK

i3 [19 + 10 *$SMiRK.] [20 + 10 *$SMiRK.] [0.1+ 10 *$SMiRK.] [10+ 100 *$SMiRK.] 15.5 0.3 5 
}


;szekvencia
{ 6 SMACK
i4   [9 +10 * $SMACK.]    5    0.02       [600.5 + 100 * $SMACK. ]     		1.1						0.2      0.5          1.0
}


;granularszekv
{ 6 SMeCK
i5   [29 +10 * $SMeCK.]    10    0.05       [400.5 + 100 * $SMeCK. ]     		0.5						0.1      0.3          1.0
}

;szintenszekvencia
{ 3 SMoRK

i6 [49 + 10 *$SMoRK.] [20 + 10 *$SMoRK.] [0.1+ 10 *$SMoRK.] [10+ 100 *$SMoRK.] 0.2 7.3 5
}



;i 7 10     0.5 				0.05    0 						0.03						  0.05       0.05          0.05
;i . +     . 				.    1 						
;i . +     . 				.    2 

		
;ifes instru
{ 4 SMERT
i7 [19+1 *$SMERT.]   1 0.05 [0+1 *$SMERT.] 0.03						  0.05       0.05          0.05

}
;delayke combos dolog
i8 0 9.2 -4 9 10 2 14 0.95

;tiemstercs
i9 109 3 1 10 3
i9 + 10 3 10 6
i9 + 14 6 10 -2
i9 + 15 2 10 0.50
i9 + 10 5 10 0.25
i9 + 10 15 10 20


;picth and tiemstercs
i10 149 7 3 
i10 + 7 5
i10 + 7 15 
i10 + 7 50 
i10 + 7 20
i10 + 7 30
i10 + 7 70

e 


</CsScore>
</CsoundSynthesizer> 

<bsbPanel>
 <label>Widgets</label>
 <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>
  <b>255</b>
 </bgcolor>
</bsbPanel>
<bsbPresets>
</bsbPresets>
