' ************************************************************** ' * * ' * by * ' * Godfried-Willem Raes * ' ************************************************************** ' include file for TransiTrance - context GMT / Technofaustus ' kompositieopdracht Leuven Transit Festival 02.10.2005 ' met steun van de Vlaamse Gemeenschap ' ************************************************************** ' INTERACTION: SONAR or RADAR, PicRADAR 0,1, CQT ' 02.07.2005: conceptional start ' idea: use composition objects which inherit real time properties ' from gesture and/or acoustic inputs. ' comments: http://www.logosfoundation.org/scores_gwr/trance.html ' Orchestration: ' essential robots: ' tuned in equal temperament: ' ' ' ' ' ' ' ' ' ' quartertone instruments: ' ' ' microtonal robot instruments: ' ' ' ' ' non pitched: ' ' Optional robots: ' ' ' ' Not used in this composition: ' , , , ' Interfaces: ' radar interfaces (Picrada) or sonar or quadrada, CQT ' PicRad(0) = Belly control in vacca object ' PicRad(1) = Hurdy control in Hurdy object ' live musicians (Optional) : PIC-Theremin, nude dancers (2 or 3), viola ' NOTE: for debugging define %TransiTrance_Debug here. ' 16.07.2005: start coding ' 18.07.2005: test vacca & metals object ' 19.07.2005: Quadrada implemented for gesture interaction in the square setup ' 23.07.2005: Trancetype added as global ' 24.07.2005: test within quadrada context ' 25.07.2005: gesture data analysis: torsion and muscle tension ' 11.08.2005: debug session ' 13.08.2005: Chord object added - debug session ' sofar uses: Bourdonola, Piperola, Trump, Humanola, Vibi, Ake, Puff, Llor, Belly, Tubi, Klung, Piano, Harma, Vacca ' to do: Hurdy, Sire, Dripper, Troms, Thunderwood, Rotomoton, Flex, Casta ' 14.08.2005: SpectralNoteF function in g_mus modified slightly. (modulation spectra implementation) ' Sireobject added. ' 15.08.2005: Belly mapped on Picra A ' to do: Hurdy object ' Percussion object (Troms, ThunderWood, Casta, Piperperc, Rotomoton) ' 16.08.2005: First try out with gwr in all roles. ' Note for setup: Picrad(0) = Picra A should be place in front of belly and controlled by Faust ' during the Vacca object. ' Quadrada takes up movement from mefisto. ' Picrad(1) = on the right of the stage should control the slides-object. ' it is controlled by Homunkulus. ' 22.08.2005: Ake object added ' 23.08.2005: debug ake object. ' 27.08.2005: harmonic structure changed. ' ending changed. ' 28.08.2005: rewrite and composing session. ' cqt listen added for audiofeedback to real audio context. ' 29.08.2005: piano object added. ' Hurdy object now function of amplitude and speed of gesture seen by RadPic(1) ' ending automated now. ' 03.09.2005: debug and practice session ' 04.09.2005: Progchange added to secure coding against previous app's... ' 05.09.2005: debug session on new spectral functions in g_mus.dll ' 13.09.2005: Harmony library split: g_mus.dll and g_har.dll now. ' 14.09.2005: new tests with Llor (new steering procedure) ' Rehearsal session. ' 15.09.2005: piano pedal control added. ' 16.09.2005: teveel aan Llor weggewerkt in spectral object ' 17.09.2005: try out and rehearsal sessions without (pipes are out for tuning) ' piano chords in vacca object modified. ' 18.09.2005: rehearsal session, with Hurdy. ' slierten voor vibi toegevoegd. ' 22.09.2005: intonatie en stemming trump. Is nu weer helemaal o.k. ' 24.09.2005: rehearsal with Moniek. ' 28.09.2005: rehearsal session with Kristof and Moniek. ' 29.09.2005: bug in ake object: no note off at end... ' 30.09.2005: Sire lights added. (Hardware and software) ' Belly terug gevoeligheid opgedreven. ' 02.10.2005: premiere Leuven - Transit Festival - met weggecensureerde Emilie rol. ' 08.10.2005: Harma toegevoegd in globhar. ' 09.10.2005: Extra harma partij getest en goed bevonden. ' 11.10.2005: Versie tot nu toe gesaved als 'TransiTrance.inc' ' Stuk gaat voortaan door het leven als 'Trance'. De source file is Trance.inc. ' 04.12.2005: adapted for new Harma hardware ' 24.04.2006: consideration to add ' 13.09.2006: adapted to new M&M hardware. ' further revision required because of pitch mapping implementation change on Belly ' 15.09.2006: Belly coding adapted to new hardware and steering ' 21.01.2008: checked with new harmlibs. ' 15.04.2009: Checked again. Works only with the quadrada setup!!! ' Mapping with sonar is still to be worked out! ' 11.06.2009: recheched for sonar_radar flag. %TRance_Test = 63 ' for test and debug of real time spectral harmony functions. DECLARE FUNCTION Faust_Init_Trance () AS LONG DECLARE SUB Trance_ButnSW_StartStop () DECLARE SUB Faust_Trance_Glob () ' background spectral harmony context DECLARE SUB Faust_Trance_Vacca () ' object 1: metal sounds: Vacca, Llor, Belly DECLARE SUB Trance_Vacca_Object_Start () ' ctrl: FAUST DECLARE SUB Faust_Trance_Spectra () ' object 2: ctrl: MEFISTO - gesture controlled spectra ' in global context: microtonal DECLARE SUB Faust_Trance_Chords () ' object 3 : pitched tutti ( > 660%%) DECLARE SUB Faust_Trance_Chords_Stop () DECLARE SUB Faust_Trance_Sire () ' object 4 - CTRL: WAGNER DECLARE SUB Faust_Trance_Sire_Stop () DECLARE SUB Faust_Trance_Hurdy () ' object 5 - CTRL: HELENA DECLARE SUB Faust_Trance_Hurdy_Stop () DECLARE SUB Faust_Trance_Slides () ' object 6 - slierten - CTRL: HOMUNKULUS DECLARE SUB Faust_Trance_SlVibi () ' object 7 - slierten voor vibi DECLARE SUB Faust_Trance_Ake () ' object 8 - alternative for slierten - Ake only DECLARE SUB Faust_Trance_Ake_Stop () ' DECLARE SUB Faust_Trance_Casta () ' object 9 DECLARE SUB Faust_Trance_Piano () ' object 10 - uses CQT input DECLARE SUB Faust_Trance_Piano_Stop () DECLARE SUB Faust_Trance_End () ' object 11 - spektrale slotkadens DECLARE SUB Trance_Test () ' test and debug procs. for new spectral functions in g_mus.dll FUNCTION Faust_Init_Trance () AS LONG LOCAL m AS ASCIIZ * 40 LOCAL i AS INTEGER LOCAL transCnt AS DWORD LOCAL dirCnt AS LONG LOCAL d AS LONG DIM Sp(0) AS STATIC SINGLE App.Komposduur = Read_Duration_From_File ($faustini, "Trance") ' function in g_file.dll App.Globton = %False ' reset tonal base tuning App.tempo = 60 ' added 15.04.2007, just as a safe reset. ButnSW(1).tag0 = "Start" ' start/stop toggle SetDlgItemText gh.Cockpit, %GMT_BUTNSW_ID + 1, ButnSW(1).tag0 ButnSW(1).flag = %False ' reset ButnSW(1).cptr = CODEPTR(Trance_ButnSW_StartStop) ' start / stop 'TransiTrance' ' task initialisation IF hMidiI(HIBYT(CQT.inchannel)) THEN Task(CQT.listentasknr).naam = "CQT-ear" ' 16 Task(CQT.listentasknr).freq = 100 Task(CQT.listentasknr).cptr = GetProcAddress(GetModuleHandle("g_lib.dll"),"CQT_LISTEN") ' in g_lib.dll Task(CQT.listentasknr).flags = %HARM_TASK OR %PERTIM_TASK OR %DLL_TASK #IF %DEF(%TransiTrance_Debug) IF ISFALSE Task(CQT.listentasknr).cptr THEN MSGBOX "No codeptr for midi listen",, FUNCNAME$ #ENDIF ' tasks requiring CQT: Task(%Trance_Pia).naam = "O-Piano" Task(%Trance_Pia).cptr = CODEPTR(Faust_Trance_Piano) Task(%Trance_Pia).freq = 0.33 TaskEX(%Trance_Pia).stopcptr = CODEPTR(Faust_Trance_Piano_Stop) #IF %DEF(%Transitrance_Debug) ELSE MSGBOX "No midi IN port for CQT",, FUNCNAME$ #ENDIF END IF Task(%Trance_Glob).naam = "GlobTim" Task(%Trance_Glob).cptr = CODEPTR(Faust_Trance_Glob) Task(%Trance_Glob).freq = 5 ' following task needs Picra A Task(%Trance_Vacca_Object).naam = "O-Vacca" Task(%Trance_Vacca_Object).cptr = CODEPTR(Faust_Trance_Vacca) Task(%Trance_Vacca_Object).freq = 5 TaskEX(%Trance_Vacca_Object).startcptr = CODEPTR(Trance_Vacca_Object_Start) ' following task needs Quadrada Task(%Trance_Sp).naam = "O-Spek" Task(%Trance_Sp).cptr = CODEPTR(Faust_Trance_Spectra) Task(%Trance_Sp).freq = 7 ' TaskEX(%Trance_SP).startcptr = CODEPTR(Faust_Trance_Spectra_Start) Task(%Trance_Ch).naam = "O-Chord" Task(%Trance_Ch).cptr = CODEPTR(Faust_TRance_Chords) Task(%TRance_Ch).freq = 1.5 TaskEX(%TRance_Ch).stopCptr = CODEPTR(Faust_TRance_Chords_Stop) Task(%Trance_Si).naam = "O-Sire" Task(%Trance_Si).cptr = CODEPTR(Faust_Trance_Sire) Task(%Trance_Si).freq = 2 Task(%Trance_Si).flags = %False TaskEX(%Trance_Si).stopCptr = CODEPTR(Faust_Trance_Sire_Stop) Task(%Trance_Sl).naam = "O-Slid" Task(%Trance_Sl).cptr = CODEPTR(Faust_Trance_Slides) Task(%Trance_Sl).freq = 32 Task(%Trance_SlVibi).naam = "VibiSli" Task(%Trance_SlVibi).cptr = CODEPTR(Faust_Trance_SLVibi) Task(%Trance_SlVibi).freq = 27 Task(%Trance_SlVibi).flags = %False Task(%Trance_ake).naam = "O-Ake" Task(%Trance_ake).cptr = CODEPTR(Faust_Trance_Ake) Task(%Trance_Ake).flags = %False Task(%Trance_ake).freq = 7 TaskEX(%Trance_Ake).stopcptr = CODEPTR(Faust_Trance_Ake_Stop) Task(%Trance_casta).naam = "O-Casta" Task(%Trance_casta).cptr = CODEPTR(Faust_Trance_Casta) Task(%Trance_casta).flags = %False Task(%Trance_casta).freq = 25 ' following task need Picra B Task(%Trance_Hu).naam = "O-Hurdy" Task(%Trance_Hu).cptr = CODEPTR(Faust_Trance_Hurdy) Task(%Trance_Hu).freq = 0.33 Task(%Trance_Hu).flags = %False TaskEX(%Trance_Hu).stopcptr = CODEPTR(Faust_Trance_Hurdy_Stop) ' was bug until 29.09: we had the main proc. here... Task(%Trance_end).naam = "ending" Task(%Trance_end).cptr = CODEPTR(Faust_Trance_End) Task(%Trance_End).flags = %False Task(%Trance_end).freq = 2 'TaskEX(%Trance_end).stopCptr = CODEPTR(Faust_Trance_End_Stop) Task(%Trance_Test).naam ="S-Test" Task(%Trance_Test).cptr = CODEPTR(Trance_Test) Task(%Trance_Test).freq = 2 FaustPatches "trance" ' also sets the robotports m = "" SendMessage gh.Cockpit, %WM_SETTEXT,0, VARPTR(m) SetDlgItemText gh.Cockpit, %GMT_TITLE, "" SetDlgItemText gh.Cockpit, %GMT_AUTHOR, $gwr SetDlgItemText gh.Cockpit, %GMT_MSG1, "Trance duur=" & STR$(App.Komposduur + 30) SetDlgItemText gh.Cockpit, %GMT_MSG2, " " SetDlgItemText gh.Cockpit, %GMT_TEXT_TEMPO, STR$(App.tempo) ' for PIC-Radar support: - only 2 now (picra A and picra B) DIM pRadPic(1) AS GLOBAL RadarPicController PTR 'Init picradars: FOR i = 0 TO 1 '3 '(%MaxNr of devices...) pRadPic(i) = GetPicRadarPointer (i, %Radar_listen, 256 * i + i) ' dev.nr, listentasknr, port/channel word #IF %DEF(%TRansiTrance_debug) IF ISFALSE pRadPic(i) THEN Warning "Initialization failure radpic" + STR$(i) REDIM PRESERVE pRadPic(i-1) AS GLOBAL RadarPicController PTR EXIT FOR END IF #ENDIF NEXT i Create_PicRadar_Control (Slider(), UDctrl()) ' create user interface for the PIC listen-task ' make sure vacca and piano do not use velo-rescalings: ProgChange Vacca.channel, 0 ProgChange Piano.channel, 0 ' compositional lookups: ( the Trance structure is global) ' there is no reason to do this in real time. transCnt = 1 ' transposition counter dircnt = +1 ' sign Trance.tc(0) = App.Globton Logfile "TransiTrance Logfile","Transitrance.txt" FOR i = 1 TO 18 Trance.tc(i) = (Trance.tc(i-1) + transcnt) MOD 12 transcnt = transcnt + dircnt IF transcnt = 9 THEN dircnt = -1 IF transcnt = 1 THEN dircnt = +1 ' test 10.09.2005: ' Trance.sf(i-1) = ModSpekFak(36+Trance.tc(i-1), 36+Trance.tc(i),100,Sp(),72 + MAX(Trance.tc(i-1), Trance.tc(i))) ' test 11.09.2005: [smaller ambitus, so larger spread of spectral pitches] Trance.sf(i-1) = ModSpekFak(36+Trance.tc(i-1), 36+Trance.tc(i),100,Sp(),60 + MAX(Trance.tc(i-1), Trance.tc(i))) ' Trance.sf() may be false!, in that case we can use the old algorhytm Logfile "Section " & STR$(i-1) & " tc= " & STR$(Trance.tc(i-1)) & " modspekfak= " & STR$(Trance.sf(i-1)) & $CRLF #IF %DEF(%TransiTrance_debug) IF ISFALSE Trance.sf(i-1) THEN Warning "ModSpekFak failed on " & STR$(i),10000 ' always failed before 05.09!!! ' d = ABS(Trance.tc(i-1) - Trance.tc(i)) ' IF d > 6 THEN ' IF d = 7 THEN ' Trance.sf(i-1) = %DomSpec ' ELSE ' d= 12 - d ' interval omkeren indien groter dan tritonus ' Trance.sf(i-1) = 2 ^ (d /12) ' END IF ' ELSE ' IF d = 5 THEN ' Trance.sf(i-1) = %SubDomSpec ' ELSE ' Trance.sf(i-1) = 1 / (2 ^ (d/12)) ' END IF ' END IF END IF #ENDIF NEXT i 'initialize hurdy, for the hurdy object: IF ISFALSE Hurdy.ctrl(120) THEN ReadHurdyTuningFromFile ($TECHNOFAUSTUS, Hurdy) ' for debug only: IF Hurdy.ctrl(120) <> 33 THEN MSGBOX "Error Hurdy tuning low string" IF Hurdy.ctrl(121) <> 50 THEN MSGBOX "Error Hurdy tuning high string" ' Hurdy.ctrl(120) = 33 ' low string transposes -7 (40 sounds 33) ' Hurdy.ctrl(121) = 50 ' high string transposes -14 (64 sounds 50) END IF FUNCTION = %True END FUNCTION SUB Trance_ButnSW_StartStop () LOCAL ButtonNr AS LONG LOCAL i AS DWORD LOCAL cptr AS DWORD ButtonNr = App.butnSWparam - %GMT_BUTNSW_ID IF ButnSW(Buttonnr).flag THEN SetDlgItemText gh.Cockpit, %GMT_BUTNSW_ID + ButtonNr, "STOP" App.MTstart = %True App.tstart = timegettime StartTask %Trance_Glob Promil %True Runtime %True SELECT CASE Sonar_Radar CASE 0 '%False 'Sonar_DAQ %DAQ_DOUBLEBUFFER cptr = GetProcAddress(gh.gnh, "SONAR_DAQ") CALL DWORD cptr USING Sonar_DAQ(%DAQ_DOUBLEBUFFER) CASE 1 '%True cptr = GetProcAddress(gh.gnh, "RADAR_DAQ") CALL DWORD cptr USING Radar_DAQ(%DAQ_DOUBLEBUFFER) 'Radar_DAQ %DAQ_DOUBLEBUFFER CASE 2 ' to be done: support PicRadar devices. END SELECT ELSE FOR i = 16 TO 63 IF Task(i).swit THEN StopTask i NEXT i SetDlgItemText gh.Cockpit, %GMT_BUTNSW_ID + ButtonNr, "CONT" ' cannot be continued if stopped ' remmed out 27.06.2009 ' SELECT CASE Sonar_Radar ' CASE 0 '%False ' ' Sonar_DAQ %False ' cptr = GetProcAddress(gh.gnh, "SONAR_DAQ") ' CALL DWORD cptr USING Sonar_DAQ(%false) ' CASE 1 '%True ' cptr = GetProcAddress(gh.gnh, "RADAR_DAQ") ' CALL DWORD cptr USING Radar_DAQ(%false) ' ' Radar_DAQ %False ' END SELECT MM_AllOff END IF App.butnSWparam = %False END SUB SUB Faust_Trance_Glob () ' plays and for harmonic fundament. ' second harmonic, if not an octave, on harma. - 04.10.2005 STATIC seconds AS DWORD STATIC section AS DWORD STATIC transCnt AS DWORD STATIC dirCnt AS LONG STATIC akenoot AS INTEGER STATIC Harmanoot AS INTEGER LOCAL d AS LONG ' master timing and control task.` ' control for non real time underlying compositional structure. IF ISFALSE Task(%Trance_Glob).tog THEN section = app.komposduur / 18 ' duur van elke sektie in sekonden ( bij 10' duur is dat 33" per sektie) MM_Bourdonola_On %MM_Motor OR %MM_Lights OR %MM_Wind 'Ake.ctrl(1) = %MM_Ake_Motor 'Ake.ctrl(7) = %False MM_Ake_On %MM_Wind OR %MM_Valve ' was logic error! SetDlgItemText gh.Cockpit, %GMT_MSG2, " Section=" & STR$(Trance.sectioncounter) & " Tone= " & STR$(App.globton) ' lookup added for anticipation of harmony, ' placed in init trance now: App.globton = Trance.tc(0) transcnt = 1 dircnt = +1 Trance.sectioncounter = %False mPlay Bourdonola.channel, 36 + App.Globton, 64 ' comes up slowly at start Task(%Trance_Glob).tog = %True END IF seconds = (timegettime-App.tstart) \ 1000 ' sekonden kronometer ' Trance.sectioncounter: IF Trance.sectioncounter <> seconds \ section THEN NoteOff Bourdonola.channel, 36 + App.Globton Trance.sectioncounter = seconds \ section ' 0,1,2,3,4... 17, 18 (19 sekties) App.Globton = Trance.tc(Trance.sectioncounter) ' App.Globton = (App.Globton + transcnt) MOD 12 ' verschuiving/modulatie grondtoon ' transCnt = transcnt + dircnt ' 'IF transcnt = 7 THEN dircnt = -1 ' version in first try out 16.08.2005 ' IF transcnt = 9 THEN dircnt = -1 ' in this version , the only missing notes are 62 and 67 ' IF transcnt = 1 THEN dircnt = +1 SetDlgItemText gh.Cockpit, %GMT_MSG2, " Section=" & STR$(Trance.sectioncounter) & " Tonality= " & STR$(App.globton) mPlay Bourdonola.channel, 36 + App.Globton, 64 ' redundant: Controller Ake.channel, 1, 127 END IF 'Trance.Spekfak: SELECT CASE seconds CASE < App.komposduur + 2 SELECT CASE (seconds / section) - (seconds \ section) ' 0 to 1 traject for each section CASE > 0.75 ' ' het laatste kwart van elk grondtooncyclus (ca.8.25 sekonden) ' ' wordt besteed aan voorbereiding van de modulatie. ' new function for calculation of spectral modulations: 04.09.2005: Trance.SpekFak = Trance.sf(Trance.sectioncounter) ' use lookup table containing the ' modulational spectral factors IF ISFALSE akenoot THEN IF App.Globton + 12 > 19 THEN mPlay Ake.channel, App.Globton + 12, 64 akenoot = App.Globton + 12 ELSE mPlay Ake.channel, App.Globton + 24, 64 akenoot = App.Globton + 24 END IF END IF CASE < 0.25 ' 8.25 sekonden Trance.Spekfak = %True ' stick to platonic spectrum in the traject 0-0.25 IF akenoot THEN NoteOff Ake.channel, akenoot akenoot = %False END IF CASE ELSE ' 16.5 sekonden ' trajekt 0.25 tot 0.75 ' following was a serious bug!!! spekfak was at the end even > 8, with as result that ' the number of spectral lines became reduced to 2. 'Trance.Spekfak = (1 + (seconds / section) - (seconds \ section)/ 2) ' becomes timefunction as well. ' Trance.Spekfak runs here from 1 tot 1.25 'Trance.Spekfak = 0.5 + ((seconds MOD section) / section) ' 0.5 to 1.5 ' change 11.09.2005: Trance.Spekfak = 0.6 + ((seconds MOD section) / section) ' 0.6 to 1.6 END SELECT Task(%Trance_Glob).freq = 1 + ((seconds / App.komposduur) * 3) ' sempre accellerando 1-> 4x App.Tempo = Task(%Trance_Glob).freq * 60 ' up to MM240 CASE App.komposduur + 2 ' we leave a gap before the final cadens. Trance.Spekfak = %True Task(%Trance_Glob).freq = 0.25 NoteOff Bourdonola.channel, 36 + App.Globton IF akenoot THEN NoteOff Ake.channel, akenoot : Akenoot = %False IF Harmanoot THEN Noteoff Harma.channel, harmanoot : Harmanoot = %False IF Task(%Trance_Ch).swit THEN StopTask %Trance_Ch ' stop chords object mPlay Troms.channel, 24, 127 mPlay Troms.channel, 48,127 ' cymbal CASE > App.Komposduur + 3 ' after the gap, start finale StartTask %Trance_End StopTask %Trance_Glob EXIT SUB END SELECT SetDlgItemText gh.Cockpit, %GMT_TEMPO_ID, STR$(App.Tempo) ' now also calculate the highest spectral component number that is retrievable within ' relaxed M&M robot limits: IF Trance.spekfak <> Trance.oldspekfak THEN DIM Sp(0) AS STATIC SINGLE Trance.Speklim = NumberOfSpectralComponents(24+App.Globton,25,Trance.Spekfak, Sp(), 108) Trance.oldspekfak = Trance.spekfak ' new 04.10.2005: IF (ROUND(Sp(2),0) MOD 12) <> App.Globton THEN IF Harmanoot THEN IF Harmanoot <> ROUND(Sp(2),0) THEN NoteOff Harma.channel, Harmanoot HarmaNoot = %False END IF END IF IF ISFALSE Harmanoot THEN IF Harma.ctrl(7) <> 90 THEN ProgChange Harma.channel, &B01111 Controller Harma.channel, 66, 127 Controller Harma.channel, 7, 90 : Harma.ctrl(7) = 90 ' motor on END IF Harmanoot = ROUND(Sp(2),0) mPlay Harma.channel, HarmaNoot, 120 END IF END IF END IF END SUB SUB Faust_Trance_Spectra () ' uses quartertone robots: , , equal temperament robots , ' and microtonal robots , , - interactive with gesture. [quadrada] ' emphasis on quartertone harmonies within our spectral context. ' gesture input from Mefisto. STATIC hn AS LONG ' spectral number STATIC nf AS SINGLE STATIC onfLlor AS SINGLE LOCAL velo AS WORD LOCAL v AS SINGLE LOCAL retval AS INTEGER STATIC piperolanote AS INTEGER STATIC pianonote AS INTEGER STATIC llornote AS INTEGER ' for release IF ISFALSE Task(%Trance_Sp).tog THEN MM_Piperola_On Piperola.ctrl(10) = 5 Controller Piperola.channel,10,5 ' sforzando ON - overpressure using velo-byte hn = 1 Task(%Trance_Sp).tog = %True END IF ' App.Globton , Trance.Spekfak ' following levels become functions of invisible instrument inputs: SELECT CASE Sonar_Radar CASE 0'%False ' Sonar invisible instrument v = (@sr.sx + @sr.sy + @sr.sz)/ 3 hn = @sr.xyzf / 2 CASE 1'%True ' quadrada v = MAX(@pr(0).s, @pr(1).s,@pr(2).s, @pr(3).s) hn = MAX(@pr(0).vf, @pr(1).vf, @pr(2).vf, @pr(3).vf) END SELECT ' release Llor: IF Llornote THEN release llor.channel, llornote, 120 : Llornote = %False 'velo afhankelijk van bewegingshoeveelheid velo = MIN(v, 127) hn = MIN(Trance.speklim, hn) ' limiter nf = SpectralNoteF (24 + App.Globton, hn, Trance.Spekfak, %ExpSpec) ' alle noten behoren tot de globale harmonie. IF nf THEN IF ABS(FRAC(nf) - 0.5) < 0.25 THEN ' quartertones for puff- tubi IF (nf >= 72) AND (nf <= Tubi.hightes) THEN mPlay Tubi.channel, INT(nf) - 48, velo - (velo / 3) nf = %False END IF IF (nf >= 55) AND (nf < Puff.hightes) THEN mPlay Puff.channel, INT(nf) - 48, velo * 2 / 3 '/2 nf = %False END IF ' if found, quartertones for Llor: IF nf THEN IF velo > 5 THEN IF nf <> onfLlor THEN retval = PlayLlor(nf, MIN(velo, 127),25) IF retval THEN onfLlor = nf nf = %False IF retval < Llor.lowtes + 8 THEN Llornote = retval END IF END IF END IF END IF ' if found, quartertones for Vacca: IF nf THEN IF PlayVacca (nf, velo,25) THEN nf = %False END IF END IF END IF nf = ROUND(nf,0) 'boekhouders-afronding. SELECT CASE nf CASE %False IF piperolanote THEN noteOff Piperola.channel, piperolanote : PiperolaNote = %False EXIT SUB CASE > Piperola.lowtes ' use sforzando bellows!!! IF piperolanote THEN noteoff Piperola.channel, piperolanote: Piperolanote = %False IF velo THEN IF nf =< piperola.hightes THEN mPlay Piperola.channel, nf, velo piperolanote = nf END IF END IF CASE > Piano.lowtes IF Pianonote THEN noteoff Piano.channel, pianonote: Pianonote = %False IF velo THEN IF nf < piano.hightes THEN mPlay Piano.channel, nf, velo pianonote = nf END IF END IF END SELECT END SUB SUB Faust_Trance_Vacca () ' %Trance_Vacca_Object - with auxiliary instruments: and ' here we use Trance.Spekfak to search notes for Vacca. ' based on algoritmic composition code module without user interaction. ' "An object for Vacca" in vacca.inc (as played in Ruemlingen) ' the participation of and is interactive: uses PicRa(0) device! - controlled by Faust ' Picra(0) should be setup such as not to interfere on gesture capture by Quadrada (central). STATIC cnt AS DWORD ' tick counter STATIC t0 AS DWORD ' starttime STATIC poly AS DWORD ' metric polyphony STATIC dimcnt AS DWORD ' diminuendo divider at ending LOCAL v AS SINGLE ' normalized velocity 0-1 LOCAL velo AS INTEGER STATIC n1 AS SINGLE STATIC n2 AS SINGLE STATIC n3 AS SINGLE STATIC n4 AS SINGLE STATIC n5 AS SINGLE STATIC on1 AS SINGLE STATIC on2 AS SINGLE STATIC on3 AS SINGLE STATIC on4 AS SINGLE STATIC on5 AS SINGLE STATIC endtog AS DWORD LOCAL retval AS DWORD LOCAL i AS LONG IF ISFALSE Task(%Trance_Vacca_Object).tog THEN poly = 1 t0 = timegettime cnt = 1 '0 Task(%Trance_Vacca_Object).level = 10 Task(%Trance_Vacca_Object).freq = 4 retval = PlayVacca (45 + App.Globton, 64, 25) n1 = Vacca.hightes n2 = Vacca.hightes - 6 n3 = n2 - 6 n4 = n3 - 6 n5 = n4 - 6 dimcnt = 2 endtog = %False MM_Belly_On ' changed in the code: 'Controller Belly.channel, &H44, %True ' pitch mapping on 'Controller Belly.channel,4, 25 ' 25 cents allowable pitch deviation - !!! problem: no longer implemented FOR i = 1 TO 5 mPlay Llor.channel, i, 64 ' lites Llor.ctrl(i) = 64 NEXT i 'MM_Llor_On %MM_LIGHTs ' test boundaries of lookup: IF UBOUND(VaccaNotes) < Vacca.hightes THEN stoptask %Trance_Vacca_Object Warning "VaccaNotes array dimension problem",5000 EXIT SUB ELSE Task(%Trance_Vacca_Object).tog = %True END IF END IF SELECT CASE poly CASE 1 IF Task(%Trance_Vacca_Object).level < 30 THEN INCR Task(%Trance_Vacca_Object).level END IF CASE 2 IF task(%Trance_Vacca_Object).level < 40 THEN INCR Task(%Trance_Vacca_Object).level END IF CASE 3 IF Task(%Trance_Vacca_Object).level < 50 THEN INCR Task(%Trance_Vacca_Object).level END IF CASE 4 IF Task(%Trance_Vacca_Object).level < 60 THEN INCR Task(%Trance_Vacca_Object).level END IF CASE 5 IF Task(%Trance_Vacca_Object).level < 90 THEN INCR Task(%Trance_Vacca_Object).level END IF CASE ELSE ' do not change - once it becomes 6, amplitude ctrl is under algo control END SELECT v = Task(%Trance_Vacca_Object).level / 128! IF poly > 0 THEN IF ISFALSE cnt MOD 2 THEN IF on1 THEN DelNote2Har Task(%Trance_Vacca_Object).Har, on1 on1 = %False END IF DO 'n1 = SpectralNoteF (24 + App.Globton, (RND(1) * Trance.Speklim), Trance.Spekfak) n1 = SpectralNoteF (36 + App.Globton, (RND(1) * Trance.Speklim), Trance.Spekfak, %ExpSpec) ' 17.09.2005 LOOP UNTIL (n1 < 89) AND (n1 > 44) velo = v * 127 retval = PlayVacca (n1, velo,25) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n1,0), velo on1 = ROUND(n1,0) ELSE retval = PlayLlor (n1, MIN(@pRadPic(0).amp,velo),35) ' also interactive with Picrad0 now. IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n1,0), MIN(@pRadPic(0).amp,velo) IF retval < Llor.lowtes + 8 THEN Trance.Llor_noot = retval ' needed for release! on1 = ROUND(n1,0) ELSE ' try belly IF n1 > Belly.lowtes + 12 THEN ' +24 THEN 'Play Belly.channel, n1, MIN(@pRadPic(0).amp, velo) PlayBelly n1, MIN(@pRadPic(0).amp, velo), 25 ' 15.09.2006 END IF END IF END IF END IF ELSE IF Trance.Llor_noot THEN Release Llor.channel, Trance.Llor_noot, 120 : Trance.Llor_noot = %False END IF IF poly > 1 THEN IF ISFALSE cnt MOD 3 THEN IF on2 THEN DelNote2Har Task(%Trance_Vacca_Object).Har, on2 : on2 = %False DO 'n2 = SpectralNoteF (24 + App.Globton, (RND(1) * Trance.Speklim), Trance.Spekfak) n2 = SpectralNoteF (36 + App.Globton, (RND(1) * Trance.Speklim), Trance.Spekfak, %ExpSpec) LOOP UNTIL (n2 <> n1) AND (n2 <> %False) velo = v * 127 retval = PlayVacca (n2, velo, 25) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n2,0), velo on2 = ROUND(n2,0) ELSE ' try Llor: retval = PlayLlor (n2, MIN(@pRadPic(0).amp,velo), 35) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n2,0), MIN(@pRadPic(0).amp,velo) IF retval < Llor.lowtes + 8 THEN Trance.Llor_noot = retval ' for release on2 = ROUND(n2,0) ELSE ' try belly IF n2 > Belly.lowtes + 10 THEN ' was + 20 'Play Belly.channel, n2, MIN(@pRadPic(0).amp, velo) PlayBelly n2, MIN(@pRadPic(0).amp,velo), 25 ' 15.09.2006 END IF END IF END IF ELSE IF Trance.Llor_noot THEN Release Llor.channel, Trance.Llor_noot, 120 : Trance.Llor_noot = %False END IF END IF IF poly > 2 THEN IF ISFALSE cnt MOD 5 THEN IF on3 THEN DelNote2Har Task(%Trance_Vacca_Object).Har, on3 : on3 = %False DO 'n3 = SpectralnoteF (24 + App.globton, RND(1) * Trance.speklim, Trance.Spekfak) n3 = SpectralNoteF (36 + App.Globton, (RND(1) * Trance.Speklim), Trance.Spekfak, %ExpSpec) IF n3 = %False THEN ITERATE DO LOOP UNTIL (n3 <> n2) AND (n3 <> n1) velo = v * 127 retval = PlayVacca (n3, velo, 20) IF retval THEN AddNote2Har Task(%TRance_Vacca_Object).Har, ROUND(n3,0), velo on3 = ROUND(n3,0) ELSE retval = PlayLlor (n3, MIN(@pRadPic(0).amp,velo) , 25) IF retval THEN AddNote2Har Task(%Trance_Vacca_OBject).Har, ROUND(n3,0),MIN(@pRadPic(0).amp,velo) IF retval < Llor.lowtes + 8 THEN Trance.Llor_Noot = retval ' for release on3 = ROUND(n3,0) ELSE ' try belly IF n3 > Belly.lowtes + 8 THEN ' was + 16 'Play Belly.channel, n3, MIN(@pRadPic(0).amp, velo) PlayBelly n3, MIN(@pRadPic(0).amp, velo), 25 END IF END IF END IF ELSE IF Trance.Llor_noot THEN Release Llor.channel, Trance.Llor_noot, 120 : Trance.Llor_noot= %False END IF END IF IF poly > 3 THEN IF ISFALSE cnt MOD 7 THEN IF on4 THEN Delnote2Har Task(%Trance_Vacca_Object).Har, on4: on4 = %False DO 'n4 = SpectralNoteF (24 + App.Globton, RND(1) * Trance.Speklim, Trance.Spekfak) n4 = SpectralNoteF (36 + App.Globton, (RND(1) * Trance.Speklim), Trance.Spekfak, %ExpSpec) IF n4 = %False THEN ITERATE DO LOOP UNTIL (n4<>n3) AND (n4<> n2) AND (n4<>n1) velo = v * 127 retval = PlayVacca (n4, velo, 20) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n4,0), velo on4 = ROUND(n4,0) ELSE retval = PlayLlor (n4, MIN(@pRadPic(0).amp,velo) , 25) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n4,0), MIN(@pRadPic(0).amp,velo) IF retval < Llor.lowtes + 8 THEN Trance.Llor_noot = retval ' for release on4 = ROUND(n4,0) ELSE ' try belly IF n4 > Belly.lowtes + 6 THEN ' was + 16 'Play Belly.channel, n4, MIN(@pRadPic(0).amp, velo) PlayBelly n4, MIN(@pRadPic(0).amp, velo), 25 END IF END IF END IF ELSE IF Trance.Llor_noot THEN release llor.channel, trance.llor_noot, 120 : Trance.Llor_noot = %False END IF END IF IF poly > 4 THEN IF ISFALSE cnt MOD 8 THEN IF on5 THEN DelNote2Har Task(%Trance_Vacca_Object).Har, on5 : on5 = %False DO n5 = SpectralNoteF (App.Globton + 24, RND(1) * Trance.Speklim/2, Trance.Spekfak, %ExpSpec) ' low bells ' leave this at + 24 17.09.2005 IF n5 = %False THEN ITERATE DO LOOP UNTIL n5 < 89 velo = v * 127 retval = PlayVacca (n5, velo, 25) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n5,0), velo on5 = ROUND(n5,0) ELSE retval = PlayLlor (n5, MIN(@pRadPic(0).amp,velo) , 50) IF retval THEN AddNote2Har Task(%Trance_Vacca_Object).Har, ROUND(n5,0), MIN(@pRadPic(0).amp,velo) IF retval < Llor.lowtes + 8 THEN Trance.Llor_noot = retval ' for release on5 = ROUND(n5,0) ELSE ' try belly IF n5 > Belly.lowtes THEN ' was belly.lowtes + 12 'Play Belly.channel, n5, MIN(@pRadPic(0).amp, velo) PlayBelly (n5, MIN(@pRadPic(0).amp, velo), 25) END IF END IF END IF ELSE IF Trance.Llor_noot THEN release llor.channel, Trance.Llor_noot, 120 : Trance.Llor_noot = %False END IF END IF IF ISFALSE cnt MOD 210 THEN ' = 2 * 3 * 5 * 7 IF poly < 5 THEN Task(%Trance_Vacca_Object).Freq = 0.5 ' fermata 30 / App.Tempo END IF '? add troms here... Controller Piano.channel, 64, 120 ' pedaal ' or piano chord... IF n1 THEN AddNote2Har Piano.Har(1), n1, MAX(velo,72) AddNote2Har Piano.Har(1), n1 + 12, MAX(velo,72) END IF IF n2 THEN AddNote2Har Piano.Har(1), n2, MAX(velo,72) AddNote2Har Piano.Har(1), n2 + 12, MAX(Velo, 72) END IF IF n3 THEN AddNote2Har Piano.Har(1), n3, MAX(velo, 72) AddNote2Har Piano.Har(1), n3 + 12, MAX(velo,72) END IF IF n4 THEN AddNote2Har Piano.Har(1), n4, MAX(velo, 72) AddNote2Har Piano.Har(1), n4-12, MAX(velo, 72) END IF IF n5 THEN AddNote2Har Piano.Har(1), n5, MAX(velo,72) AddNote2Har Piano.Har(1), n5-12, MAX(velo,72) END IF InstrumPlay Piano ' mPlay chord ELSE IF cnt MOD 210 = 1 THEN InstrumPlay Piano ' notes off END IF IF cnt MOD 210 = 4 THEN controller piano.channel, 64, %False ' pedaal los END IF IF poly < 5 THEN Task(%Trance_Vacca_Object).freq = 4 ' = 240 / App.Tempo END IF END IF ' IF ISFALSE cnt MOD 32 THEN ' this value determines the duration of the algorhythm. - 3'22" IF ISFALSE cnt MOD 24 THEN ' 2'01" IF poly < 6 THEN INCR poly ' no tempo change! ELSE ' on entry freq will be = 4 , poly = 6 IF endtog THEN 'decrease dynamics IF ISFALSE cnt MOD dimcnt THEN DECR Task(%Trance_Vacca_Object).level SELECT CASE Task(%Trance_Vacca_Object).level ' CASE 40 ' was remmed... ' INCR dimcnt CASE 25 INCR dimcnt CASE 20 INCR dimcnt CASE 10 INCR dimcnt CASE 5 INCR dimcnt CASE 3 INCR dimcnt CASE 0 StopTask %Trance_Vacca_Object EXIT SUB END SELECT END IF ' small ritardando: Task(%Trance_Vacca_Object).freq = Task(%Trance_Vacca_Object).freq * 0.97 IF Task(%Trance_Vacca_Object).freq < 38 THEN Task(%Trance_Vacca_Object).freq = 38 'IF Task(%Trance_Vacca_Object).freq < 32 THEN Task(%Trance_Vacca_Object).freq = 32 ELSE ' accellerando: (vanzodra poly >= 6) Task(%Trance_Vacca_Object).freq = Task(%Trance_Vacca_Object).freq * 1.15 IF Task(%Trance_Vacca_Object).level > 70 THEN DECR Task(%Trance_Vacca_Object).level END IF IF Task(%Trance_Vacca_Object).freq > 45 THEN endtog = %True 'IF Task(%Trance_Vacca_Object).freq > 40 THEN endtog = %True END IF END IF END IF INCR cnt END SUB SUB Trance_Vacca_Object_Start () Task(%Trance_Vacca_Object).duur = 121 '210 ' in s Task(%Trance_Vacca_Object).tempo = 120 ' MM IF ISFALSE Task(%Radar_Listen).swit THEN starttask %Radar_Listen ' for PicRa A device ProgChange Vacca.channel, %False ' default velo mapping END SUB SUB Faust_Trance_Chords () ' ritm structure (Milonga) - done 14.08.2005 ' harmony flow much improved 29.08.2005 ' 14.09.2005 rechecked with modified spectral function in g_har.dll STATIC n AS LONG LOCAL i AS LONG LOCAL noot AS SINGLE STATIC velo AS BYTE STATIC ritmeteller AS LONG STATIC tiks AS SINGLE IF ISFALSE Task(%TRance_Ch).tog THEN n = 0 ritmeteller = 0 MM_So_On MM_Trump_On MM_Harma_On ' should already be on... MM_Bourdonola_On MM_Vibi_On MM_Klung_On MM_Tubi_On Controller Vibi.channel, 64, %False ' sustain off Controller Vibi.channel, 24, %True ' use release + velo for damping. MM_Humanola_On ' check this! (if shaky: use ctrl 7) 'MM_Ake_On ' was reeds ON (global) Task(%Trance_Ch).tog = %True velo = 64 ' voorlopig - kan ook interaktief worden. END IF '---- IF Task(%Trance_Ch).Rit.pattern(Ritmeteller) = 0 THEN ' always in irrational metric relation to main tempo: ' tempo changes are always bar by bar, discontinuous, never accel nor ritenuto Task(%Trance_Ch).tempo = SQR(App.tempo) '7.7 to 15.4 Ritmeteller = 0 tiks = GetRitme(Task(%Trance_Ch).rit, %Milonga, 0.5) ' returns a new pattern for the rhythm as soon as the actual one has been completed. ' the proc. is in g_mus.dll END IF ' het tempo voor een gehele maat is frq = task(tasknr%).tempo / 60 ' zo'n gehele maat beslaat een aantal eenheden gegeven in tiks! Task(%Trance_Ch).freq = (tiks * Task(%Trance_Ch).tempo ) / (60 * ABS(Task(%Trance_Ch).Rit.pattern(Ritmeteller))) IF Task(%Trance_Ch).Rit.Pattern(ritmeteller) > 0 THEN IF ritmeteller = 0 THEN mPlay Troms.channel, 25, 120 END IF i = 1 DO noot = SpectralNoteF(24+ App.Globton, i, Trance.spekfak, %ExpSpec) IF ISFALSE noot THEN EXIT DO IF noot < So.hightes AND ISFALSE(TRance.so_noot) THEN AddNote2Har So.Har(1), noot, velo InstrumPlay So Trance.so_noot = noot ELSEIF noot < Trump.hightes AND ISFALSE(Trance.trump_noot) THEN mPlay Trump.channel, noot, 64 'velo trance.trump_noot = noot ELSEIF noot < Ake.hightes AND ISFALSE(Trance.ake_nooT) THEN mPlay Ake.channel, noot, 64 ' now uses pwm trance.ake_noot = noot ELSEIF noot < humanola.hightes AND ISFALSE trance.humanola_noot THEN mPlay humanola.channel, noot, 64 trance.humanola_noot = noot ELSEIF noot < harma.hightes AND ISFALSE trance.harma_noot THEN mPlay harma.channel, noot, velo trance.harma_noot = noot ELSEIF noot < piano.hightes AND ISFALSE trance.piano_noot THEN mPlay piano.channel, noot, velo trance.piano_noot = noot ELSEIF noot < klung.hightes AND ISFALSE trance.klung_noot THEN mPlay klung.channel, noot, velo trance.klung_noot = noot ELSEIF noot < vibi.hightes AND ISFALSE trance.vibi_noot THEN mPlay vibi.channel, noot, velo trance.vibi_noot = noot ELSEIF noot < puff.hightes AND ISFALSE trance.puff_noot THEN mPlay puff.channel, noot, velo trance.puff_noot = noot ELSEIF noot < piperola.hightes AND ISFALSE trance.piperola_Noot THEN mPlay piperola.channel, noot, velo trance.piperola_noot = noot ELSEIF noot < tubi.hightes AND ISFALSE trance.tubi_Noot THEN mPlay tubi.channel, noot, velo trance.tubi_noot = noot END IF INCR i LOOP UNTIL i > Trance.speklim ' n = 1 ELSE InstrumPlay So IF ritmeteller > 4 THEN Trance.so_noot = %False ' zodat we die noot niet telkens herhalen - that's the trick to ' make all chords move! END IF 'if Trance.so_noot then Play_So Trance.so_noot, %False : Trance.so_noot = %False IF Trance.trump_noot THEN NoteOff Trump.channel, Trance.trump_noot : Trance.trump_noot = %False IF Trance.ake_Noot THEN Noteoff Ake.channel, Trance.ake_Noot : TRance.ake_noot = %False IF Trance.humanola_Noot THEN Noteoff humanola.channel, Trance.humanola_Noot : TRance.humanola_noot = %False IF Trance.harma_Noot THEN Noteoff harma.channel, Trance.harma_Noot : TRance.harma_noot = %False IF Trance.piano_Noot THEN Noteoff piano.channel, Trance.piano_Noot : TRance.piano_noot = %False IF Trance.piperola_Noot THEN Noteoff piperola.channel, Trance.piperola_Noot: TRance.piperola_Noot = %False Trance.klung_noot = %False IF Trance.vibi_noot THEN Release Vibi.channel, Trance.vibi_noot, 64 + velo/2: Trance.vibi_noot= %False Trance.puff_noot = %False Trance.tubi_noot = %False ' after the beat: IF ritmeteller < 4 THEN mPlay Troms.channel, 24 + ritmeteller, 120 - (ritmeteller * 20) ' velo END IF ' n = 0 END IF INCR ritmeteller END SUB SUB Faust_Trance_Chords_Stop () InstrumPlay So IF Trance.trump_noot THEN Noteoff Trump.channel, Trance.trump_noot Trance.trump_noot = %False END IF IF Trance.ake_Noot THEN Noteoff Ake.channel, Trance.ake_Noot : TRance.ake_noot = %False IF Trance.humanola_Noot THEN Noteoff humanola.channel, Trance.humanola_Noot : TRance.humanola_noot = %False IF Trance.harma_Noot THEN Noteoff harma.channel, Trance.harma_Noot : TRance.harma_noot = %False IF Trance.piano_Noot THEN Noteoff piano.channel, Trance.piano_Noot : TRance.piano_noot = %False IF Trance.piperola_Noot THEN Noteoff piperola.channel, Trance.piperola_Noot: TRance.piperola_Noot = %False Trance.klung_noot = %False IF Trance.vibi_noot THEN Release Vibi.channel, Trance.vibi_noot, 100 : Trance.vibi_noot = %False Trance.puff_noot = %False Trance.sax_noot = %False Trance.bourdonola_noot = %False END SUB SUB Faust_Trance_Sire () ' object for TransiTrance ' should occur in the very beginning (at 30-90%%) and optionaly again after vacca-object STATIC sicnt AS LONG STATIC cycle AS LONG LOCAL noot AS SINGLE IF ISFALSE Task(%Trance_Si).tog THEN Task(%Trance_Si).freq = App.Tempo / 120 ' 0.5 sicnt = 0 cycle = 0 Task(%Trance_Si).tog = %True ' lights on: mPlay Sire.channel, 86, 127 ' ok - linkse onderste LED spot - rood mPlay Sire.channel, 89, 127 ' ok mPlay Sire.channel, 92, 127 ' ok END IF SELECT CASE cycle CASE %False Sire_Play 48+ App.Globton, 1, sicnt,0 CASE 1 noot = SpectralNoteF(24 + App.Globton, MIN(1 + sicnt, Trance.speklim), Trance.spekfak, %ExpSpec) IF noot < Sire.lowtes THEN noot = noot + 12 IF noot >= Sire.lowtes AND noot <= Sire.hightes THEN Sire_Play noot, 1,sicnt,0 ELSE Sire_Play noot, 0, sicnt END IF CASE 2 noot = SpectralNoteF(24 + App.Globton, MIN(24-sicnt, Trance.speklim), Trance.spekfak, %ExpSpec) IF noot >= Sire.lowtes AND noot <= Sire.hightes THEN Sire_Play noot, 1,sicnt,0 ELSE Sire_Play noot, 0 , sicnt END IF CASE 3 IF App.Globton > 7 THEN Sire_Play 48+ App.Globton, 1, sicnt,0 ELSE Sire_Play 60 + App.Globton, 1, sicnt, 0 END IF CASE > 3 StopTask %Trance_Si END SELECT INCR sicnt sicnt = sicnt MOD 24 IF ISFALSE sicnt THEN INCR cycle Task(%Trance_Si).freq = App.Tempo / 120 ' 0.5 END SUB SUB Faust_Trance_Sire_Stop () Controller Sire.channel, 123, %False ' all off - does not seem to switch lights off NoteOff Sire.channel, 86 NoteOff Sire.channel, 89 NoteOff Sire.channel, 92 END SUB SUB Faust_Trance_Hurdy () ' if App.globton = open string, Hurdy starts playing ' controlled via picra(1) device - marked B ' must be placed outside quadrada, with nude player. ' player may mount hurdy (homunculus) ' movement only when hurdy lites are lit. STATIC lcnt AS INTEGER STATIC hcnt AS INTEGER LOCAL velo AS INTEGER LOCAL noot AS INTEGER LOCAL llim AS INTEGER LOCAL hlim AS INTEGER STATIC lights AS INTEGER STATIC oldnoot AS INTEGER IF ISFALSE Task(%Trance_Hu).tog THEN IF ISFALSE Task(%Radar_Listen).swit THEN Starttask %Radar_Listen ' for PicRa B device END IF lcnt = -1 hcnt = -1 Controller Hurdy.channel, 67, %False ' clockwize rotation Controller Hurdy.channel, 66, 127 ' motor ON Controller Hurdy.channel, 65, 127 ' start motor on reception of note ' velo moet funktie worden van Picrad Task(%Trance_Hu).freq = 0.33 Task(%Trance_Hu).tog = %TRue END IF IF App.Globton = Hurdy.ctrl(120) MOD 12 THEN IF ISFALSE Task(%Radar_Listen).swit THEN starttask %Radar_Listen ' for PicRa devices IF ISFALSE lights THEN Controller Hurdy.channel, 66, 127 Controller Hurdy.channel, 65, 127 ' start motor on reception of note Hurdy.ctrl(66) = 127 mPlay Hurdy.channel, 0, 127 ' lites mPlay Hurdy.channel, 1, 127 ' lites lights = %True END IF velo = MIN(@pRadPic(1).amp, 127) 'llim = Calc_Speklim_Krom (Hurdy.ctrl(120),Hurdy.ctrl(120) + 48) ' + 47 kan ook DIM Sp(0) AS STATIC SINGLE llim = NumberOfSpectralComponents(Hurdy.ctrl(120),100,Trance.Spekfak, Sp(),Hurdy.ctrl(120)+48) lcnt = MIN((@pRadPic(1).f / 10) * llim , llim) ' number of spectral note in function of speed of movement. noot = Spectralnote (Hurdy.ctrl(120), lcnt, Trance.spekfak,%ExpSpec) ' = Sp(lcnt) IF noot THEN Controller Hurdy.channel, 7, 60 + (velo / 2) ' bow speed IF noot + 7 < 64 THEN Controller Hurdy.channel, 1, 60 + (velo /2) ' prepulse mPlay Hurdy.channel, noot + 7, (MAX(velo, 22)) oldnoot = noot ELSE Controller Hurdy.channel, 2, 60 + (velo/ 2) mPlay Hurdy.channel, noot + 14, MAX(velo,22) ' use second string oldnoot = noot END IF ELSE IF oldnoot THEN NoteOff Hurdy.channel, oldnoot oldnoot = %False END IF END IF ELSE IF lcnt > -1 THEN ' schakel hurdy uit mPlay Hurdy.channel, 1, 0 mPlay Hurdy.channel, 0, 0 lights = %False Controller Hurdy.channel, 123, %False lcnt = -1 END IF END IF IF App.Globton = Hurdy.ctrl(121) MOD 12 THEN IF ISFALSE Task(%Radar_Listen).swit THEN starttask %Radar_Listen ' for PicRa devices IF ISFALSE lights THEN Controller Hurdy.channel, 66, 127 Controller Hurdy.channel, 65, 127 ' start motor on reception of note Hurdy.ctrl(66) = 127 mPlay Hurdy.channel, 0, 127 mPlay Hurdy.channel, 1, 127 lights = %True END IF velo = MIN(@pRadPic(1).amp, 127) 'hlim = Calc_Speklim_Krom (Hurdy.ctrl(121), Hurdy.ctrl(121) + 24) DIM Sp(0) AS STATIC SINGLE hlim = NumberOfSpectralComponents(Hurdy.ctrl(121),100,Trance.Spekfak, Sp(),Hurdy.ctrl(121)+24) hcnt = MIN ((@pRadPic(1).f / 10) * hlim, hlim) noot = SpectralNote (Hurdy.ctrl(121), hcnt, Trance.Spekfak, %ExpSpec) IF noot THEN Controller Hurdy.channel, 2, 60 + (velo / 2) ' prepulse Controller Hurdy.channel, 7, MAX(velo, 22) IF noot + 14 < 88 THEN mPlay Hurdy.channel, noot + 14, MAX(velo, 22) oldnoot = noot END IF ELSE IF oldnoot THEN NoteOff Hurdy.channel, oldnoot oldnoot = %False END IF END IF ELSE IF hcnt > -1 THEN ' schakel hurdy uit mPlay Hurdy.channel, 0, 0 mPlay Hurdy.channel, 1, 0 lights = %False Controller Hurdy.channel, 123, %False hcnt = -1 END IF END IF END SUB SUB Faust_Trance_Hurdy_Stop () Controller Hurdy.channel, 123, %False IF Task(%Radar_Listen).swit THEN IF ISFALSE Task(%Trance_Vacca_Object).swit THEN stoptask %Radar_Listen ' for PicRa devices END IF END IF END SUB SUB Faust_Trance_Piano () ' 28.08.2005 ' uses cqt input: ' input from audio mixer, switchable: either complete robot orchestra output, or musician input ' optional acoustical feedback object. ' needs nude viola or cello player in that case. ' In an ideal situation, we would use a second player piano, placed behind the audience, such that ' it appears to echo the orchestra in front. STATIC cnt AS DWORD IF ISFALSE Task(%Trance_Pia).tog THEN cnt = %False IF ISFALSE Task(CQT.listentasknr).swit THEN starttask CQT.listentasknr IF Task(%Trance_Glob).swit THEN Task(%Trance_Pia).freq = App.Tempo / 60 ELSEIF Task(%Trance_end).swit THEN Task(%Trance_Pia).freq = 3 ELSE Task(%Trance_Pia).freq = 4 END IF Task(%Trance_Pia).tog = %True END IF IF ISFALSE cnt THEN Piano.Har(1) = Task(CQT.listentasknr).Har InstrumPlay Piano IF Cqt.dur THEN Task(%Trance_Pia).freq = 1000 / Cqt.dur IF Task(%Trance_Pia).freq > 30 THEN Task(%Trance_Pia).freq = 30 ELSE Task(%Trance_Pia).freq = App.Tempo / 60 END IF ELSE InstrumPlay Piano ' notes off IF Cqt.rest THEN Task(%Trance_Pia).freq = 1000 / Cqt.rest IF Task(%Trance_Pia).freq > 30 THEN Task(%Trance_Pia).freq = 30 ELSE Task(%Trance_Pia).freq = App.Tempo / 60 END IF END IF INCR cnt cnt = cnt MOD 2 END SUB SUB Faust_Trance_Piano_Stop () InstrumPlay Piano END SUB SUB Faust_Trance_Slides () ' slierten - objekt STATIC cnt AS DWORD STATIC beginnoot AS INTEGER STATIC eindnoot AS INTEGER STATIC noot AS SINGLE STATIC oldnoot AS INTEGER STATIC velo AS BYTE IF ISFALSE Task(%Trance_Sl).tog THEN INCR cnt cnt = cnt MOD 5 SELECT CASE cnt CASE 1 Task(%Trance_Sl).channel = Troms.channel beginnoot = 23 eindnoot = Troms.hightes velo = 120 CASE 2 Task(%Trance_Sl).channel = Puff.channel beginnoot = 55 eindnoot = Puff.hightes velo = 32 CASE 3 Task(%Trance_Sl).channel = Piperola.channel beginnoot = Piperola.lowtes eindnoot = Piperola.hightes velo = 64 CASE 4 Task(%Trance_Sl).channel = Humanola.channel beginnoot = Humanola.lowtes eindnoot = Humanola.hightes velo = 64 CASE ELSE ' will only happen -with cnt mod 5- on cnt = 0, so after the first complete cycle cnt = 0 Task(%Trance_Sl).channel = Trump.channel beginnoot = Trump.lowtes eindnoot = Trump.hightes velo = 64 END SELECT noot = beginnoot Task(%Trance_Sl).freq = App.Tempo * 16 / 60 Task(%Trance_Sl).tog = %True END IF DO noot = noot + ((RND(1)- 0.3) * 4) LOOP UNTIL noot >= beginnoot IF noot > eindnoot THEN IF oldnoot THEN NoteOff Task(%Trance_sl).channel, oldnoot oldnoot = %False stoptask %Trance_Sl EXIT SUB END IF IF oldnoot THEN NoteOff Task(%Trance_sl).channel, oldnoot : oldnoot = %False mPlay Task(%Trance_sl).channel, noot, velo oldnoot = noot END SUB SUB Faust_Trance_SlVibi () ' added 18.09.2005 ' slierten - objekt voor Vibi STATIC beginnoot AS INTEGER STATIC eindnoot AS INTEGER STATIC noot AS SINGLE STATIC oldnoot AS INTEGER STATIC velo AS BYTE IF ISFALSE Task(%Trance_SlVibi).tog THEN Task(%Trance_SlVibi).channel = Vibi.channel beginnoot = Vibi.lowtes eindnoot = Vibi.hightes velo = 74 noot = beginnoot Task(%Trance_SlVibi).freq = App.Tempo * 16 / 60 Task(%Trance_SlVibi).tog = %True END IF DO noot = noot + ((RND(1)- 0.3) * 4) LOOP UNTIL noot >= beginnoot IF noot > eindnoot THEN IF oldnoot THEN Release Task(%Trance_slvibi).channel, oldnoot, velo / 3 oldnoot = %False stoptask %Trance_SlVibi EXIT SUB END IF IF oldnoot THEN Release Task(%Trance_slvibi).channel, oldnoot, velo / 3 : oldnoot = %False mPlay Task(%Trance_slvibi).channel, noot, velo oldnoot = noot END SUB SUB Faust_Trance_Ake () ' debug session 23.08.2005 ' interactivity still to be added. STATIC cnt AS LONG STATIC nl AS BYTE STATIC nh AS BYTE STATIC ndif AS BYTE IF ISFALSE Task(%Trance_Ake).tog THEN ' lage startnoot = oktavering van tonale attraktor IF App.Globton + 48 >= 49 THEN nl = App.Globton + 48 '49 ELSE nl = App.Globton + 60 END IF nl = nl - 1 ' incremented before mPlay instruction ' hoge startnoot = hoogste spektraalkomponent speelbaar door ake cnt = Trance.speklim DO nh = SpectralNote(24 + App.Globton, cnt, Trance.SpekFak, %ExpSpec) DECR cnt LOOP UNTIL nh <= Ake.hightes IF ISFALSE nh THEN nh = Ake.hightes ' IF nh < nl THEN MSGBOX "error in ake object",, FUNCNAME$ Task(%Trance_Ake).freq = 1 '7 ' moet interaktief worden cnt = %False Task(%Trance_Ake).tog = %True END IF IF nl < nh THEN SELECT CASE cnt MOD 3 CASE %False IF nh THEN Noteoff Ake.channel, nh ': nh = %False INCR nl mPlay Ake.channel, nl, 64 CASE %True IF ndif THEN Noteoff ake.channel, ndif DO nh = nh - ((RND(1)- 0.3) * 4) LOOP UNTIL nh < ake.hightes mPlay Ake.channel, nh, 64 CASE 2 IF nl THEN NoteOff Ake.channel, nl ndif = f2n(Diftone(nl,nh)) IF ndif THEN IF ndif >= Ake.lowtes AND ndif <= Ake.lowtes + 24 THEN mPlay Ake.channel, ndif, 64 ELSE IF ndif > Ake.lowtes + 24 THEN DO ndif = ndif - 12 LOOP UNTIL ndif <= Ake.lowtes + 24 ELSEIF ndif < Ake.lowtes THEN DO ndif = ndif + 12 LOOP UNTIL ndif >= Ake.lowtes END IF IF (ndif <> nl) AND (ndif <> nh) THEN mPlay Ake.channel, ndif, 64 ELSE ndif = %False END IF END IF END IF END SELECT Task(%Trance_Ake).freq = Task(%Trance_Ake).freq + (cnt / 32) ' moet interaktief worden - nu accellerando ELSE IF nl = nh THEN mPlay Ake.channel, nl, 64 DECR nh Task(%Trance_Ake).freq = 0.5 ELSE IF ndif THEN Noteoff Ake.channel, ndif : ndif = %False NoteOff Ake.channel, nl stoptask %Trance_Ake EXIT SUB END IF END IF INCR cnt END SUB SUB Faust_Trance_Ake_Stop () ' added 12.09.2005 - seems required, but may switch of globton... MM_Ake_Off %MM_Notes END SUB SUB Faust_Trance_Casta () ' added 28.09.2005 STATIC noot AS SINGLE STATIC velo AS BYTE IF ISFALSE Task(%Trance_Casta).tog THEN Task(%Trance_Casta).channel = Humanola.channel velo = 48 noot = 113 ' lowest castanet Task(%Trance_Casta).freq = App.Tempo * 12 / 60 Task(%Trance_Casta).tog = %True END IF DO noot = noot + ((RND(1)- 0.3) * 2) LOOP UNTIL noot >= 113 IF noot > 127 THEN stoptask %Trance_Casta EXIT SUB END IF velo = velo + 6 ' crescendo velo = MIN(velo,127) mPlay Task(%Trance_Casta).channel, noot, velo END SUB SUB Faust_Trance_End () ' finale kadens ' alle spektraalkomponenten van hoog naar laag aan ' motors off LOCAL i AS LONG LOCAL noot AS SINGLE STATIC cnt AS LONG IF ISFALSE Task(%Trance_end).tog THEN cnt = %False DIM Sp(0) AS STATIC SINGLE Trance.Speklim = NumberOfSpectralComponents(24+App.Globton,25,Trance.Spekfak, Sp(), 108) 'Calc_Speklim i = Trance.speklim Task(%Trance_end).freq = App.Tempo / (60 * 8)' 0.25 'SetDlgItemText gh.Cockpit, %GMT_MSG2, " Section= 19" & " Tonality= " & STR$(App.globton) Task(%Trance_end).tog = %True END IF SELECT CASE cnt CASE %False DO noot = SpectralNoteF(24+ App.Globton, i, Trance.spekfak, %ExpSpec) IF ISFALSE noot THEN EXIT LOOP ' microtonal pitches first: IF PlayVacca (noot, 82, 20) THEN DECR i ITERATE DO END IF IF PlayLlor (noot, 100, 20) THEN DECR i ITERATE DO END IF IF FRAC(noot) > 27 AND FRAC(noot) < 73 THEN IF noot >= 72 AND noot <= Tubi.hightes THEN mPlay Tubi.channel, noot - 48, 120 DECR i ITERATE DO ELSEIF noot >= 55 AND noot <=Puff.hightes THEN mPlay Puff.channel, noot - 48, 48 DECR i ITERATE DO END IF END IF ' normal pitches: IF noot <= Tubi.hightes AND ISFALSE Trance.tubi_noot THEN mPlay Tubi.channel, noot, 120 : TRance.tubi_noot = noot ELSEIF noot <= Piperola.hightes AND ISFALSE Trance.piperola_Noot THEN mPlay Piperola.channel, noot, 64: Trance.piperola_noot = noot ELSEIF noot <= Humanola.hightes AND ISFALSE Trance.humanola_Noot THEN mPlay Humanola.channel, noot, 64: Trance.humanola_noot = noot ELSEIF noot <= Vibi.hightes AND ISFALSE Trance.Vibi_Noot THEN mPlay Vibi.channel, noot, 120 : Trance.vibi_noot = noot ELSEIF noot <= Piano.hightes AND ISFALSE Trance.piano_noot THEN mPlay Piano.channel, noot, 84 : Trance.piano_noot = noot ELSEIF noot <= Harma.Hightes AND ISFALSE Trance.harma_noot THEN mPlay Harma.channel, noot, 100 : Trance.harma_noot = noot ELSEIF noot <= Puff.Hightes AND ISFALSE Trance.puff_noot THEN mPlay Puff.channel, noot, 48 : Trance.puff_noot = noot ELSEIF noot <= Trump.Hightes AND ISFALSE Trance.trump_noot THEN mPlay Trump.channel, noot, 64: Trance.Trump_Noot = noot ELSEIF noot <= Bourdonola.hightes AND ISFALSE Trance.bourdonola_noot THEN mPlay Bourdonola.channel, noot, 64 : Trance.bourdonola_noot = noot ELSEIF noot <= Ake.hightes AND ISFALSE Trance.Ake_noot THEN mPlay Ake.channel, noot, 64: Trance.ake_noot = noot ELSEIF noot <= Klung.hightes AND ISFALSE Trance.Klung_noot THEN mPlay Klung.channel, noot, 120 : Trance.klung_noot = noot ELSEIF noot <= So.hightes AND ISFALSE Trance.So_Noot THEN AddNote2Har So.Har(1), noot, 80 InstrumPlay So Trance.So_noot = noot ELSEIF noot <= AutoSax.Hightes AND ISFALSE Trance.Sax_Noot THEN mPlay AutoSax.channel, noot ,78: Trance.Sax_Noot = noot ELSEIF noot <= Belly.hightes AND ISFALSE Trance.Belly_Noot THEN 'Play Belly.channel, noot, 64 : Trance.Belly_noot = noot IF PlayBelly (noot, 64, 25) THEN Trance.Belly_noot = noot ' ELSEIF ISFALSE Trance.Vacca_noot AND PlayVacca (noot,64, 25) THEN ' Trance.Vacca_noot = noot ' ELSEIF ISFALSE Trance.Llor_noot AND PlayLlor (noot, 120, 30) THEN ' Trance.Llor_noot = noot END IF DECR i LOOP UNTIL i <= 0 App.tempo = App.tempo / 8 ' MM=30 Task(%Trance_End).freq = App.tempo / (60 * 4) ' 8 sekonden. f=0.125 CASE 1 Noteoff Autosax.channel, Trance.Sax_noot : Trance.Sax_noot = %False NoteOff Piano.channel, Trance.piano_noot : Trance.Piano_noot = %False Task(%Trance_End).freq = App.tempo / (60 * 2) ' 4 sekonden 12) ' 12 sekonden InstrumPlay So Trance.So_Noot = %False 'SetDlgItemText gh.Cockpit, %GMT_MSG2, " Section= 20" & " Tonality= " & STR$(App.globton) IF Trance.Harma_noot <> App.Globton + 24 THEN mPlay Harma.channel, App.Globton + 24, 120 mPlay Harma.channel, App.Globton + 36, 120 END IF CASE 2 ' verschuif spekfak in funktie van de slotkadens: Trance.spekfak = 1.12 DIM Sp(0) AS STATIC SINGLE Trance.Speklim = NumberOfSpectralComponents(24+App.Globton,25,Trance.Spekfak, Sp(), 108) 'Calc_Speklim IF Trance.Piperola_noot THEN Noteoff piperola.channel, Trance.piperola_noot: Trance.piperola_noot = %False IF Trance.Humanola_noot THEN Noteoff humanola.channel, Trance.humanola_noot: Trance.humanola_noot = %False IF Trance.Harma_noot THEN Noteoff harma.channel, Trance.harma_noot: Trance.harma_noot = %False IF Trance.Trump_noot THEN Noteoff Trump.channel, Trance.trump_noot: Trance.trump_noot = %False IF Trance.Bourdonola_noot THEN Noteoff bourdonola.channel, Trance.bourdonola_noot: Trance.bourdonola_noot = %False IF Trance.Ake_noot THEN Noteoff Ake.channel, Trance.Ake_noot: Trance.Ake_noot = %False NoteOff Harma.channel, App.Globton + 24 NoteOff Harma.channel, App.Globton + 36 i = Trance.speklim DO noot = SpectralNoteF(24+ App.Globton, i, Trance.spekfak, %ExpSpec) IF ISFALSE noot THEN EXIT LOOP ' microtonal pitches first: IF PlayVacca (noot, 82, 20) THEN DECR i ITERATE DO END IF IF PlayLlor (noot, 100, 20) THEN DECR i ITERATE DO END IF IF FRAC(noot) > 27 AND FRAC(noot) < 73 THEN IF noot >= 72 AND noot <= Tubi.hightes THEN mPlay Tubi.channel, noot - 48, 120 DECR i ITERATE DO ELSEIF noot >= 55 AND noot <=Puff.hightes THEN mPlay Puff.channel, noot - 48, 48 DECR i ITERATE DO END IF END IF ' normal pitches: IF noot <= Tubi.hightes AND ISFALSE Trance.tubi_noot THEN mPlay Tubi.channel, noot, 120 : TRance.tubi_noot = noot ELSEIF noot <= Piperola.hightes AND ISFALSE Trance.piperola_Noot THEN mPlay Piperola.channel, noot, 64: Trance.piperola_noot = noot ELSEIF noot <= Humanola.hightes AND ISFALSE Trance.humanola_Noot THEN mPlay Humanola.channel, noot, 64: Trance.humanola_noot = noot ELSEIF noot <= Vibi.hightes AND ISFALSE Trance.Vibi_Noot THEN mPlay Vibi.channel, noot, 120 : Trance.vibi_noot = noot ELSEIF noot <= Piano.hightes AND ISFALSE Trance.piano_noot THEN mPlay Piano.channel, noot, 84 : Trance.piano_noot = noot ELSEIF noot <= Harma.Hightes AND ISFALSE Trance.harma_noot THEN mPlay Harma.channel, noot, 100 : Trance.harma_noot = noot ELSEIF noot <= Puff.Hightes AND ISFALSE Trance.puff_noot THEN mPlay Puff.channel, noot, 48 : Trance.puff_noot = noot ELSEIF noot <= Trump.Hightes AND ISFALSE Trance.trump_noot THEN mPlay Trump.channel, noot, 64: Trance.Trump_Noot = noot ELSEIF noot <= Bourdonola.hightes AND ISFALSE Trance.bourdonola_noot THEN mPlay Bourdonola.channel, noot, 64 : Trance.bourdonola_noot = noot ELSEIF noot <= Ake.hightes AND ISFALSE Trance.Ake_noot THEN mPlay Ake.channel, noot, 64: Trance.ake_noot = noot ELSEIF noot <= Klung.hightes AND ISFALSE Trance.Klung_noot THEN mPlay Klung.channel, noot, 120 : Trance.klung_noot = noot ELSEIF noot <= So.hightes AND ISFALSE Trance.So_Noot THEN AddNote2Har So.Har(1), noot, 80 InstrumPlay So Trance.So_noot = noot ELSEIF noot <= AutoSax.Hightes AND ISFALSE Trance.Sax_Noot THEN mPlay AutoSax.channel, noot ,78: Trance.Sax_Noot = noot ELSEIF noot <= Belly.hightes AND ISFALSE Trance.Belly_Noot THEN 'Play Belly.channel, noot, 64 : Trance.Belly_noot = noot IF PlayBelly (noot, 64, 25) THEN Trance.Belly_noot = noot ' ELSEIF ISFALSE Trance.Vacca_noot AND PlayVacca (noot,64, 25) THEN ' Trance.Vacca_noot = noot ' ELSEIF ISFALSE Trance.Llor_noot AND PlayLlor (noot, 120, 30) THEN ' Trance.Llor_noot = noot END IF DECR i LOOP UNTIL i <= 0 IF Trance.piano_noot <> App.Globton + 24 THEN mPlay Piano.channel, App.Globton + 24, 120 END IF Task(%Trance_End).freq = App.tempo / (60 * 4) ' 8" (60 * 16) ' 32" 'SetDlgItemText gh.Cockpit, %GMT_MSG2, " Section= 21 " & " Tonality= " & STR$(App.globton) CASE 3 NoteOff Piano.channel, App.Globton + 24 IF App.Globton MOD 12 <> %False THEN App.Globton = %False Trance.spekfak = 1.00 DIM Sp(0) AS STATIC SINGLE Trance.Speklim = NumberOfSpectralComponents(24+App.Globton,25,Trance.Spekfak, Sp(), 108) 'Calc_Speklim i = Trance.Speklim mPlay Troms.channel, 24, 120 IF Trance.Piperola_noot THEN Noteoff piperola.channel, Trance.piperola_noot: Trance.piperola_noot = %False IF Trance.Humanola_noot THEN Noteoff humanola.channel, Trance.humanola_noot: Trance.humanola_noot = %False IF Trance.Harma_noot THEN Noteoff harma.channel, Trance.harma_noot: Trance.harma_noot = %False IF Trance.Trump_noot THEN Noteoff Trump.channel, Trance.trump_noot: Trance.trump_noot = %False IF Trance.Bourdonola_noot THEN Noteoff bourdonola.channel, Trance.bourdonola_noot: Trance.bourdonola_noot = %False IF Trance.Ake_noot THEN Noteoff Ake.channel, Trance.Ake_noot: Trance.Ake_noot = %False Noteoff Autosax.channel, Trance.Sax_noot : Trance.Sax_noot = %False NoteOff Piano.channel, Trance.piano_noot : Trance.Piano_noot = %False InstrumPlay So Trance.So_Noot = %False DO noot = SpectralNoteF(24+ App.Globton, i, Trance.spekfak, %ExpSpec) IF ISFALSE noot THEN EXIT LOOP ' microtonal pitches first: IF PlayVacca (noot, 82, 20) THEN DECR i ITERATE DO END IF IF PlayLlor (noot, 100, 20) THEN DECR i ITERATE DO END IF IF FRAC(noot) > 27 AND FRAC(noot) < 73 THEN IF noot >= 72 AND noot <= Tubi.hightes THEN mPlay Tubi.channel, noot - 48, 120 DECR i ITERATE DO ELSEIF noot >= 55 AND noot <=Puff.hightes THEN mPlay Puff.channel, noot - 48, 48 DECR i ITERATE DO END IF END IF ' normal pitches: IF noot <= Tubi.hightes AND ISFALSE Trance.tubi_noot THEN mPlay Tubi.channel, noot, 120 : TRance.tubi_noot = noot ELSEIF noot <= Piperola.hightes AND ISFALSE Trance.piperola_Noot THEN mPlay Piperola.channel, noot, 64: Trance.piperola_noot = noot ELSEIF noot <= Humanola.hightes AND ISFALSE Trance.humanola_Noot THEN mPlay Humanola.channel, noot, 64: Trance.humanola_noot = noot ELSEIF noot <= Vibi.hightes AND ISFALSE Trance.Vibi_Noot THEN mPlay Vibi.channel, noot, 120 : Trance.vibi_noot = noot ELSEIF noot <= Piano.hightes AND ISFALSE Trance.piano_noot THEN mPlay Piano.channel, noot, 84 : Trance.piano_noot = noot ELSEIF noot <= Harma.Hightes AND ISFALSE Trance.harma_noot THEN mPlay Harma.channel, noot, 100 : Trance.harma_noot = noot ELSEIF noot <= Puff.Hightes AND ISFALSE Trance.puff_noot THEN mPlay Puff.channel, noot, 48 : Trance.puff_noot = noot ELSEIF noot <= Trump.Hightes AND ISFALSE Trance.trump_noot THEN mPlay Trump.channel, noot, 64: Trance.Trump_Noot = noot ELSEIF noot <= Bourdonola.hightes AND ISFALSE Trance.bourdonola_noot THEN mPlay Bourdonola.channel, noot, 64 : Trance.bourdonola_noot = noot ELSEIF noot <= Ake.hightes AND ISFALSE Trance.Ake_noot THEN mPlay Ake.channel, noot, 64: Trance.ake_noot = noot ELSEIF noot <= Klung.hightes AND ISFALSE Trance.Klung_noot THEN mPlay Klung.channel, noot, 120 : Trance.klung_noot = noot ELSEIF noot <= So.hightes AND ISFALSE Trance.So_Noot THEN AddNote2Har So.Har(1), noot, 80 InstrumPlay So Trance.So_noot = noot ELSEIF noot <= AutoSax.Hightes AND ISFALSE Trance.Sax_Noot THEN mPlay AutoSax.channel, noot ,78: Trance.Sax_Noot = noot ELSEIF noot <= Belly.hightes AND ISFALSE Trance.Belly_Noot THEN 'Play Belly.channel, noot, 64 : Trance.Belly_noot = noot IF PlayBelly (noot, 64, 25) THEN Trance.Belly_noot = noot ' ELSEIF ISFALSE Trance.Vacca_noot AND PlayVacca (noot,64, 25) THEN ' Trance.Vacca_noot = noot ' ELSEIF ISFALSE Trance.Llor_noot AND PlayLlor (noot, 120, 30) THEN ' Trance.Llor_noot = noot END IF DECR i LOOP UNTIL i <= 0 IF Trance.piano_noot <> App.Globton + 24 THEN mPlay Piano.channel, App.Globton + 24, 120 END IF IF Trance.trump_noot <> App.Globton + 36 THEN mPlay Trump.channel, App.Globton + 36, 120 END IF Task(%Trance_End).freq = App.tempo / (60 * 4) ' 8"16) CASE 4 InstrumPlay So Trance.So_Noot = %False Noteoff Autosax.channel, Trance.Sax_noot : Trance.Sax_noot = %False NoteOff Piano.channel, Trance.piano_noot : Trance.Piano_noot = %False Task(%Trance_End).freq = App.tempo / 60 ' 2" IF Trance.Bourdonola_noot <> App.Globton + 36 THEN mPlay Bourdonola.channel, App.Globton + 36, 120 END IF CASE 5 ' give notes off command only when all motors are stopped !!! Controller Ake.channel, 1, %False : Ake.ctrl(1) = %False Task(%Trance_End).freq = 1 IF Trance.Humanola_noot <> App.Globton + 36 + 7 THEN mPlay Humanola.channel, App.Globton + 36, 120 END IF mPlay Bourdonola.channel, 34, 127 ' lite CASE 6 Controller Piperola.channel, 7, %False : Piperola.ctrl(7) = %False NoteOff Piano.channel, App.Globton + 12 IF Trance.Harma_Noot <> App.Globton + 36 THEN mPlay Harma.channel, App.Globton + 36, 120 END IF mPlay Bourdonola.channel, 33, 127 ' lite CASE 7 Controller Bourdonola.channel, 1, %False : Bourdonola.ctrl(1) = %False mPlay Bourdonola.channel, 32, 127 ' lite CASE 8 Controller Trump.channel, 7 , %False : Trump.ctrl(7) = %False mPlay Harma.channel, 95, %True ' rode led spot CASE 9 Controller Humanola.channel, 7, %False : Humanola.ctrl(7) = %False mPlay Harma.channel, 94, %True ' rode led-spot CASE 10 IF Task(%Trance_Hu).swit THEN stoptask %Trance_Hu Controller Harma.channel, 7, %False : Harma.ctrl(7) = %False Controller Harma.channel, 66, %False : Harma.ctrl(66) = %False mPlay Troms.channel, 18, %True CASE 11 MM_Vibi_Off Task(%Trance_End).freq = App.tempo / (60 * 6) ' 12" mPlay Troms.channel, 19, %True CASE 12 ' laat motors uitbollen mPlay Troms.channel, 20, %True CASE ELSE IF Task(%Trance_sp).swit THEN StopTask %Trance_Sp StopTask %Trance_End MM_AllOff END SELECT SetDlgItemText gh.Cockpit, %GMT_MSG2, "Ending section " & STR$(cnt) & " /12" & "tc= " & STR$(App.Globton) INCR cnt END SUB 'SUB Calc_Speklim () ' ' Trance must be a global here! ' ' can now be replaced by: ' DIM Sp(0) AS STATIC SINGLE ' Trance.Speklim = NumberOfSpectralComponents(24+App.Globton,25,Trance.Spekfak, Sp(), 108) 'END SUB 'FUNCTION Calc_Speklim_Krom (BYVAL lonote AS INTEGER, BYVAL hinote AS INTEGER) AS INTEGER ' ' can now be replaced by: (new functions in g_mus.dll) ' DIM Sp(0) AS STATIC SINGLE ' Trance.Speklim = NumberOfSpectralComponents(lonote,100,Trance.Spekfak, Sp(),hinote) 'END FUNCTION SUB Trance_Test () ' may become a spectral study for quartertone piano's STATIC sfaks() AS SINGLE ' spektraalexponenten STATIC spek() AS SINGLE ' spectra STATIC i AS LONG STATIC cnt AS LONG IF ISFALSE Task(%Trance_Test).tog THEN REDIM sfaks(0) AS STATIC SINGLE REDIM spek(0) AS STATIC SINGLE i = %False sfaks(0) = 0.707 ' = SQR(2) / 2 cnt = %False Task(%Trance_Test).freq = 4 Task(%Trance_Test).tog = %True END IF IF ISFALSE cnt THEN NoteOff Piano.channel, Spek(UBOUND(Spek)) 'do INCR i REDIM PRESERVE sfaks(i) sfaks(i) = NextSpectralFactor (App.Globton + 24, 100, sfaks(i-1),spek(),96) ' tc, resolution, previous fak, spek, hilim 'loop until sfaks(i) = %False IF ISFALSE sfaks(i) THEN stoptask %TRance_Test 'Play Tubi.channel, 36, 120 mPlay Piano.channel, App.Globton + 24, 72 INCR cnt SetDlgItemText gh.Cockpit, %GMT_TITLE, "Sfak=" & STR$(sfaks(i)) SetDlgItemText gh.Cockpit, %GMT_AUTHOR, STR$(i) Task(%Trance_test).freq = 4 ELSE NoteOff Piano.channel, spek(cnt-1) mPlay Piano.channel, spek(cnt), 72 - cnt 'Play Tubi.channel, Spek(cnt), 120 INCR cnt IF cnt > UBOUND(Spek) THEN cnt = %False END IF Task(%TRance_test).freq = 20 END IF END SUB