;------------------------------------------------------------------------------------------------------------ ; The Onslaught ; ; COSC 4P98 ; Assignment 2 Part 2 ; Michael Smith ; 2706844 ; March 18, 2007 ; Version 1.0 ;------------------------------------------------------------------------------------------------------------ ; Header Section: sr = 44100 ; sample rate kr = 4410 ; control rate ksmps = 10 ; sr/kr nchnls = 2 ; number of channels ( 1 = mono, 2 = stereo ) ;------------------------------------------------------------------------------------------------------------ ; Instrument Section: ; Output Opcode Arguments ; e.g. a1 oscil 1000 (amp), 440(freq), function(s)... ;------------------------------------------------------------------------------------------------------------ ; Instrument to loop a guitar riff. Linear movement of amplitude. instr 1 ibas = 440 ; Base frequency ( must set here if not defined in file somehow ) ( value of 1 uses file default ) imod1 = 1 ; Loop whole file. amp1 linen p4, p7, p3, p8 ; moving linearly over time to full amplitude. achan1, achan2 loscil amp1, p5, p6, ibas, imod1 outs achan1, achan2 ; Send to both channels ( stereo ). endin ;------------------------------------------------------------------------------------------------------------ ; Instrument to loop a guitar riff or other source based on a grain synthesis to distort it. instr 2 ibas = 440 ; Base frequency ( must set here if not defined in file somehow ) ( value of 1 uses file default ) imod1 = 1 ; Loop whole file. amp1 linen p4, p7, p3, p8 ; moving linearly over time to full amplitude. agrain1 grain amp1, p5 / 4, 25, 200, 5, 1.5, 1, 3, 1 achan1, achan2 loscil agrain1, p5, p6, ibas, imod1 outs achan1, achan2 ; Send to both channels ( stereo ). endin ;------------------------------------------------------------------------------------------------------------ ; Instrument to loop a guitar riff. Linear movement of amplitude and frequency. instr 10 ibas = 440 ; Base frequency ( must set here if not defined in file somehow ) ( value of 1 uses file default ) imod1 = 1 ; Loop whole file. amp1 linen p4, p7, p3, p8 ; moving linearly over time to full amplitude. kfreq1 linen p5, p9, p3, p10 ; moving linearly over time to full frequency. achan1, achan2 loscil amp1, kfreq1, p6, ibas, imod1 outs achan1, achan2 ; Send to both channels ( stereo ). endin ;------------------------------------------------------------------------------------------------------------ ; Instrument to control a war-battle scream. instr 3 ibas = 440 ; Base frequency ( must set here if not defined in file somehow ) ( value of 1 uses file default ) imod1 = 0 ; No looping. achan1, achan2 loscil p4, p5, p6, ibas, imod1 outs achan1, achan2 ; Send to both channels ( stereo ). endin ;------------------------------------------------------------------------------------------------------------ ; Instrument to give a feeling of wind blowing. This is a highly modified version of an instrument found on a reference site to get started. ; Reference for idea on how to do wind: http://csounds.com/mikelson/ instr 4 iduration = p3 iamptable = p4 ifreq1table = p5 ifreq2table = p6 ipantable = p7 iampdivisor = p8 kamplitude oscil 1 / iampdivisor, 1 / iduration, iamptable kfreq1 oscil 1 / iampdivisor, 1 / iduration, ifreq1table kfreq2 oscil 1 / iampdivisor, 1 / iduration, ifreq2table kpan oscil 1 / iampdivisor, 1 / iduration, ipantable anoise rand kamplitude aresonant1 reson anoise, kfreq1, kfreq1 / 20 aresonant2 reson anoise, kfreq2, kfreq2 / 2 abalance1 balance aresonant1, anoise abalance2 balance aresonant2, anoise outs ( abalance1 + abalance2 ) * kpan, ( abalance1 + abalance2 ) * ( 1 - kpan ) endin ;------------------------------------------------------------------------------------------------------------