' "Three Orchids" by Phill Niblock - automaton version 'to do 2012: orgels vervangen door nieuwe kopers ' transponeren naar lagere oktaven -> done ' 2013: vraag van Phill: plaatsen zonder zwevingendirtier maken.. ' %o_bono = 16 %o_korn = 17 %o_so = 18 %o_Heli = 19 %o_huma = 20 %o_krum = 21 %o_bourd = 22 %o_Qt = 23 %O_Ob = 24 '%O_piper = 24 %O_Sire = 25 %o_einde = 27 %o2_bono = 32 %o2_korn = 33 %o2_so = 34 %o2_Heli = 35 %o2_bourd = 36 %o2_Qt = 37 %o2_Fa = 38 %o2_Klar = 39 %o2_Ob = 40 '%o2_piper = 24 %o2_Sax = 41 %o2_einde = 42 GLOBAL activetaskcount AS LONG FUNCTION init_orchid AS LONG LOCAL i AS LONG ' OLD tasks pre 2012.. ' 'Tasks in order of voices in score ' Task(%o_Bono).naam = "Bono" ' Task(%o_Bono).cptr = CODEPTR(O_Bono) ' ' Task(%o_Korn).naam = "Korn" ' Task(%o_Korn).cptr = CODEPTR(O_Korn) ' ' Task(%o_So).naam = "So" ' Task(%o_So).cptr = CODEPTR(O_So) ' ' Task(%o_Heli).naam = "Heli" ' Task(%o_Heli).cptr = CODEPTR(O_Heli) ' ' Task(%o_huma).naam = "Humanola" '-> vervangen door piper? ' Task(%o_huma).cptr = CODEPTR(O_Huma) ' ' Task(%o_Krum).naam = "Krum" ' Task(%o_Krum).cptr = CODEPTR(O_Krum) ' ' Task(%o_bourd).naam = "Bourdonola" ' Task(%o_bourd).cptr = CODEPTR(O_bourd) ' ' Task(%o_Qt).naam = "Qt" ' Task(%o_Qt).cptr = CODEPTR(O_Qt) ' '' Task(%o_piper).naam = "Piperola" '-> vervangen door ob? dan kan piperola ipv humanola.. '' Task(%o_piper).cptr = CODEPTR(O_piper) ' ' Task(%o_Ob).naam = "Ob" '-> vervangen door ob? dan kan piperola ipv humanola.. ' Task(%o_Ob).cptr = CODEPTR(O_Ob) ' ' Task(%o_Sire).naam = "Sire" ' Task(%o_Sire).cptr = CODEPTR(O_Sire) ' ' Task(%o_einde).naam = "einde" ' Task(%o_einde).cptr = CODEPTR(Orchids_finnish) ' Task(%o_einde).freq = 32 '8 speed up for debug.. ' TaskEx(%o_einde).StopCptr = CODEPTR(MM_AllOff) ' 'Tasks in order of voices in score Task(%o2_Bono).naam = "Bono" Task(%o2_Bono).cptr = CODEPTR(O_Bono) Task(%o2_Korn).naam = "Korn" Task(%o2_Korn).cptr = CODEPTR(O_Korn) Task(%o2_So).naam = "So" Task(%o2_So).cptr = CODEPTR(O_So) Task(%o2_Heli).naam = "Heli" Task(%o2_Heli).cptr = CODEPTR(O_Heli) Task(%o2_bourd).naam = "Bourdonola" Task(%o2_bourd).cptr = CODEPTR(O_Bourd_New) 'derive from old humanola Task(%o2_Qt).naam = "Qt" Task(%o2_Qt).cptr = CODEPTR(O_Qt_New) 'derive from old krum Task(%o2_Fa).naam = "Fa" Task(%o2_Fa).cptr = CODEPTR(O_Fa) 'derive from old bourdonola Task(%o2_Klar).naam = "Klar" Task(%o2_Klar).cptr = CODEPTR(O_Klar) 'derive from old qt ' Task(%o2_piper).naam = "Piperola" '-> vervangen door ob? dan kan piperola ipv humanola.. ' Task(%o2_piper).cptr = CODEPTR(O_piper) Task(%o2_Ob).naam = "Ob" '-> vervangen door ob? dan kan piperola ipv humanola.. Task(%o2_Ob).cptr = CODEPTR(O_Ob) Task(%o2_Sax).naam = "Sax" Task(%o2_Sax).cptr = CODEPTR(O_Sax) 'derive from old sire FOR i = %o_Bono TO %o_sire task(i).freq = 8 'keep it rather fast for modulations.. task(i + 16).freq = 8 'keep it rather fast for modulations.. NEXT Task(%o2_einde).naam = "einde" Task(%o2_einde).cptr = CODEPTR(Orchids_finnish) Task(%o2_einde).freq = 5 '7 '32 '8 speed up for debug.. TaskEx(%o2_einde).StopCptr = CODEPTR(MM_AllOff) FOR i = LBOUND(ButnOs) TO UBOUND(ButnOs) ButnOs(i).tag=" " ButnSw(i).tag0="" ButnSw(i).tag1="" NEXT ButnOs(1).tag = "&Start" ButnOs(1).cptr = CODEPTR(O_StartTasks) ButnOS(4).tag = "PrgChange" ButnOS(4).cptr = CODEPTR(MM_PRogChangeWindow) Init_mm MM_PanicButtonWindow "", 0, 10, 1 'iit motors that need some time to speed up here.. ' MM_Humanola_On %MM_Wind OR %MM_Motor ' MM_Krum_On %MM_Wind OR %MM_Motor MM_Bourdonola_On %MM_Wind OR %MM_Motor ' MM_Piperola_On %MM_Wind OR %MM_Motor MM_Qt_On %MM_Wind OR %MM_Motor MM_Heli_On Warning "Phill Niblock - 3 Orchids" Warning "Don't start tasks manually - use the Start button" FUNCTION = 1 END FUNCTION SUB O_StartTasks LOCAL i AS LONG FOR i = %o2_Bono TO %o2_sax StartTask i INCR ActiveTaskCount NEXT END SUB MACRO EndTask(nr) logfile "end" + STR$(nr) StopTask nr StopTask nr + 16 DECR ActiveTaskCount IF ISFALSE ActiveTaskCount THEN logfile "einde" + STR$(%o_einde): StartTask %o2_einde END MACRO SUB O_bono 'task '8 tiks per seconde '1 minuut voor elke note STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG'timing of .. IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 71, 71.0625, 71.0625, 71.125, 71.125, 71.1875, 71.1875, 71.25, 71.25, 71.1875, 71.125, 71.0625, 71.0625, 71, 70, 70.0625, 70.0625, 70, 70, 70, 70, 70, 70 init = 1 Controller Bono.channel, 7, 1 'om in te faden Controller Bono.channel, 1, 80 'wind - moet hoog volgens de docs.. Controller Bono.channel, 17, 100 'attack level Controller Bono.channel, 18, 0 'attack duration - we actually don't want attacks here.. Controller Bono.channel, 13, 0 Controller Bono.channel, 20, 0 Bend Bono.channel, 0, 64 ' lsb msb!! controller Bono.channel, 7, 1 AddNote2Har Bono.Har(1), note(0), 20 InstrumPlay Bono END IF INCR ccc IF ccc/480 > UBOUND(note) THEN EndTask (%o_bono) END IF IF ccc = nextnote THEN AddNote2Har Bono.Har(1), ROUND(note(ccc/480),0), 20 InstrumPlay Bono Bend Bono.channel, 0, MAX(0, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. 'sic 127 * - multiplier never goes over .25 ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN Controller Bono.channel, 7, 3 * (ccc - nextnote) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-32) THEN 'fade out current note Controller Bono.channel, 7, 100 - 3 * (ccc - nextnote +32) END IF END SUB SUB O_Korn STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 71, 71, 71.0625, 71.0625, 71.0625,71.125, 71.125, 71.1875, 71.1875, 471.125, 71.0625, 71, 70, 70.0625, 70.0625, 70.125, 70.0625, 70.0625, 70.0625, 70, 70, 70, 70 init = 1 Controller Korn.channel, 17, 1 'when you mPlay a note with this controller zeroed, it doesn't play.. Controller Korn.channel, 18, 0 'ccc=-32 nextnote = 80 AddNote2Har Korn.Har(1), note(0), 60 InstrumPlay Korn END IF INCR ccc logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) IF (ccc/480) > UBOUND(note) THEN Endtask (%o_korn) END IF IF ccc < 33 THEN Controller Korn.channel, 17, ccc * 2 ELSE IF ccc = nextnote THEN AddNote2Har Korn.Har(1), ROUND(note(ccc/480),0), 60 InstrumPlay Korn Bend Korn.channel, 0, MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. logfile "korn bend" + STR$(MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12)))) ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN Controller Korn.channel, 17, 2 * (ccc - nextnote) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-32) THEN 'fade out current note Controller Korn.channel, 17, 65 - 2 * (ccc - nextnote +32) END IF END IF END SUB SUB O_So STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC NextNote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() =35, 35, 35, 35, 35.0625, 35.0625, 35.0625, 35.125, 35.125, 35.0625, 35, 34, 34.0625, 34.125, 34.125, 34.1875, 34.125, 34.125, 34.0625, 34.0625, 34.0625, 34, 34 Controller So.channel, 1, 30 Controller So.channel, 18, 0 Controller So.channel, 7, 1 init = 1 AddNote2Har So.Har(1), note(0), 90 InstrumPlay So END IF INCR ccc logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) IF (ccc/480) > UBOUND(note) THEN Endtask (%o_so) END IF IF ccc = nextnote THEN logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) AddNote2Har So.Har(1), ROUND(note(ccc/480),0), 90 InstrumPlay So Bend So.channel, 0, MAX(0, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. 'sic 127 * - multiplier never goes over .25 ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN logfile "so fade in" + STR$(3 * (ccc - nextnote)) Controller So.channel, 7, 3 * (ccc - nextnote) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future logfile "so enter steady state" nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-32) THEN 'fade out current note logfile "so fade out" + STR$(100 - 3 * (ccc - nextnote +32) ) Controller So.channel, 7, 100 - 3 * (ccc - nextnote +32) END IF END SUB SUB O_Heli 'was bako.. maar heli kan de nodige pitchbends doen.. STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC NextNote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 35, 35, 35, 35, 35, 35.0625, 35.0625, 35.0625, 34, 34.0625, 34.125, 34.125, 34.1875, 34.1875, 34.25, 34.1875, 34.1875, 34.125, 34.125, 34.0625, 34.0625, 34 ' Controller Bako.channel, 1, 60 ' Controller Bako.channel, 7, 5 'to be used for fade in and out Controller Heli.channel, 17, 1 Controller Heli.channel, 18, 0 '80 Controller Heli.channel, 19, 110 Controller Heli.channel, 7, 64 ' nextnote = 33 AddNote2Har Heli.Har(1), note(0), 127 InstrumPlay Heli init = 1 END IF INCR ccc logfile STR$(ccc) + STR$(nextnote) + STR$(nextnote - 33) IF (ccc/480) > UBOUND(note) THEN EndTask (%o_Heli) END IF IF ccc = nextnote THEN logfile "heli note" AddNote2Har Heli.Har(1), ROUND(note(ccc/480),0), 127 InstrumPlay Heli Bend Heli.channel, 0, MAX(0, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN logfile "heli fade in" + STR$((3.7 * (ccc - nextnote))/3) Controller Heli.channel, 17, MAX(1, (3.7 * (ccc - nextnote))/3) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-33) THEN 'fade out current note logfile "Heli fade out" + STR$((123 - 3.7 * ( ccc - nextnote +33))/3) Controller Heli.channel, 17, MAX(1, (123 - 3.7 * ( ccc - nextnote +33))/3) END IF END SUB SUB O_Huma 'heeft een stem zonder pitchbends.. 'aangezien huma niet acht kan inzetten gaan we maar voor legato's STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 46, 46, 46 init = 1 END IF INCR ccc IF (ccc/480) > UBOUND(note) THEN EndTask (%o_huma) END IF IF ccc > nextnote THEN AddNote2Har Humanola.Har(1), note(ccc/480), 1 'kan nog zelfde zijn - dan blijft ze doorklinken - op deze manier hebben we wel de gewilde ritmische variatie: stem zal niet precies op miute bounds komen InstrumPlay Humanola nextnote = ccc + (15 + RND * 10) * 8 END IF END SUB SUB O_Krum 'heeft ook geen pitchbends STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 59, 59, 59, 59, 59, 59, 59, 59, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58 init = 1 END IF INCR ccc IF (ccc/480) > UBOUND(note) THEN EndTask (%O_krum) END IF IF ccc > nextnote THEN AddNote2Har Krum.Har(1), note(ccc/480), 1 InstrumPlay Krum nextnote = ccc + (20 + RND * 10) * 8 END IF END SUB SUB O_Bourd STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC NextNote AS LONG LOCAL w AS BYTE IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 47, 47, 47, 47, 47, 47, 46.9375, 46.9375, 46.9375, 46, 45.9375, 45.875, 45.875, 45.8125, 45.8125, 45.75, 45.8125, 45.8125, 45.875, 45.875, 45.9375, 45.9375, 46 init = 1 END IF INCR ccc ' !to check: wind influence IF (Ccc/480) > UBOUND(note) THEN EndTask (%o_bourd) END IF 'maybe we should make rests for the wind to find it's goal.. otherwise we get small glissando's - but maybe that's no problem IF ccc > nextnote THEN logfile FUNCNAME$ + STR$(ccc) AddNote2Har Bourdonola.Har(1), CEIL(note(ccc/480)), 100 InstrumPlay Bourdonola SELECT CASE note(ccc/480) CASE 46, 47: w = %MM_Bourdonola_Motor CASE 46.9375: w = 59 CASE 45.9375: w = 81 CASE 45.875: w = 69 CASE 45.8125: w = 56 CASE 45.75: w = 48 CASE ELSE: Warning "wind error in " + FUNCNAME$ + STR$(note(ccc/480)) END SELECT controller Bourdonola.channel, 1, w nextnote = ccc + (15 + RND * 10) * 8 END IF END SUB SUB O_Qt STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC NextNote AS LONG LOCAL w AS BYTE IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 47, 47, 47, 47, 46.9375, 46.9375, 46.9375, 46.875, 46.875, 46.9375, 47, 46, 45.937, 45.875, 45.875, 45.8125, 45.875, 45.875, 45.9375, 45.9375, 46 init = 1 END IF INCR ccc ' !to check: wind influence IF (Ccc/480) > UBOUND(note) THEN EndTask (%o_Qt) END IF IF ccc > nextnote THEN logfile FUNCNAME$ + STR$(ccc) AddNote2Har Qt.Har(1), CEIL(note(ccc/480)), 100 AddNote2Har Qt.Har(1), CEIL(note(ccc/480)) + 12, 100 'experiment: add octave in organs InstrumPlay Qt SELECT CASE note(ccc/480) CASE 46, 47: w=%MM_QT_Motor CASE 46.9375: w = 91 CASE 46.875: w = 69 CASE 46.8125: w = 56 CASE 45.9375: w = 66 CASE 45.875: w = 56 END SELECT Controller Qt.channel, 7, w nextnote = ccc + (20 + RND * 10) * 8 END IF END SUB 'SUB O_Piper ' - vervangen door ob? ' 'hier kan pitchbend alleen met winddruk.. ' STATIC note() AS CURRENCY ' STATIC init AS LONG ' STATIC ccc AS LONG ' STATIC NextNote AS LONG ' LOCAL w AS BYTE ' IF ISFALSE init THEN ' DIM note(22) ' ARRAY ASSIGN note() = 71, 71, 70.9375, 70.9375, 70.9375, 70.875, 70.875, 70.8125, 70.8125, 70.875, 70.9375, 71, 70, 69.9375, 69.9375, 69.875, 69.9375, 69.9375, 69.9375, 70, 70, 70, 70 ' init = 1 ' END IF ' INCR ccc ' ' !to do : wind invloed checken ' IF (Ccc/480) > UBOUND(note) THEN ' EndTask (%o_piper) ' END IF ' IF ccc > nextnote THEN ' AddNote2Har Piperola.Har(1), CEIL(note(ccc/480)), 100 ' InstrumPlay Piperola ' SELECT CASE note(ccc/480) ' CASE 71, 70: w = %MM_Piperola_Motor ' CASE 70.9375: w = 71 ' CASE 70.875: w = 59 ' CASE 70.8125: w = 52 ' CASE 69.9375: w = 68 ' CASE 69.875: w = 82 ' END SELECT ' Controller Piperola.channel, 7, w ' logfile FUNCNAME$ + STR$(ccc) + STR$(w) ' nextnote = ccc + (20 + RND * 15) * 8 ' END IF 'END SUB ' IF ccc = nextnote THEN ' logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) ' AddNote2Har So.Har(1), ROUND(note(ccc/480),0), 60 ' InstrumPlay So ' Bend So.channel, 0, MAX(0, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*9))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. ' 'sic 127 * - multiplier never goes over .25 ' ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN ' logfile "so fade in" + STR$(3 * (ccc - nextnote)) ' Controller So.channel, 7, 3 * (ccc - nextnote) 'fade in ' ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future ' logfile "so enter steady state" ' nextnote = ccc + (20 + RND * 10) * 8 ' ELSEIF ccc >= (nextnote-32) THEN 'fade out current note ' logfile "so fade out" + STR$(100 - 3 * (ccc - nextnote +32) ) ' Controller So.channel, 7, 100 - 3 * (ccc - nextnote +32) ' END IF SUB O_Ob STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC NextNote AS LONG LOCAL w AS BYTE IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 71, 71, 70.9375, 70.9375, 70.9375, 70.875, 70.875, 70.8125, 70.8125, 70.875, 70.9375, 71, 70, 69.9375, 69.9375, 69.875, 69.9375, 69.9375, 69.9375, 70, 70, 70, 70 AddNote2Har Ob.Har(1), note(0), 100 Controller Ob.channel, 17, 1 Controller Ob.channel, 18, 0 InstrumPlay Ob ' nextnote = -33 init = 1 END IF INCR ccc logfile STR$(ccc) + STR$(nextnote) IF (ccc/480) > UBOUND(note) THEN EndTask (%o_Ob) END IF IF ccc = nextnote THEN logfile "Ob note" AddNote2Har Ob.Har(1), ROUND(note(ccc/480),0), 100 InstrumPlay Ob Bend Ob.channel, 0, MAX(0, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN logfile "Ob fade in" + STR$((3.7 * (ccc - nextnote))/3) Controller Ob.channel, 17, (3.7 * (ccc - nextnote))/3 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 logfile "ob set next stop "+ STR$(nextnote) ELSEIF ccc >= (nextnote-33) THEN 'fade out current note logfile "Ob fade out" + STR$((127 - 3.7 * (ccc - nextnote +33))/2) Controller Ob.channel, 17, (127 - 3.7 * (ccc - nextnote +33))/3 END IF END SUB SUB O_Sire STATIC note() AS SINGLE STATIC init AS LONG STATIC ccc AS LONG STATIC NextNote AS LONG LOCAL RES AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 71, 70.9375, 70.9375, 70.875, 70.875, 70.8125, 70.8125, 70.75, 70.75, 70.8125, 70.875, 70.9375, 70.9375, 71, 70, 96.9375, 69.9375, 70, 70, 70, 70, 70, 70 init = 1 END IF INCR ccc IF (ccc/480) > UBOUND(note) THEN EndTask (%o_sire) END IF logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) 'velocity and pitch are coupled, so we gliss a bit around.. IF ccc >= nextnote THEN logfile FUNCNAME$ + STR$(ccc) 'we mPlay on 3 fixed sirens.. we could consider legatissimo. as an alternative logfile " note" + STR$(note(ccc/480)) RES = Sire_Play (note(ccc/480) + RND/8,1,0) logfile "res" + STR$(RES) Sire_Play note(ccc/480) + RND/8,1,8 Sire_Play note(ccc/480) + RND/8,1,16 nextnote = ccc + (20 + RND * 10) * 8 END IF END SUB SUB Orchids_Finnish STATIC ccc AS LONG INCR ccc logfile FUNCNAME$ + STR$(ccc) + STR$(TIMER ) + STR$(task(%o2_einde).freq) IF ccc = 120 THEN MM_AllOff: StopTask %o2_einde IF ccc = 80 THEN MM_Bourdonola_off %MM_Notes MM_Qt_Off %MM_Notes MM_Bono_Off %MM_Notes MM_Korn_Off %MM_Notes MM_So_Off %MM_Notes MM_Heli_Off %MM_Notes MM_Fa_Off %MM_Notes MM_Klar_Off %MM_Notes MM_Autosax_Off %MM_Notes MM_Ob_Off %MM_Notes END IF IF ccc > 80 THEN EXIT SUB Controller Bono.channel, 7, 100 - ccc * 1.125 Controller Korn.channel, 17, 64 - ccc * .8 'Controller Bako.channel, 7, 123 - ccc * 1.5375 Controller So.channel, 7, 100 - ccc* 1.125 Controller Heli.channel, 17, MAX(0, 123 - ccc * 1.58) Controller Fa.channel, 7, 100 - ccc * 1.125 Controller Klar.channel, 7, 100 - ccc * 1.125 Controller AutoSax.channel, 17, 64 - ccc * .8 Controller Ob.channel, 17, 64 - ccc * .8 END SUB 'nieuwe taken 2012 SUB O_Bourd_New 'heeft een stem zonder pitchbends.. 'aangezien huma niet acht kan inzetten gaan we maar voor legato's STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 46, 46, 46 MM_Bourdonola_On %MM_Wind OR %MM_Motor init = 1 END IF INCR ccc IF (ccc/480) > UBOUND(note) THEN EndTask (%o2_bourd) END IF IF ccc > nextnote THEN AddNote2Har Bourdonola.Har(1), note(ccc/480), 1 'kan nog zelfde zijn - dan blijft ze doorklinken - op deze manier hebben we wel de gewilde ritmische variatie: stem zal niet precies op miute bounds komen AddNote2Har Bourdonola.Har(1), note(ccc/480) + 12, 1 'kan nog zelfde zijn - dan blijft ze doorklinken - op deze manier hebben we wel de gewilde ritmische variatie: stem zal niet precies op miute bounds komen InstrumPlay Bourdonola nextnote = ccc + (15 + RND * 10) * 8 END IF END SUB SUB O_Qt_new 'heeft ook geen pitchbends STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG IF ISFALSE init THEN DIM note(22) ' ARRAY ASSIGN note() = 59, 59, 59, 59, 59, 59, 59, 59, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58 ARRAY ASSIGN note() = 47, 47, 47, 47, 47, 47, 47, 47, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46 MM_Qt_On %MM_Wind OR %MM_Motor init = 1 END IF INCR ccc IF (ccc/480) > UBOUND(note) THEN EndTask (%O2_Qt) END IF IF ccc > nextnote THEN AddNote2Har Qt.Har(1), note(ccc/480), 1 InstrumPlay Qt nextnote = ccc + (20 + RND * 10) * 8 END IF END SUB SUB O_Fa STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 47, 47, 47, 47, 47, 47, 46.9375, 46.9375, 46.9375, 46, 45.9375, 45.875, 45.875, 45.8125, 45.8125, 45.75, 45.8125, 45.8125, 45.875, 45.875, 45.9375, 45.9375, 46 init = 1 Controller fa.channel, 66, 0 'for ctrl reset SLEEP 1 Controller Fa.channel, 66, 127 Controller Fa.channel, 7, 1 'when you mPlay a note with this controller zeroed, it doesn't play.. Controller Fa.channel, 18, 0 'ccc=-32 AddNote2Har Fa.Har(1), note(0), 100 InstrumPlay Fa END IF INCR ccc logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) IF (ccc/480) > UBOUND(note) THEN Endtask (%o2_Fa) END IF IF ccc = nextnote THEN AddNote2Har Fa.Har(1), ROUND(note(ccc/480),0), 100 InstrumPlay Fa Bend Fa.channel, 0, MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. ' logfile "korn bend" + STR$(MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*9)))) ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN Controller Fa.channel, 7, 3 * (ccc - nextnote) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-32) THEN 'fade out current note Controller Fa.channel, 7, 100 - 2.9 * (ccc - nextnote +32) END IF END SUB SUB O_Klar STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG LOCAL i AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 47, 47, 47, 47, 46.9375, 46.9375, 46.9375, 46.875, 46.875, 46.9375, 47, 46, 45.937, 45.875, 45.875, 45.8125, 45.875, 45.875, 45.9375, 45.9375, 46 FOR i = LBOUND(note) TO UBOUND(note): note(i) = note(i) + 12: NEXT init = 1 Controller Klar.channel, 66, 0 'for ctrl reset SLEEP 1 Controller Klar.channel, 66, 127 Controller Klar.channel, 17, 127 Controller Klar.channel, 7, 1 'when you mPlay a note with this controller zeroed, it doesn't play.. Controller Klar.channel, 18, 0 'ccc=-32 AddNote2Har Klar.Har(1), note(0), 127 InstrumPlay Klar END IF INCR ccc logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) IF (ccc/480) > UBOUND(note) THEN Endtask (%o2_Klar) END IF IF ccc = nextnote THEN AddNote2Har Klar.Har(1), ROUND(note(ccc/480),0), 127 InstrumPlay Klar Bend Fa.channel, 0, MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. ' logfile "korn bend" + STR$(MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*9)))) ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN Controller Klar.channel, 7, 3 * (ccc - nextnote) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-32) THEN 'fade out current note Controller Klar.channel, 7, 100 - 2.9 * (ccc - nextnote +32) END IF END SUB SUB O_Sax STATIC note() AS CURRENCY STATIC init AS LONG STATIC ccc AS LONG STATIC nextnote AS LONG LOCAL i AS LONG IF ISFALSE init THEN DIM note(22) ARRAY ASSIGN note() = 35, 34.9375, 34.9375, 34.875, 34.875, 34.8125, 34.8125, 34.75, 34.75, 34.8125, 34.875, 34.9375, 34.9375, 35, 34, 33.9375, 33.9375, 34, 34, 34, 34, 34, 34 FOR i = LBOUND(note) TO UBOUND(note): note(i) = note(i) + 12: NEXT init = 1 Controller AutoSax.channel, 65, 0 Controller Autosax.channel, 7, 100 Controller AutoSax.channel, 17, 1 'when you mPlay a note with this controller zeroed, it doesn't play.. Controller AutoSax.channel, 18, 0 'ccc=-32 nextnote = 100 AddNote2Har autoSax.Har(1), note(0), 70 InstrumPlay AutoSax END IF INCR ccc logfile FUNCNAME$ + STR$(ccc) + STR$(nextnote) IF (ccc/480) > UBOUND(note) THEN Endtask (%o2_sax) END IF IF ccc < 33 THEN Controller Autosax.channel, 17, ccc * 2 ELSE IF ccc = nextnote THEN AddNote2Har Autosax.Har(1), ROUND(note(ccc/480),0), 70 InstrumPlay AutoSax Bend Autosax.channel, 0, MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*12))) 'bankers rounding, but that doesn't matter as we know there's no exact x.5.. ' logfile "korn bend" + STR$(MAX(1, MIN(127, 64 + 127 * (note(ccc/480) - ROUND(note(ccc/480),0)) -4 + INT(RND*9)))) ELSEIF (ccc > nextnote) AND (ccc< (nextnote + 32)) THEN Controller Autosax.channel, 17, 2 * (ccc - nextnote) 'fade in ELSEIF ccc = (nextnote + 32) THEN 'schedule next nte some 20 a 30" in the future nextnote = ccc + (20 + RND * 10) * 8 ELSEIF ccc >= (nextnote-32) THEN 'fade out current note Controller Autosax.channel, 17, 65 - 2 * (ccc - nextnote +32) END IF END IF END SUB