' ******************************************* ' * Namuda Study # * ' * 'Links' * ' * 'Jin Hyun Links' * ' * 'Collis' * ' * 'Force' * ' * Godfried-Willem Raes * ' * 2010-2017 * ' ******************************************* ' Namuda choreography by Godfried-Willem Raes 'gesture recognition experiments: using doppler-ii 'we now can distinguish 8 gestural shapes (+ 1 non-shape) ''Links' , for dominica & gwr duo : (doppler code) 03.04.2010 - 20.04.2010 ' to be used with the omnidirectional ii2010 receivers. ' this uses fuzzy gesture analysis throughout. '11.04.2015: mapping for the new machine added. '06.06.2015: Forces coding recycled for Dansen production. '12.06.2016: Bello study revised. '20.02.2019: Version worked out with Emilie, for WDR3. %JinHyun_Links = 49 ' 5' science demo version for Jin Hyun Kim (recorded with Mocap system) %Collis_Links = 50 ' Study #3, Collis for Lazara Rosell Albear %Domi_Links = 48 'scoring task - Links Dominica, premiered with Angela Rawlings 'feature analysis coding %Collision_Trigger = 36 %Theacol_Trigger = 37 %Slowdown_Trigger = 38 : %Force_Slowdown_Trigger = 54 %Speedup_Trigger = 39 %Implode_Trigger = 40 %Explode_Trigger = 41 %Fluency_Trigger = 42 %Freeze_Trigger = 43 : %ForFre_Trigger = 59 %Fixspeed_Trigger = 44 : %Force_Fixspeed_Trigger = 60 %Edgy_Trigger = 46 'also does the airborne property %Jump_Trigger = 47 %ButohHurdy = 53 '56 'spectral mapping - 2-dimensional XY - also used in Links. %Bello_Links = 18 ' 11.04.2015 %Bello_Ouverture = 17 %Bello_Speedup = 19 %Bello_Finale = 20 ' 18.04.2015 %edgy_alleen = 52 %links_Smooth = 53 DECLARE FUNCTION Init_Links AS LONG 'duo 'compositional application and mapping code for 'Links' DECLARE SUB Domi_Implode_Trig () '09.04.2010 - tubi vibi xy DECLARE SUB Domi_Implode_Trig_Stop () DECLARE SUB Domi_Explode_Trig () '03.04.2010 - klung simba springers DECLARE SUB Domi_Explode_Trig_Stop () '09.04.2010 DECLARE SUB Domi_Speedup_Trig () '04.04.2010 - ob, korn, autosax DECLARE SUB Domi_Speedup_Trig_Stop () '08.04.2010 DECLARE SUB Domi_Slowdown_Trig () '02.04.2010 - piperola DECLARE SUB Domi_Force_Slowdown_Trig () '13.01.2013 - piperola & bomi DECLARE SUB Domi_Theacol_Trig () '05.04.2010 - puff DECLARE SUB Domi_Collision_Trig () '10.07.2009 - 11.04.2010 Troms, snar, vacca, thunderwood, psch DECLARE SUB Domi_Fluency_Trig () '06.04.2010 - 10.04.2010 Qt DECLARE SUB Domi_Freeze_Trig () '07.04.2010 - Bourdonola DECLARE SUB Domi_ForFre_Trig () '13.01.2013 - ending for Forces #30 DECLARE SUB Domi_Freeze_Trig_Stop () '16.05.2010 DECLARE SUB Domi_Fixspeed_Trig () '11.04.2010 - Toypi DECLARE SUB Domi_Force_Fixspeed_Trig () '13.01.2013 - Toypi & Spiro DECLARE SUB Domi_Edgy_Trig () '06.05.2010 - piano - qt DECLARE SUB Domi_Edgy_Trig_xy () '06.05.2010 - xy - qt -alternative code for the above task. DECLARE SUB Domi_Edgy_Trig_Stop () DECLARE SUB Domi_Jump_Trig () '12.05.2010 DECLARE SUB Domi_Jump_Trig_Stop () DECLARE SUB Domi_Links () '10.04.2010 - scoring DECLARE SUB Bello_Links () DECLARE SUB Bello_Ouverture () DECLARE SUB Bello_Speedup () DECLARE SUB Bello_Stop () DECLARE SUB Bello_Finale () FUNCTION Init_Links AS LONG ClearTasks ' msgbox "links!" ' gesture classification tasks based on correlation Task(%Domi_Links).naam = "" 'scoring task - Links, as done with Angela Rawlings Task(%Domi_Links).cptr = CODEPTR(Domi_Links) Task(%Domi_Links).freq = 1 Task(%Domi_Links).flags = %False Task(%Collis_Links).naam = "" 'scoring task - Collis, as done with Lazara Rosell Albear Task(%Collis_Links).cptr = CODEPTR(Collis_Links) Task(%Collis_Links).freq = 1 Task(%Collis_Links).flags = %False Task(%JinHyun_Links).naam = "" 'scoring task - Links, as done for Jin Hyun Kim Task(%JinHyun_Links).cptr = CODEPTR(JinHyun_Links) Task(%JinHyun_Links).freq = 1 Task(%JinHyun_Links).flags = %False Task(%Implode_Trigger).naam = "Implode" Task(%Implode_Trigger).cptr = CODEPTR(Domi_Implode_Trig) Task(%Implode_Trigger).freq = 120 '256 Task(%Implode_Trigger).flags = %False '%PERTIM_Task '%False TaskEX(%Implode_Trigger).stopCptr = CODEPTR(Domi_Implode_Trig_Stop) Task(%Explode_Trigger).naam = "Explode" Task(%Explode_Trigger).cptr = CODEPTR(Domi_Explode_Trig) Task(%Explode_Trigger).freq = 121 '256 Task(%Explode_Trigger).flags = %False ' %PERTIM_Task '%False TaskEX(%Explode_Trigger).stopCptr = CODEPTR(Domi_Explode_Trig_Stop) Task(%Speedup_Trigger).naam = "SpeedUp" Task(%Speedup_Trigger).cptr = CODEPTR(Domi_SpeedUp_Trig) Task(%Speedup_Trigger).freq = 129 '256 '100 Task(%Speedup_Trigger).flags = %PERTIM_Task ' %False TaskEX(%Speedup_Trigger).stopcptr = CODEPTR(Domi_SpeedUp_Trig_Stop) 'korn,sax, ob Task(%Slowdown_Trigger).naam = "Slowdown" Task(%Slowdown_Trigger).cptr = CODEPTR(Domi_Slowdown_Trig) Task(%Slowdown_Trigger).freq = 130 '256 '128 '72 Task(%Slowdown_Trigger).flags = %PERTIM_Task '%False TaskEX(%Slowdown_Trigger).stopcptr = CODEPTR(MM_Piperola_Off) ' alternative version with Bomi added: Task(%Force_Slowdown_Trigger).naam = "Slowdown" Task(%Force_Slowdown_Trigger).cptr = CODEPTR(Domi_Force_Slowdown_Trig) Task(%Force_Slowdown_Trigger).freq = 130 '256 '128 '72 Task(%Force_Slowdown_Trigger).flags = %PERTIM_Task '%False TaskEX(%Force_Slowdown_Trigger).stopcptr = CODEPTR(MM_Piperola_Off) Task(%Theacol_Trigger).naam = "TheaCol" Task(%Theacol_Trigger).cptr = CODEPTR(Domi_Theacol_Trig) Task(%Theacol_Trigger).freq = 100 '256 '128 '72 Task(%Theacol_Trigger).flags = %PERTIM_Task '%False Task(%Collision_Trigger).naam = "Collide" Task(%Collision_Trigger).cptr = CODEPTR(Domi_Collision_Trig) Task(%Collision_Trigger).freq = 100 '256 '128 '72 Task(%Collision_Trigger).flags = %PERTIM_Task ' %False Task(%Fluency_Trigger).naam = "Fluency" Task(%Fluency_Trigger).cptr = CODEPTR(Domi_Fluency_Trig) Task(%Fluency_Trigger).freq = 100 '256 '128 '72 Task(%Fluency_Trigger).flags = %False ' %PERTIM_Task '%False TaskEX(%Fluency_Trigger).stopcptr= CODEPTR(MM_Qt_Off) Task(%Freeze_Trigger).naam = "Freeze" Task(%Freeze_Trigger).cptr = CODEPTR(Domi_Freeze_Trig) Task(%Freeze_Trigger).freq = 20 Task(%Freeze_Trigger).flags = %False '%PERTIM_Task '%False TaskEX(%Freeze_Trigger).stopCptr = CODEPTR(Domi_Freeze_Trig_Stop) 'CODEPTR(MM_Bourdonola_Off) ' alternative version used only in Study #30: Forces: Task(%ForFre_Trigger).naam = "Freeze" Task(%ForFre_Trigger).cptr = CODEPTR(Domi_Force_Freeze_Trig) Task(%ForFre_Trigger).freq = 20 Task(%ForFre_Trigger).flags = %False '%PERTIM_Task '%False 'TaskEX(%ForFre_Trigger).stopCptr = CODEPTR(Domi_Freeze_Trig_Stop) 'CODEPTR(MM_Bourdonola_Off) - leave ON!!! Task(%Fixspeed_Trigger).naam = "FixSpeed" Task(%Fixspeed_Trigger).cptr = CODEPTR(Domi_Fixspeed_Trig) Task(%Fixspeed_Trigger).freq = 20 Task(%Fixspeed_Trigger).flags = %False TaskEX(%Fixspeed_Trigger).stopCptr = CODEPTR(MM_Toypi_Off) ' alternative version using toypi and spiro: Task(%Force_Fixspeed_Trigger).naam = "FixSpeed" Task(%Force_Fixspeed_Trigger).cptr = CODEPTR(Domi_Force_Fixspeed_Trig) Task(%Force_Fixspeed_Trigger).freq = 20 Task(%Force_Fixspeed_Trigger).flags = %False TaskEX(%Force_Fixspeed_Trigger).stopCptr = CODEPTR(MM_Spiro_Off) Task(%Edgy_Trigger).naam = "EdgSmth" Task(%Edgy_Trigger).cptr = CODEPTR(Domi_Edgy_Trig) 'Task(%Edgy_Trigger).cptr = CODEPTR(Domi_Edgy_Trig_xy) '_xy: alternative with xy instead of piano.. Task(%Edgy_Trigger).freq = 8 Task(%Edgy_Trigger).flags = %False TaskEX(%Edgy_Trigger).stopCptr = CODEPTR(Domi_Edgy_Trig_Stop) Task(%Edgy_alleen).naam = "Edgy" Task(%Edgy_alleen).cptr = CODEPTR(Domi_Edgy_Trig_xy) '_xy: alternative with xy instead of piano.. Task(%Edgy_alleen).freq = 8 Task(%Edgy_alleen).flags = %False Task(%Links_Smooth).naam = "Smooth" Task(%Links_Smooth).cptr = CODEPTR(Links_smooth_Trig) Task(%Links_Smooth).freq = 8 Task(%Links_Smooth).flags = %False Task(%Jump_Trigger).naam = "Jump" Task(%Jump_Trigger).cptr = CODEPTR(Domi_Jump_Trig) Task(%Jump_Trigger).freq = 8 Task(%Jump_Trigger).flags = %False TaskEX(%Jump_Trigger).stopCptr = CODEPTR(Domi_Jump_Trig_Stop) Task(%Bello_Links).naam = "Bello" Task(%Bello_Links).cptr = CODEPTR(Bello_Links) Task(%Bello_Links).freq = 120 Task(%Bello_Links).flags = %False TaskEX(%Bello_Links).stopCptr = CODEPTR(Bello_Stop) Task(%Bello_Speedup).naam = "Accel" Task(%Bello_Speedup).cptr = CODEPTR(Bello_Speedup) Task(%Bello_Speedup).freq = 12 Task(%Bello_Speedup).flags = %False TaskEX(%Bello_Speedup).stopCptr = CODEPTR(Bello_Stop) Task(%Bello_ouverture).naam = "Ouvertur" Task(%Bello_ouverture).cptr = CODEPTR(Bello_Ouverture) Task(%Bello_ouverture).freq = 3 Task(%Bello_ouverture).flags = %False TaskEX(%Bello_ouverture).stopCptr = CODEPTR(Bello_Stop) Task(%Bello_Finale).naam = "Finale" Task(%Bello_Finale).cptr = CODEPTR(Bello_Finale) Task(%Bello_Finale).freq = 12 Task(%Bello_Finale).flags = %False 'TaskEX(%Bello_Finale).stopCptr = CODEPTR(Bello_Stop) END FUNCTION '`-------------------------------------------------------------------------------------------- ' an extensive study in Namuda dance, 2010 ' premiere try out 20.04.2010 with angela rawlings and the author. ' This code often used for lectures and science demonstrations by gwr. SUB Domi_Fluency_Trig () ' here we look only into the surface data on order to detect fluency - mapping on Qt ' 06.04.2010: using gesture_analyser ' 09.04.2010: rescaled. ' 18.04.2010: user interface disabled. ' 25.04.2010: code rewritten to reflect the fluency property better. ' stuck notes problems. ' STATIC slnr AS DWORD ' STATIC xtrig, ytrig, ztrig AS LONG STATIC xnoot, ynoot, znoot, lites AS DWORD LOCAL n AS DWORD STATIC sens AS SINGLE IF ISFALSE Task(%Fluency_Trigger).tog THEN ' IF ISFALSE Task(%Fluency_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Fluency_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Fluency_Trigger).SliderNumbers(0) ' Slider(slnr).value = 80 ' 63 '90 '64 '40 '2 '64 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF sens = 0.625 '80 / 128 MM_Qt_On Controller Qt.channel, 7, 50 IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Fluency_Trigger).tog = %True END IF ' on fluency, do something... 'sens = Slider(slnr).value / 128.0 ' values are normalised IF gesture.flue(0) > sens THEN ' derived from the percentual standard deviation (inverted) 'hoe hoger gesture.flue(0) hoe sterker de eigenschap fluency IF (gesture.flue_dur(0) MOD 8) = 1 THEN '25.04 n = MIN(Qt.lowtes + (gesture.flue_val(0)* 72), Qt.Hightes) IF n <> xnoot THEN IF xnoot THEN IF ISFALSE znoot THEN NoteOff Qt.channel, xnoot RESET xnoot ELSE IF znoot <> xnoot THEN NoteOff Qt.channel, xnoot RESET xnoot END IF END IF END IF IF n <> znoot THEN xnoot = n mPlay Qt.channel,xnoot, MIN(gesture.flue(0) * 64,120) END IF END IF END IF ELSE IF xnoot THEN Noteoff Qt.channel, xnoot RESET xnoot END IF END IF IF gesture.flue(1) > sens THEN IF (gesture.flue_dur(1) MOD 8) = 1 THEN n = MIN(Qt.lowtes +2 + (gesture.flue_val(1)* 72), Qt.Hightes) IF n <> ynoot THEN IF ynoot THEN NoteOff Qtq.channel, ynoot ynoot = n mPlay Qtq.channel,ynoot, MIN(gesture.flue(1) * 64, 127) END IF END IF ELSE IF ynoot THEN NoteOff QtQ.channel, ynoot RESET ynoot END IF END IF IF gesture.flue(2) > sens THEN IF (gesture.flue_dur(2) MOD 9) = 1 THEN n = MIN(Qt.lowtes +2 + (gesture.flue_val(2)* 72), Qt.HighTes) IF znoot THEN IF znoot <> xnoot THEN IF znoot <> n THEN NoteOff Qt.channel, znoot RESET znoot IF n <> xnoot THEN znoot = n mPlay Qt.channel,znoot, MIN(gesture.flue(2) * 64, 127) END IF END IF END IF END IF END IF ELSE IF znoot THEN mPlay Qt.channel, znoot, %False RESET znoot END IF END IF IF gesture.flue(3) > sens THEN IF ISFALSE lites THEN MM_Qt_On %MM_Blue lites = %True END IF ELSE IF lites THEN MM_Qt_Off %MM_Blue RESET lites END IF END IF END SUB SUB Domi_Fixspeed_Trig () ' here we look only into the speed data on order to detect speed constancy ' 11.04.2010: using FIR gesture_analyser , so gesture.algo must be 1 ' 15.04.2010: added in Links. ' 18.04.2010: user interface disabled. 'STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig AS LONG STATIC xnoot, ynoot, znoot, lites AS DWORD ' LOCAL i AS DWORD STATIC sens AS SINGLE IF ISFALSE Task(%Fixspeed_Trigger).tog THEN ' IF ISFALSE Task(%Fixspeed_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Fixspeed_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Fixspeed_Trigger).SliderNumbers(0) ' Slider(slnr).value = 64 '28 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF sens = 0.5 '64 / 128 MM_Toypi_On IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Fixspeed_Trigger).tog = %True END IF ' on constant speed, do something... 'sens = Slider(slnr).value / 128 ' values are not normalised, but the property is!!! ' speedval can be as high has 190, but then never as fixspeed ' the higher gesture.fixspeed() the higher the significance of the property. IF gesture.fixspeed(0) > sens THEN IF ISFALSE xtrig THEN xnoot = MIN(Toypi.lowtes + (gesture.fixspeed_val(0)/2), Toypi.Hightes) mPlay Toypi.channel,xnoot, MIN(gesture.fixspeed(0) * 127,120) xtrig = %True END IF ELSE RESET xtrig END IF IF gesture.fixspeed(1) > sens THEN IF ISFALSE ytrig THEN ynoot = MIN(Toypi.lowtes + (gesture.fixspeed_val(1)/2), Toypi.Hightes) mPlay Toypi.channel,ynoot, MIN(gesture.fixspeed(1) * 127, 120) ytrig = %true END IF ELSE RESET ytrig END IF IF gesture.fixspeed(2) > sens THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same collision znoot = MIN(Toypi.lowtes + (gesture.fixspeed_val(2)/2), Toypi.HighTes) mPlay Toypi.channel,znoot, MIN(gesture.fixspeed(2) * 127, 120) ztrig = %True END IF ELSE RESET ztrig END IF IF gesture.fixspeed(3) > sens THEN IF ISFALSE lites THEN MM_Toypi_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Toypi_Off %MM_Lights RESET lites END IF END IF END SUB SUB Domi_Force_Fixspeed_Trig () ' here we look only into the speed data on order to detect speed constancy ' 11.04.2010: using FIR gesture_analyser , so gesture.algo must be 1 ' 15.04.2010: added in Links. ' 13.01.2013: version with Spiro added used in Namuda#30, Forces STATIC xtrig, ytrig, ztrig AS LONG STATIC xnoot, ynoot, znoot, lites AS DWORD STATIC xsnoot, ysnoot, zsnoot AS DWORD STATIC sens AS SINGLE IF ISFALSE Task(%Force_Fixspeed_Trigger).tog THEN sens = 0.5 '64 / 128 MM_Toypi_On MM_Spiro_On IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Force_Fixspeed_Trigger).tog = %True END IF ' on constant speed, do something... 'sens = Slider(slnr).value / 128 ' values are not normalised, but the property is!!! ' speedval can be as high has 190, but then never as fixspeed ' the higher gesture.fixspeed() the higher the significance of the property. IF gesture.fixspeed(0) > sens THEN IF ISFALSE xtrig THEN xnoot = MIN(Toypi.lowtes + (gesture.fixspeed_val(0)/2), Toypi.Hightes) xsnoot = MIN(Spiro.lowtes + (gesture.fixspeed_val(0)/2), Spiro.Hightes) mPlay Toypi.channel,xnoot, MIN(gesture.fixspeed(0) * 127,120) mPlay Spiro.channel, xsnoot, 36 xtrig = %True END IF ELSE RESET xtrig IF xsnoot THEN NoteOff Spiro.channel, xsnoot RESET xsnoot END IF END IF IF gesture.fixspeed(1) > sens THEN IF ISFALSE ytrig THEN ynoot = MIN(Toypi.lowtes + (gesture.fixspeed_val(1)/2), Toypi.Hightes) ysnoot = MIN(Spiro.lowtes + (gesture.fixspeed_val(1)/2), Spiro.Hightes) mPlay Toypi.channel,ynoot, MIN(gesture.fixspeed(1) * 127, 120) mPlay Spiro.channel, ysnoot, 36 ytrig = %true END IF ELSE RESET ytrig IF ysnoot THEN NoteOff Spiro.channel, ysnoot RESET ysnoot END IF END IF IF gesture.fixspeed(2) > sens THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same trigger znoot = MIN(Toypi.lowtes + (gesture.fixspeed_val(2)/2), Toypi.HighTes) zsnoot = MIN(Spiro.lowtes + (gesture.fixspeed_val(2)/2), Spiro.Hightes) mPlay Toypi.channel,znoot, MIN(gesture.fixspeed(2) * 127, 120) mPlay Spiro.channel, zsnoot, 36 ztrig = %True END IF ELSE RESET ztrig IF zsnoot THEN NoteOff Spiro.channel, zsnoot RESET zsnoot END IF END IF IF gesture.fixspeed(3) > sens THEN IF ISFALSE lites THEN MM_Toypi_On %MM_Lights MM_Spiro_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Toypi_Off %MM_Lights MM_Spiro_Off %MM_Lights RESET lites END IF END IF END SUB SUB Domi_Force_Freeze_Trig () ' was: SUB Domi_Old_Freeze_Trig (), remmed out. ' 19.04.2010: piano part added. This task runs for 1'40" = 100" ' 12.01.2013: recycled for use in ending of Forces, #30, Namuda Study ' STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig, cnt AS LONG STATIC xnoot, ynoot, znoot, lites AS DWORD DIM pp_notes(0 TO 16) AS STATIC INTEGER ' LOCAL i AS DWORD ' LOCAL sens, d AS SINGLE IF ISFALSE Task(%ForFre_Trigger).tog THEN MM_Bourdonola_On 'Bourdonola.ctrl(1) = 70 'Controller Bourdonola.channel, 1, 70 'low wind pressure, normal = 92 'for piano part: pp_notes(0) = 33 pp_notes(1) = 45 pp_notes(2) = 50 pp_notes(3) = 57 pp_notes(4) = 65 pp_notes(5) = 69 pp_notes(6) = 79 pp_notes(7) = 86 pp_notes(8) = 88 pp_notes(9) = 91 pp_notes(10) = 93 pp_notes(11) = 95 pp_notes(12) = 96 pp_notes(13) = 98 pp_notes(14) = 102 pp_notes(15) = 105 pp_notes(16) = 108 'task.freq is 20Hz RESET cnt, xtrig, ytrig, ztrig, xnoot, ynoot, znoot IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%ForFre_Trigger).tog = %True END IF ' on freeze, do something... ' sens = Slider(slnr).value / 128.0 ' values are normalised IF gesture.freeze(0) THEN IF ISFALSE xtrig THEN xnoot = 38 ' re mPlay Bourdonola.channel,xnoot, 64 xtrig = %True END IF ELSE IF xnoot THEN mPlay Bourdonola.channel, xnoot, %False xnoot = %False END IF xtrig = %False END IF IF gesture.freeze(1) THEN IF ISFALSE ytrig THEN ynoot = 45 'la mPlay Bourdonola.channel, ynoot, 64 ytrig = %true END IF ELSE IF ynoot THEN mPlay Bourdonola.channel, ynoot, %False ynoot = %False END IF ytrig = %False END IF IF gesture.freeze(2) THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same freeze znoot = 53 ' fa mPlay Bourdonola.channel,znoot, 64 ztrig = %True END IF ELSE IF znoot THEN mPlay Bourdonola.channel, znoot, %False znoot = %False END IF ztrig = %False END IF IF gesture.freeze(3) THEN 'if (xnoot OR ynoot or znoot) then 'maybe bug on binary eval., so we better write: ' IF xnoot + ynoot + znoot THEN ' MM_Bourdonola_Off %MM_Notes ' xnoot = %False ' ynoot = %False ' znoot = %False ' END IF 'better: lower windpressure... now done in domi_link, the score itself. IF ISFALSE lites THEN MM_Bourdonola_On %MM_Lights lites = %True END IF ELSE ' IF Bourdonola.ctrl(1) < 60 THEN ' INCR bourdonola.ctrl(1) ' Controller Bourdonola.channel, 1, bourdonola.ctrl(1) ' END IF IF lites THEN MM_Bourdonola_Off %MM_Lights RESET lites END IF END IF INCR cnt ' increments at 20Hz 'player piano part: [added 19.04.2010] - cnt loopt tot 2000 in 'Links' ' IF ISFALSE (cnt MOD 166) THEN ' IF (cnt\166) <= UBOUND(pp_notes) THEN ' mPlay piano.channel, pp_notes(cnt\166), MAX(120 - ((cnt\166)*9), 8) ' END IF ' END IF 'faster version: IF ISFALSE (cnt MOD 125) THEN IF (cnt\125) <= UBOUND(pp_notes) THEN mPlay piano.channel, pp_notes(cnt\125), MAX(120 - ((cnt\125)*7), 8) END IF END IF END SUB SUB Domi_Freeze_Trig () ' here we look only into the surface data in order to detect absense of movement ' 07.04.2010: using gesture_analyser ' 15.04.2010: now using the specific property analyser ' 19.04.2010: piano part added. This task runs for 1'40" = 100" ' new version: bourdonola only, stops playing when we freeze ' STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig, cnt AS LONG STATIC xnoot, ynoot, znoot, lites AS DWORD ' DIM pp_notes(0 TO 16) AS STATIC INTEGER ' LOCAL i AS DWORD ' LOCAL sens, d AS SINGLE IF ISFALSE Task(%Freeze_Trigger).tog THEN ' IF ISFALSE Task(%Freeze_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Freeze_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Freeze_Trigger).SliderNumbers(0) ' Slider(slnr).value = 2 '64 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF MM_Bourdonola_On Bourdonola.ctrl(1) = 70 Controller Bourdonola.channel, 1, 70 'low wind pressure, normal = 92 ' 'for piano part: ' pp_notes(0) = 33 ' pp_notes(1) = 45 ' pp_notes(2) = 50 ' pp_notes(3) = 57 ' pp_notes(4) = 65 ' pp_notes(5) = 69 ' pp_notes(6) = 79 ' pp_notes(7) = 86 ' pp_notes(8) = 88 ' pp_notes(9) = 91 ' pp_notes(10) = 93 ' pp_notes(11) = 95 ' pp_notes(12) = 96 ' pp_notes(13) = 98 ' pp_notes(14) = 102 ' pp_notes(15) = 105 ' pp_notes(16) = 108 ' 'task.freq is 20Hz RESET cnt, xtrig, ytrig, ztrig, xnoot, ynoot, znoot IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Freeze_Trigger).tog = %True END IF ' on freeze, do something... ' sens = Slider(slnr).value / 128.0 ' values are normalised IF (gesture.freeze(0)) THEN AddNote2Har Bourdonola.Har(1), Bourdonola.LowTes + 24 * Gesture.freeze_val(0), 20 IF (gesture.freeze(1)) THEN AddNote2Har Bourdonola.Har(1), Bourdonola.LowTes + 24 * Gesture.freeze_val(1), 20 IF (gesture.freeze(2)) THEN AddNote2Har Bourdonola.Har(1), Bourdonola.LowTes + 24 * Gesture.freeze_val(2), 20 InstrumPlay Bourdonola ' IF ISFALSE xtrig THEN ' xnoot = 38 ' re ' mPlay Bourdonola.channel,xnoot, 64 ' xtrig = %True ' END IF ' ELSE ' IF xnoot THEN ' mPlay Bourdonola.channel, xnoot, %False ' xnoot = %False ' END IF ' xtrig = %False ' END IF ' ' IF ISFALSE(gesture.freeze(1)) THEN ' IF ISFALSE ytrig THEN ' ynoot = 45 'la ' mPlay Bourdonola.channel, ynoot, 64 ' ytrig = %true ' END IF ' ELSE ' IF ynoot THEN ' mPlay Bourdonola.channel, ynoot, %False ' ynoot = %False ' END IF ' ytrig = %False ' END IF ' ' IF ISFALSE(gesture.freeze(2)) THEN ' IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same freeze ' znoot = 53 ' fa ' mPlay Bourdonola.channel,znoot, 64 ' ztrig = %True ' END IF ' ELSE ' IF znoot THEN ' mPlay Bourdonola.channel, znoot, %False ' znoot = %False ' END IF ' ztrig = %False ' END IF ' ' IF gesture.freeze(3) THEN ' 'if (xnoot OR ynoot or znoot) then 'maybe bug on binary eval., so we better write: ' ' IF xnoot + ynoot + znoot THEN ' ' MM_Bourdonola_Off %MM_Notes ' ' xnoot = %False ' ' ynoot = %False ' ' znoot = %False ' ' END IF ' 'better: lower windpressure... now done in domi_link, the score itself. ' ' IF Gesture.freeze_dur(0) * Gesture.freeze_dur(1) * Gesture.freeze_dur(2) THEN ' ' d = MAX(Gesture.freeze_dur(0) , Gesture.freeze_dur(1) , Gesture.freeze_dur(2)) ' ' d = d / 256 'convert to seconds ' ' IF d < 60 THEN ' ' IF Bourdonola.ctrl(1) <> 60 -d THEN ' ' Controller Bourdonola.channel, 1, 60 - d ' ' Bourdonola.ctrl(1) = 60-d ' ' END IF ' ' END IF ' ' END IF ' IF ISFALSE lites THEN ' MM_Bourdonola_On %MM_Lights ' lites = %True ' END IF ' ELSE ' ' IF Bourdonola.ctrl(1) < 60 THEN ' ' INCR bourdonola.ctrl(1) ' ' Controller Bourdonola.channel, 1, bourdonola.ctrl(1) ' ' END IF ' IF lites THEN ' MM_Bourdonola_Off %MM_Lights ' RESET lites ' END IF ' END IF ' INCR cnt ' increments at 20Hz 'player piano part: [added 19.04.2010] - cnt loopt tot 2000 in 'Links' ' IF ISFALSE (cnt MOD 166) THEN ' IF (cnt\166) <= UBOUND(pp_notes) THEN ' mPlay piano.channel, pp_notes(cnt\166), MAX(120 - ((cnt\166)*9), 8) ' END IF ' END IF ' faster version: ' IF ISFALSE (cnt MOD 125) THEN ' IF (cnt\125) <= UBOUND(pp_notes) THEN ' mPlay piano.channel, pp_notes(cnt\125), MAX(120 - ((cnt\125)*7), 8) ' END IF ' END IF END SUB SUB Domi_Freeze_Trig_Stop () 'also used for Study #30, Forces, called by Domi_Force_Freeze_Trig () MM_Piano_Off MM_Bourdonola_Off END SUB SUB Domi_Implode_Trig () ' here we look only into the surface data in order to detect sudden shrinking (imploding gesture) ' 06.04.2010: now attempting to use gesture_classify ' using gesture_analyser ' 09.04.2010 rescaled. Should be improved.... ' 15.04.2010: works best with algo 1 ' trouble: sometimes gets stuck on one and the same high note... ' 20.04.2010: was too sensitive on the premiere. ' 25.04.2010: highly improved now. 'STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig, lites AS LONG LOCAL xnoot, ynoot AS LONG 'LOCAL i AS DWORD STATIC sens AS SINGLE IF ISFALSE Task(%Implode_Trigger).tog THEN ' IF ISFALSE Task(%Implode_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Implode_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Implode_Trigger).SliderNumbers(0) ' IF ISFALSE gesture.algo THEN ' Slider(slnr).value = 10 '2 '64 ' ELSE ' Slider(slnr).value = 15 ' END IF ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF 'sens = 0.117 '= 15 / 128.0 sens = 0.001 '@pDoppler.noise '* 3 RESET xtrig, ytrig, ztrig, lites MM_Xy_On 'sometimes failing! MM_Vibi_On MM_Tubi_On IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Implode_Trigger).tog = %True EXIT SUB END IF ' on decreasing body surface (shrinking), do something... ' sens = Slider(slnr).value / 128.0 ' values are normalised 'with identical scaling in the property assignation procedure: [18.04.2010] IF (ISFALSE(gesture.explo(0))) AND (gesture.implo(0)> @pDoppler.noise) THEN ' IF ISFALSE xtrig THEN 'IF ISFALSE gesture.implo_dur(0) MOD 4 THEN 'the property is set as soon as dur >= 1 IF gesture.implo_dur(0) MOD 4 = 1 THEN xnoot = MIN(Xy.lowtes + 2 + (gesture.implo(0)* 150), Xy.Hightes) * 2.0 IF ISFALSE xnoot MOD 2 THEN ' mPlay Xy.channel,xnoot\2 , MIN(gesture.implo_val(0) * 100,127) mPlay Xy.channel,xnoot\2 , MIN((gesture.implo_val(0)^2) * 64,63) ELSE ' mPlay Xyq.channel, xnoot\2,MIN(gesture.implo_val(0) * 100,127) mPlay Xyq.channel, xnoot\2, MIN((gesture.implo_val(0)^2) * 64,63) END IF ' mPlay Xy.channel, MIN(Xy.lowtes + 2 + (gesture.implo(0)* 320), Xy.Hightes), MAX(MIN(gesture.implo_val(0) * 127,127), 0) ' xtrig = %True END IF ' ELSE ' IF ISFALSE gesture.implo_dur(0) THEN '22.04 ' RESET xtrig ' END IF END IF ' IF gesture.implo(1) > gesture.explo(1) THEN IF (ISFALSE(gesture.explo(1))) AND (gesture.implo(1)> @pDoppler.noise ) THEN ' IF ISFALSE ytrig THEN 'IF ISFALSE gesture.implo_dur(1) MOD 6 THEN IF gesture.implo_dur(1) MOD 6 = 1 THEN ynoot = MIN(Tubi.lowtes +2 + (gesture.implo(1)* 100), Tubi.Hightes) * 2.0 IF ISFALSE (ynoot MOD 2) THEN mPlay Tubi.channel, ynoot\2, MIN(gesture.implo_val(1) * 60, 127) ELSE mPlay Tubi.channel, (ynoot\2)- 48, MIN(gesture.implo_val(1) * 60, 127) 'quartertones END IF ' ytrig = %true END IF ' ELSE ' IF ISFALSE gesture.implo_dur(1) THEN ' RESET ytrig ' END IF END IF 'IF gesture.implo(2) > gesture.explo(2) THEN IF (ISFALSE(gesture.explo(2))) AND (gesture.implo(2)> @pDoppler.noise ) THEN ' IF ISFALSE gesture.implo_dur(2) MOD 4 THEN IF gesture.implo_dur(2) MOD 4 = 1 THEN ' IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same collision mPlay Vibi.channel, MIN(Vibi.lowtes +2 + (gesture.implo(2)* 300), Vibi.HighTes), MIN((gesture.implo_val(2)^2) * 63, 64) ' ztrig = %True END IF ' ELSE ' IF ISFALSE gesture.implo_dur(2) THEN ' RESET ztrig ' END IF END IF IF gesture.implo(3) > gesture.explo(3) THEN IF ISFALSE lites THEN MM_Xy_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Xy_Off %MM_Lights RESET lites END IF END IF END SUB SUB Domi_Implode_Trig_Stop () MM_Xy_Off %MM_Lights END SUB SUB Domi_Explode_Trig () ' alternative property naming: Grow - Shrink , expand - coagulate, enlarge - decrease ' here we look only into the surface data on order to detect sudden explosive gesture ' this is an experiment only sofar... ' rewritten 05.04.2010 ' rewritter again 06.04.2010 using gesture_classify ' 06.04.2010: now using Gesture_Analyser task ' 09.04.2010: rescaled. ' 15.04.2010: troms added. ' 20.04.2010: was way too sensitive on the premiere of Links. ' 23.04.2010: returned but still not perfect. Springers is not such a great mapping... ' 25.04.2010: further fine tuning 'STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig, lites AS LONG STATIC od AS SINGLE LOCAL d AS SINGLE STATIC sens AS SINGLE 'LOCAL i AS DWORD IF ISFALSE Task(%Explode_Trigger).tog THEN ' IF ISFALSE Task(%Explode_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Explode_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Explode_Trigger).SliderNumbers(0) ' Slider(slnr).value = 10 '2 ''64 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF sens = 0.1 'was 0.09 on 20.04.2010 RESET xtrig, ytrig, ztrig, lites MM_Simba_On 'sometimes seems to fail. MM_Klung_On MM_Springers_On IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Explode_Trigger).tog = %True EXIT SUB END IF ' on increasing body surface (exploding, growing, expanding), do something... ' we can also try IF gesture.explo_val(0) > gesture.implo_val(0) then... since these values are now commensurable IF (ISFALSE gesture.implo(0)) AND (gesture.explo(0)> @pDoppler.noise) THEN 'dur condition makes no sense as it is always fullfilled. IF gesture.explo_dur(0) MOD 10 = 1 THEN mPlay Klung.channel, MIN(Klung.lowtes + (gesture.explo(0)* 100), Klung.Hightes), MIN(gesture.explo_val(0) * 127, 127) END IF END IF IF (ISFALSE gesture.implo(1)) AND (gesture.explo(1) > @pDoppler.noise) THEN IF gesture.explo_dur(1) MOD 16 = 1 THEN mPlay Simba.channel, MIN(77 + (gesture.explo(1) * 5),80) , MIN((gesture.explo_val(1) ^ 1.5) * 127 , 127 ) END IF END IF IF (ISFALSE gesture.implo(2)) AND (gesture.explo(2)> @pDoppler.noise) THEN 'still too sensitive. SELECT CASE gesture.explo_dur(2) 'units are 3.9ms CASE 1 TO 3 'shaker1 mPlay Springers.channel,72, MIN((gesture.explo_val(2)) * 255, 127) CASE 4 TO 6 'shaker2 mPlay Springers.channel, 79,MIN((gesture.explo_val(2)) * 255, 127) CASE 7 TO 10 'shaker 1 back mPlay Springers.channel, 73,MIN((gesture.explo_val(2)) * 255, 127) CASE 11 TO 14 'springer 1 mPlay Springers.channel, 36,MIN((gesture.explo_val(2)^1.5) * 127, 127) CASE 15 TO 19 '8 'shaker 2 back mPlay Springers.channel, 80,MIN((gesture.explo_val(2)) * 255, 127) CASE 20 TO 25 '10 'springer 2 mPlay Springers.channel, 37,MIN((gesture.explo_val(2)^1.5) * 127, 127) CASE 26 TO 32 '15 'springer 3 mPlay Springers.channel, 38,MIN((gesture.explo_val(2)^1.5) * 127, 127) CASE 33 TO 39 '21 'springer 4 mPlay Springers.channel, 39,MIN((gesture.explo_val(2)^1.5) * 127, 127) CASE 40 TO 47 '28 'springer 5 mPlay Springers.channel, 40,MIN((gesture.explo_val(2)^1.5) * 127, 127) CASE 48 TO 54 '35 to 45 '(> 35) and (<= 45) 'blue flashlight Controller Springers.channel, 70, MIN((gesture.explo_val(2)) * 127, 127) ztrig = %True CASE > 54 '200ms - still happens very often! 'siren '' mPlay Springers.channel, 24,MIN((gesture.explo_val(2)) * 127, 120) '' ztrig = %True END SELECT ELSE IF ztrig THEN ' mPlay Springers.channel, 24, %False 'sirene uit Controller Springers.channel, 70, %False 'zwaailicht END IF RESET ztrig END IF 'added 15.04.2010: IF gesture.explo_dur(0) * gesture.explo_dur(1) * gesture.explo_dur(2) THEN d = MAX(gesture.explo_dur(0),gesture.explo_dur(1),gesture.explo_dur(2))/ 0.256 'naar ms d = MAX(24, 48 - (d \ 40)) IF d > od THEN mPlay Troms.channel, d, gesture.explo(3) * 127 od = d END IF ELSE RESET od END IF IF (ISFALSE gesture.implo(3)) AND (gesture.explo(3) > 0.0) THEN IF ISFALSE lites THEN MM_Simba_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Simba_Off %MM_Lights RESET lites END IF END IF END SUB SUB Domi_Explode_Trig_stop () MM_Simba_Off %MM_Lights MM_Springers_Off MM_Klung_Off END SUB SUB Domi_Edgy_Trig () 'evaluation for gesture.edgy and gesture.smooth properties '06.05.2010 - piano - harmo '09.05.2010 - instrumentation changed to pp - qt, because we cannot startup harmo... '17.05.2010 - qt wind controll added. STATIC noot1, noot2, noot3, tog AS INTEGER STATIC wind AS SINGLE IF ISFALSE Task(%Edgy_Trigger).tog THEN ' MM_HarmO_On ' Controller HarmO.channel, 66, 127 ' Controller HarmO.channel, 1, 90 ' Controller HarmO.channel, 7, 100 MM_Piano_On ' added 12.08.2017 wind = qt.ctrl(7) MM_Qt_On Task(%Edgy_Trigger).tog = %True END IF IF gesture.edgy_dur(3) THEN 'if edgy, we select the piano noot1 = MIN(piano.lowtes + (gesture.edgy(0) * 127), piano.hightes) noot2 = MIN(piano.lowtes + (gesture.edgy(1) * 127), piano.hightes) noot3 = MIN(piano.lowtes + (gesture.edgy(2) * 127), piano.hightes) addnote2har piano.har(1), noot1, (@pDoppler.xa * 127) addnote2har piano.har(1), noot2, (@pDoppler.ya * 127) addnote2har piano.har(1), noot3, (@pDoppler.za * 127) Instrumplay Piano ELSE IF noot1 THEN Instrumplay Piano noot1 = %False END IF END IF IF gesture.smooth_dur(3) THEN 'íf smooth, we select Qt 'test with Qt addnote2har qt.har(1), MIN(qt.lowtes + (gesture.smooth(0) * 127), qt.hightes), @pDoppler.xa * 127 addnote2har qt.har(1), MIN(qt.lowtes + (gesture.smooth(1) * 127), qt.hightes), @pDoppler.ya * 127 addnote2har qt.har(1), MIN(qt.lowtes + (gesture.smooth(2) * 127), qt.hightes), @pDoppler.za * 127 instrumplay Qt ' Instrumplay HarmO tog = %True ELSE IF tog THEN ' Instrumplay Harmo instrumplay Qt tog = %False END IF END IF 'code added 17.05.2010 'qt wind controll in function of the property value: 'wind = (wind * 15/16) + ((gesture.smooth_val(3)* 127) / 16) 'range for gesture.smooth_val(3) to be checked. wind = (wind * 0.9375) + (gesture.smooth_val(3) * 7.9375) IF qt.ctrl(7) <> INT(wind * 3) THEN controller qt.channel, 7, MAX(MIN(wind * 3, %MM_Qt_Motor), 20) qt.ctrl(7) = INT(wind * 3) 'MIN(INT(wind),110) 'logfile str$(wind * 3) END IF END SUB SUB Domi_Edgy_Trig_xy () 'álternative with xy instead of piano 'evaluation for gesture.edgy and gesture.smooth properties STATIC noot1, noot2, noot3, tog AS SINGLE STATIC wind AS SINGLE IF ISFALSE Task(%Edgy_Trigger).tog THEN warning " üsing alternative Edgy task on Xy" wind = qt.ctrl(7) Task(%Edgy_Trigger).tog = %True END IF IF gesture.edgy_dur(3) THEN 'if edgy, we select the piano noot1 = MIN(Xy.lowtes + (gesture.edgy(0) *64), xy.hightes) ' logfile "noot"+ STR$(noot1) + STR$(@pDoppler.xa * 127)+ STR$(@pDoppler.ya * 127)+ STR$(@pDoppler.za * 127) noot2 = MIN(xy.lowtes + (gesture.edgy(1) * 64), xy.hightes) noot3 = MIN(xy.lowtes + (gesture.edgy(2) * 64), xy.hightes) IF @pDoppler.xa > .15 THEN addnote2Qhar Xy.qhar(1), noot1, (@pDoppler.xa * 127) IF @pDoppler.ya > .15 THEN addnote2Qhar Xy.qhar(1), noot2, (@pDoppler.ya * 127) IF @pDoppler.za > .15 THEN addnote2Qhar Xy.qhar(1), noot3, (@pDoppler.za * 127) QInstrumplay Xy ELSE ' IF noot1 THEN 'only for note off - not necessary on xy ' QInstrumplay Xy ' noot1 = %False ' END IF END IF ' IF gesture.smooth_dur(3) THEN ' 'test with Qt ' addnote2har qt.har(1), MIN(qt.lowtes + (gesture.smooth(0) * 127), qt.hightes), @pDoppler.xa * 127 ' addnote2har qt.har(1), MIN(qt.lowtes + (gesture.smooth(1) * 127), qt.hightes), @pDoppler.ya * 127 ' addnote2har qt.har(1), MIN(qt.lowtes + (gesture.smooth(2) * 127), qt.hightes), @pDoppler.za * 127 ' instrumplay Qt ' tog = %True ' ELSE ' IF tog THEN ' instrumplay Qt ' tog = %False ' END IF ' END IF ' wind = (wind * 0.9375) + (gesture.smooth_val(3) * 7.9375) ' IF qt.ctrl(7) <> INT(wind * 3) THEN ' controller qt.channel, 7, MAX(MIN(wind * 3, %MM_Qt_Motor), 20) ' qt.ctrl(7) = INT(wind * 3) 'MIN(INT(wind),110) ' END IF ' END SUB SUB Domi_Edgy_Trig_Stop () qt.ctrl(7) = %MM_Qt_Motor MM_Qt_Off %MM_Notes MM_Piano_Off END SUB SUB Links_smooth_Trig () 'evaluation for gesture.edgy and gesture.smooth properties '06.05.2010 - piano - harmo '09.05.2010 - instrumentation changed to pp - qt, because we cannot startup harmo... '17.05.2010 - qt wind controll added. STATIC noot1, noot2, noot3, tog AS INTEGER STATIC wind AS SINGLE IF ISFALSE Task(%Links_smooth).tog THEN MM_HarmO_On Controller Harma.channel, 66, 127 Controller Harma.channel, 1, 90 Controller Harma.channel, 7, 100 MM_HArma_On %MM_Wind OR %MM_Motor ' added 12.08.2017 wind = qt.ctrl(7) MM_Qt_On Task(%Links_smooth).tog = %True END IF IF (gesture.smooth_dur(3)) AND (MAX(@pDoppler.xa, @pDoppler.ya, @pDoppler.za) > .15) THEN 'íf smooth, we select Qt 'test with Qt addnote2har harma.har(1), MIN(harma.lowtes + (gesture.smooth(0) * 64), harma.hightes-1), @pDoppler.xa * 127 'hightes = bell. was sounding a lot wth * gesture.smooth() * 127 ! addnote2har harma.har(1), MIN(harma.lowtes + (gesture.smooth(1) * 64), harma.hightes-1), @pDoppler.ya * 127 addnote2har harma.har(1), MIN(harma.lowtes + (gesture.smooth(2) * 64), harma.hightes-1), @pDoppler.za * 127 instrumplay Harma ' controller Harma.channel, 40 + 60 * MAX(@pDoppler.xa, @pDoppler.ya, @pDoppler.za) ' Instrumplay HarmO tog = %True ELSE IF tog THEN ' Instrumplay Harmo instrumplay HArma tog = %False END IF END IF 'code added 17.05.2010 'qt wind controll in function of the property value: 'wind = (wind * 15/16) + ((gesture.smooth_val(3)* 127) / 16) 'range for gesture.smooth_val(3) to be checked. wind = (wind * 0.9375) + (gesture.smooth_val(3) * 7.9375) 'copied from qt code IF harma.ctrl(7) <> INT(wind * 3) THEN controller harma.channel, 7, MAX(MIN(wind * 3, %MM_harma_Motor), 20) harma.ctrl(7) = INT(wind * 3) 'MIN(INT(wind),110) 'logfile str$(wind * 3) END IF END SUB SUB Domi_Slowdown_Trig () ' here we look only into the frequency data on order to detect sudden slowdown gesture ' original version in Butoh_010.inc (was not working well anyway...) ' now using the new Gesture_Classify procedure (Fourstep) ' mapped on piperola - should give very short notes only. ' 06.04.2010 : using gesture_analyser ' 09.04.2010: rescaled ' 15.04.2010: extended testing under algo1: FIR. Works very reliably now 'STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig AS LONG STATIC xnoot, ynoot, znoot, lites AS WORD STATIC sens AS SINGLE IF ISFALSE Task(%Slowdown_Trigger).tog THEN ' IF ISFALSE Task(%Slowdown_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Slowdown_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Slowdown_Trigger).SliderNumbers(0) ' if isfalse gesture.algo then ' ' Slider(slnr).value = 20 '15 '64 ' else ' Slider(slnr).value = 25 ' end if ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF sens = 12 MM_Piperola_On MM_Bourdonola_On Controller Bourdonola.channel, 1, 50 'low wind pressure ! IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Slowdown_Trigger).tog = %True END IF 'sens = Slider(slnr).value / 2 IF Gesture.slowdown(0) > sens THEN ' frequency is unipolar data! - under algo1, can go up to 230 IF ISFALSE xtrig THEN xnoot = MIN(Piperola.lowtes - sens + 2+ (gesture.slowdown_val(0)/2), Piperola.hightes) 'independent from sens 15.04 mPlay Piperola.channel, xnoot, 64 xtrig = %True END IF ELSE IF xtrig THEN IF xnoot THEN mPlay Piperola.channel, xnoot, %False RESET xnoot END IF END IF RESET xtrig END IF IF Gesture.slowdown(1) > sens THEN IF ISFALSE ytrig THEN ynoot = MIN(Piperola.lowtes - sens + 2+ (gesture.slowdown_val(1)/2), Piperola.hightes) mPlay Piperola.channel, ynoot, 64 ytrig = %true END IF ELSE IF ytrig THEN IF ynoot THEN mPlay Piperola.channel, ynoot, %False RESET ynoot END IF END IF RESET ytrig END IF IF Gesture.slowdown(2) > sens THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers znoot = MIN(Piperola.lowtes - sens + 2+(gesture.slowdown_val(2)/2), Piperola.hightes) mPlay Piperola.channel, znoot, 64 ztrig = %True END IF ELSE IF ztrig THEN IF znoot THEN mPlay Piperola.channel, znoot , %False RESET znoot END IF END IF RESET ztrig END IF IF (gesture.slowdown(3) > sens) AND (gesture.slowdown(3) > gesture.speedup(3)) THEN 'add piperola percussion here... 'mPlay Piperola.channel, 120 + (gesture.slowdown(3) MOD 8), MIN(@pDoppler.xf, 127) ' is this the culprit? 'bug goes away when we rem this.. pic error on piperola?? IF ISFALSE lites THEN MM_Piperola_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Piperola_Off %MM_Lights RESET lites END IF END IF END SUB SUB Domi_Force_Slowdown_Trig () ' alternative version of above code, inclusing , for namuda #30: Forces ' here we look only into the frequency data on order to detect sudden slowdown gesture ' 15.04.2010: extended testing under algo1: FIR. Works very reliably now ' 13.01.2013: version for Forces. STATIC xtrig, ytrig, ztrig AS LONG STATIC xnoot, ynoot, znoot, lites AS WORD STATIC sens AS SINGLE IF ISFALSE Task(%Force_Slowdown_Trigger).tog THEN sens = 12 MM_Piperola_On MM_Bourdonola_On MM_Bomi_On Controller Bourdonola.channel, 1, 50 'low wind pressure ! IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Force_Slowdown_Trigger).tog = %True END IF IF Gesture.slowdown(0) > sens THEN ' frequency is unipolar data! - under algo1, can go up to 230 IF ISFALSE xtrig THEN xnoot = MIN(Piperola.lowtes - sens + 2+ (gesture.slowdown_val(0)/2), Piperola.hightes) 'independent from sens 15.04 mPlay Piperola.channel, xnoot, 64 xtrig = %True END IF ELSE IF xtrig THEN IF xnoot THEN mPlay Piperola.channel, xnoot, %False RESET xnoot END IF END IF RESET xtrig END IF IF Gesture.slowdown(1) > sens THEN IF ISFALSE ytrig THEN ynoot = MIN(Piperola.lowtes - sens + 2+ (gesture.slowdown_val(1)/2), Piperola.hightes) mPlay Piperola.channel, ynoot, 64 ytrig = %true END IF ELSE IF ytrig THEN IF ynoot THEN mPlay Piperola.channel, ynoot, %False RESET ynoot END IF END IF RESET ytrig END IF IF Gesture.slowdown(2) > sens THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers znoot = MIN(Bomi.lowtes - sens + 2+(gesture.slowdown_val(2)/2),Bomi.hightes) mPlay Bomi.channel, znoot, 64 ztrig = %True END IF ELSE IF ztrig THEN IF znoot THEN mPlay Bomi.channel, znoot , %False RESET znoot END IF END IF RESET ztrig END IF IF (gesture.slowdown(3) > sens) AND (gesture.slowdown(3) > gesture.speedup(3)) THEN 'add piperola percussion here... 'mPlay Piperola.channel, 120 + (gesture.slowdown(3) MOD 8), MIN(@pDoppler.xf, 127) ' is this the culprit? 'bug goes away when we rem this.. pic error on piperola?? IF ISFALSE lites THEN MM_Piperola_On %MM_Lights MM_Bomi_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Piperola_Off %MM_Lights MM_Bomi_On %MM_Lights RESET lites END IF END IF END SUB SUB Domi_SpeedUp_Trig () ' here we look only into the frequency data in order to detect accelerating gesture ' this is an experiment only sofar... ' this code works but not too well. The mapping on Llor was not very good neither. (way too loud) ' code adapted to fourstep recognition 06.04.2010 ' retested, with better ambitus mapping ' rescaling done 09.04.2010 ' 13.04.2010 works very well now with algo 1, but scaling should be enlarged. ' 15.04.2010: fine tuning. 'STATIC slnr AS DWORD STATIC xtrig, ytrig, ztrig, xnoot, ynoot, znoot AS LONG STATIC sens AS SINGLE IF ISFALSE Task(%Speedup_Trigger).tog THEN ' IF ISFALSE Task(%Speedup_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Speedup_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Speedup_Trigger).SliderNumbers(0) sens = 18 'in Hz units ' Slider(slnr).value = 20 '25 '15 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF MM_Korn_On MM_Autosax_On MM_Ob_On IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser Task(%Speedup_Trigger).tog = %True END IF ' on accelerating body speed, do something... ' X-vektor: ' sens = Slider(slnr).value 'IF gesture.speedup(0) > sens and gesture.speedup(0) > gesture.slowdown(0) THEN ' frequency is unipolar data, not normalized IF gesture.speedup(0) > gesture.slowdown(0) + sens THEN IF ISFALSE xtrig THEN xnoot = MIN(Ob.lowtes - sens + (gesture.speedup(0)* 1.5), Ob.Hightes) mPlay Ob.channel,xnoot, MIN(gesture.speedup_val(0) * 2, 127) xtrig = %True END IF ELSE RESET xtrig IF xnoot THEN IF ISFALSE gesture.speedup_dur(0) THEN mPlay Ob.channel, xnoot, %False RESET xnoot END IF END IF END IF ' IF gesture.speedup(1) > sens THEN IF gesture.speedup(1) > gesture.slowdown(1) + sens THEN IF ISFALSE ytrig THEN ynoot = MIN(Korn.lowtes - sens + (gesture.speedup(1)* 1.5), Korn.Hightes) mPlay Korn.channel,ynoot , MIN(gesture.speedup_val(1) * 2, 127) ytrig = %true END IF ELSE IF ynoot THEN IF ISFALSE gesture.speedup_dur(1) THEN mPlay Korn.channel, ynoot, %False RESET ynoot END IF END IF RESET ytrig END IF IF gesture.speedup(2) > gesture.slowdown(2) + sens THEN IF ISFALSE ztrig THEN znoot = MIN(Autosax.lowtes - sens + (gesture.speedup(2)* 1.5), Autosax.Hightes) mPlay Autosax.channel, znoot, MIN(gesture.speedup_val(2) * 3, 127) ztrig = %True END IF ELSE IF znoot THEN IF ISFALSE gesture.speedup_dur(2) THEN mPlay Autosax.channel, znoot, %False RESET znoot END IF END IF RESET ztrig END IF IF Gesture.speedup(3) > (sens * 10) THEN 'was * 6 IF gesture.speedup(3) > (gesture.slowdown(3) + (sens * 4)) THEN mPlay Llor.channel, MIN(Llor.lowtes + gesture.speedup(3) - (sens*10),Llor.Hightes), MIN(@pDoppler.zf , 127) 'experiment END IF END IF END SUB SUB Domi_SpeedUp_Trig_Stop () MM_Korn_Off MM_AutoSax_Off MM_Ob_Off END SUB SUB Domi_Jump_Trig () '12.05.2010 evaluation for gesture.airborne property '13.05.2010 Fine tuning session and research ' turned into an etude for the airborne gesture prototype ' robots used: , , , '14.05.2010 Testing session '15.05.2010 rechecking the mappings. ' Performed with Lazara Rosell Albear '2013: for some reasons does not seem to work very well anymore. STATIC noot1, noot2, noot3, tog AS INTEGER IF ISFALSE Task(%Jump_Trigger).tog THEN MM_Heli_On MM_Bono_On MM_So_On Task(%Jump_Trigger).tog = %True END IF IF (gesture.airborne_dur(0)) THEN noot1 = MIN(heli.lowtes + (SQR(gesture.airborne(0)) * 100), heli.hightes) mPlay Heli.channel, noot1, 100 + @pDoppler.xa * 27 '120 ELSE IF noot1 THEN NoteOff Heli.channel, noot1 noot1 = %False END IF END IF IF (gesture.airborne_dur(1)) THEN noot2 = MIN(bono.lowtes + (SQR(gesture.airborne(1)) * 100), bono.hightes) mPlay bono.channel, noot2, 100 + @pDoppler.ya * 27 '120 ELSE IF noot2 THEN NoteOff Bono.channel, noot2 noot2 = %False END IF END IF IF (gesture.airborne_dur(2))THEN noot3 = MIN(so.lowtes + (SQR(gesture.airborne(2)) * 64), so.hightes) mPlay so.channel, noot3, 97 + @pDoppler.za * 30 ' 120 ELSE IF noot3 THEN mPlay so.channel, noot3, %False noot3 = %False END IF END IF IF (gesture.airborne_dur(3)) THEN mPlay Casta.channel,MIN(casta.lowtes + (SQR(gesture.airborne(3)) * 24), casta.hightes) , 127 END IF END SUB SUB Domi_Jump_Trig_Stop () MM_Heli_Off MM_So_Off MM_Bono_Off END SUB SUB Domi_Links () 'score task 'total duration = 600 seconds = 10 minutes 'static tstart as long 'instead of fixed timing, this should get a user interface for Kristof such that he can step down 'through the score 'revised 14.04.2010 / 15.04.2010 / 17.04.2010 / 18.04.2010 STATIC cnt AS LONG LOCAL m AS ASCIIZ * 16 IF ISFALSE Task(%Domi_Links).tog THEN cnt = -10 '%False 'make this negative on startup to allow performers to come on stage... Task(%Domi_Links).freq = 1 'hence the counter will count seconds IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser m = "" SendMessage gh.Cockpit, %WM_SETTEXT,0, VARPTR(m) Task(%Domi_Links).tog = %True EXIT SUB 'essential for filling data buffers before the real start END IF SELECT CASE cnt CASE 0 '0'00" IF ISFALSE Task(%Slowdown_Trigger).tog THEN starttask %Slowdown_trigger 'piperola CASE 59 '1'00" IF ISFALSE Task(%Implode_Trigger).tog THEN starttask %Implode_Trigger 'tubi, vibi, xy ' CASE 110 '1'50" CASE 150 '2'30" IF ISFALSE Task(%Theacol_Trigger).tog THEN starttask %Theacol_Trigger 'puff CASE 190 '3'10" IF ISFALSE Task(%Explode_Trigger).tog THEN starttask %Explode_Trigger 'klung, simba, springers CASE 210 '3'30" IF Task(%slowdown_trigger).tog THEN stoptask %slowdown_trigger 'stop piperola CASE 240 '4'00" IF ISFALSE Task(%Speedup_Trigger).tog THEN starttask %Speedup_Trigger 'ób, korn, sax IF Task(%Implode_Trigger).tog THEN stoptask %Implode_Trigger 'stop tubi vibi xy CASE 260 IF task(%Explode_Trigger).tog THEN stoptask %Explode_Trigger 'stop klung, simba springers CASE 280 '4'40" IF Task(%Theacol_Trigger).tog THEN stoptask %Theacol_Trigger 'stop puff ' CASE 300 ' 'five minutes CASE 300 mPlay Piano.channel, 21, 120 CASE 302 mPlay Piano.channel, 26, 100 CASE 306 NoteOff Piano.channel, 21 CASE 308 NoteOff Piano.channel, 26 CASE 320 '5'20" IF Task(%Speedup_Trigger).tog THEN stoptask %Speedup_Trigger 'stop ob, korn, sax 'hurdy IF ISFALSE Task(%ButohHurdy).tog THEN starttask %ButohHurdy 'hurdy CASE 400 ' 6'40" IF ISFALSE Task(%Fluency_Trigger).tog THEN starttask %Fluency_trigger 'qt CASE 420 '7'00" IF ISFALSE Task(%Fixspeed_Trigger).tog THEN starttask %Fixspeed_trigger 'toypi CASE 440 ' 7'20 IF ISFALSE Task(%Collision_Trigger).tog THEN starttask %Collision_Trigger 'troms, snar, vacca, thunderwood, psch CASE 460 ' 7'40" IF Task(%ButohHurdy).tog THEN stoptask %ButohHurdy 'hurdy off MM_Sire_On %MM_Lights CASE 500 ' 8'20" IF Task(%Collision_Trigger).tog THEN stoptask %Collision_Trigger IF ISFALSE Task(%Freeze_Trigger).tog THEN starttask %Freeze_Trigger CASE 520 '8'40" IF Task(%Fixspeed_Trigger).tog THEN stoptask %Fixspeed_Trigger MM_Qt_Off %MM_Notes CASE 540 ' 9' IF Task(%Fluency_Trigger).tog THEN stoptask %Fluency_Trigger 'qt off 'let @pDoppler.noise grow: (init value = 16/1000 = 0.016) @pDoppler.noise = @pDoppler.noise + 0.001 'this causes Bourdonola to mPlay the final triad MM_Qt_Off CASE < 600 'traject 541 to 599 Controller Bourdonola.channel, 1, 600 - cnt 'runs from 59 to 1 - fade @pDoppler.noise = MIN(@pDoppler.noise + 0.001, 0.05) CASE 600 'ten minutes 'the real end of the piece IF Task(%Freeze_Trigger).tog THEN stoptask %Freeze_Trigger @pDoppler.noise = 0.016 'reset! 16/1000 CASE 603 MM_AllOff stoptask %Domi_Links END SELECT INCR cnt END SUB SUB Collis_Links () 'score for Namuda Study #3, for Lazara Rosell Albear: 'Collis' STATIC cnt AS LONG LOCAL m AS ASCIIZ * 16 IF ISFALSE Task(%Collis_Links).tog THEN cnt = -10 '%False 'make this negative on startup to allow performers to come on stage... Task(%Collis_Links).freq = 1 'hence the counter will count seconds IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser m = "" SendMessage gh.Cockpit, %WM_SETTEXT,0, VARPTR(m) Task(%Collis_Links).tog = %True EXIT SUB 'essential for filling data buffers before the real start END IF 'version for Lazarra, Namuda study #3: Collis [6 minutes] SELECT CASE cnt CASE 0 IF ISFALSE Task(%Theacol_Trigger).tog THEN starttask %Theacol_Trigger 'puff CASE 60 IF ISFALSE Task(%Collision_Trigger).tog THEN starttask %Collision_Trigger CASE 180 IF Task(%Theacol_Trigger).tog THEN stoptask %Theacol_Trigger CASE 240 IF ISFALSE Task(%Jump_Trigger).tog THEN starttask %Jump_Trigger CASE 300 IF Task(%Collision_Trigger).tog THEN stoptask %Collision_Trigger CASE 360 MM_AllOff stoptask %Collis_Links 'we do not stop jump trigger here, leaving Lazara time to leave the stage in tension. END SELECT INCR cnt END SUB SUB JinHyun_Links () 'score task 'total duration = 300 seconds = 5 minutes 'static tstart as long 'revised 14.04.2010 / 15.04.2010 / 17.04.2010 / 18.04.2010 'shortened version for Jin Hyun Kim 11.05.2010 5 minutes 'Links for Jin' 'reworked january 2013 for Study #30, 'Forces' with Dominica Eyckmans, Emilie De Vlam, Zam Martino Ebale '14.01.2013: ending modified. 'premiere 16.01.2013 '16.08.2017: performed again with emilie de vlam STATIC cnt AS LONG LOCAL m AS ASCIIZ * 16 IF ISFALSE Task(%JinHyun_Links).tog THEN cnt = -10 'make this negative on startup to allow performers to come on stage... Task(%JinHyun_Links).freq = 1 'hence the counter will count seconds IF ISFALSE Task(%Gesture_Analyser).tog THEN starttask %Gesture_Analyser m = "" SendMessage gh.Cockpit, %WM_SETTEXT,0, VARPTR(m) Task(%JinHyun_Links).tog = %True EXIT SUB 'essential for filling data buffers before the real start END IF '5 minute 'scientific' version for Jin Hyun Kim - recorded on fast video 12.05.2010 ' this does not include the hurdy code with spectral mapping, nor the airborne property SELECT CASE cnt CASE 0 '0'00" IF ISFALSE Task(%Force_Slowdown_Trigger).tog THEN starttask %Force_Slowdown_trigger 'piperola en Bomi CASE 30 IF ISFALSE Task(%Implode_Trigger).tog THEN starttask %Implode_Trigger 'tubi, vibi, xy CASE 60 IF ISFALSE Task(%Theacol_Trigger).tog THEN starttask %Theacol_Trigger 'puff CASE 90 '1'30" IF ISFALSE Task(%Explode_Trigger).tog THEN starttask %Explode_Trigger 'klung, simba, springers CASE 120 '2' IF Task(%Force_slowdown_trigger).tog THEN stoptask %Force_slowdown_trigger 'stop piperola/ Bomi MM_Bomi_Off END IF CASE 150 '2'30" IF ISFALSE Task(%Speedup_Trigger).tog THEN starttask %Speedup_Trigger 'ób, korn, sax IF Task(%Implode_Trigger).tog THEN stoptask %Implode_Trigger 'stop tubi vibi xy CASE 160 '2'40" IF task(%Explode_Trigger).tog THEN stoptask %Explode_Trigger 'stop klung, simba springers CASE 170 '2'50" IF Task(%Theacol_Trigger).tog THEN stoptask %Theacol_Trigger 'stop puff CASE 180 '3'00" IF Task(%Speedup_Trigger).tog THEN stoptask %Speedup_Trigger 'stop ob, korn, sax IF ISFALSE Task(%Edgy_Trigger).tog THEN starttask %Edgy_Trigger ' piano-qt CASE 200 ' 3'20" IF ISFALSE Task(%Fluency_Trigger).tog THEN starttask %Fluency_trigger 'qt CASE 220 '3'40" IF ISFALSE Task(%Force_Fixspeed_Trigger).tog THEN starttask %Force_Fixspeed_trigger 'toypi & Spiro CASE 230 ' 3'50 IF ISFALSE Task(%Collision_Trigger).tog THEN starttask %Collision_Trigger 'troms, snar, vacca, thunderwood, psch CASE 240 ' 4'00" IF Task(%Edgy_Trigger).tog THEN stoptask %Edgy_Trigger 'qt/piano off MM_Sire_On %MM_Lights CASE 250 ' 4'10" IF Task(%Collision_Trigger).tog THEN stoptask %Collision_Trigger IF ISFALSE Task(%Freeze_Trigger).tog THEN starttask %ForFre_Trigger ' ending procedure for Forces, piano+Bourdonola CASE 255 MM_AllLightsOn %MM_Red CASE 260 '4'20" IF Task(%Force_Fixspeed_Trigger).tog THEN stoptask %Force_Fixspeed_Trigger MM_Qt_Off %MM_Notes CASE 270 '4'30" IF Task(%Fluency_Trigger).tog THEN stoptask %Fluency_Trigger 'qt off 'let @pDoppler.noise grow: (init value = 16/1000 = 0.016) @pDoppler.noise = @pDoppler.noise + 0.001 'this causes Bourdonola to mPlay the final triad MM_Qt_Off CASE 271 TO 300 Controller Bourdonola.channel, 1, MAX((300 - cnt) *3, 20) 'runs from 29*3=87 to 0 - fade @pDoppler.noise = MIN(@pDoppler.noise + 0.001, 0.05) CASE 301 'the real end of the piece IF Task(%ForFre_Trigger).tog THEN stoptask %ForFre_Trigger @pDoppler.noise = 0.016 'reset! 16/1000 mPlay Bourdonola.channel, 38, 64 mPlay Bourdonola.channel, 45, 64 mPlay Bourdonola.channel, 53, 64 Task(%JinHyun_Links).freq = 1.2 CASE 302 mPlay Piano.channel, 91, 48 Task(%JinHyun_Links).freq = 1.5 CASE 303 mPlay Piano.channel, 93, 43 Task(%JinHyun_Links).freq = 1.8 CASE 304 mPlay Piano.channel, 95, 38 Task(%JinHyun_Links).freq = 2.2 CASE 305 mPlay Piano.channel, 96, 32 Task(%JinHyun_Links).freq = 2.7 CASE 306 mPlay Piano.channel, 98, 28 Task(%JinHyun_Links).freq = 3.3 CASE 307 mPlay Piano.channel, 102, 24 Task(%JinHyun_Links).freq = 3.9 CASE 308 mPlay Piano.channel, 105, 20 Task(%JinHyun_Links).freq = 4.7 CASE 309 mPlay Piano.channel, 108, 16 Task(%JinHyun_Links).freq = 5.6 CASE 320 MM_AllOff stoptask %JinHyun_Links END SELECT INCR cnt END SUB SUB Domi_Collision_Trig () ' collision detector ' here we look only into the acceleration data in order to detect collisions. ' we may want to make the timeframe adjustable ' the task frequency is 256Hz ' modified 5.04.2010: velo's added on the moment of the detected collision ' timewindow can now be set with slider ' 05.04.2010: Puff uit de mapping geschrapt ' nu mapping op: Troms, Snar, Vacca, Psch, Thunderwood, ' 06.04.2010: now using the gesture_analyser ' 09.04.2010: sensitivities and velo's rescaled. ' 16.04.2010: sensitivity raised a bit ' 18.04.2010: user interface for sens disabled: led to non responding param window in scored mode. ' 03.05.2010: rehearsed with Lazara. To do: add cymbals. ' STATIC slnr, lites AS DWORD STATIC xtrig, ytrig, ztrig, strig, lites AS LONG STATIC sens AS SINGLE IF ISFALSE Task(%Collision_Trigger).tog THEN ' IF ISFALSE Task(%Collision_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Collision_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Collision_trigger).SliderNumbers(0) ' Slider(slnr).value = 14 '18 '10 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF 'start gesture analyser!!! IF ISFALSE Task(%Gesture_analyser).tog THEN starttask %Gesture_Analyser MM_Thunderwood_On MM_Heli_On RESET lites sens = 1.4 '14/10 Task(%Collision_Trigger).tog = %True END IF ' on collision, do something... ' sens = Slider(slnr).value / 10 IF Gesture.collision(0) > sens THEN IF ISFALSE xtrig THEN mPlay Troms.channel, MIN(24 + ((Gesture.collision(0))*4),48), MIN(Gesture.impact(0) * 127,127) mPlay Snar.channel, 73 + RND(1), MIN(Gesture.impact(0) * 127, 127) ' should be alternating 73-74 xtrig = %True END IF ELSE RESET xtrig END IF IF Gesture.collision(1) > sens THEN IF ISFALSE ytrig THEN mPlay Vacca.channel, MIN(48 + ((Gesture.collision(1)) *8),88), MIN(Gesture.impact(1) * 127, 127) ytrig = %true END IF ELSE RESET ytrig END IF IF Gesture.collision(2) > sens THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same collision mPlay Thunderwood.channel, MIN(1 + ((Gesture.collision(2))*4),14), MIN(Gesture.impact(2) * 150, 127) mPlay Psch.channel, MIN(72 + ((Gesture.collision(2))*3),83), MIN(Gesture.impact(2) * 160, 127) ztrig = %True END IF ELSE RESET ztrig END IF 'added 17.04.2010 IF gesture.collision(3) THEN IF ISFALSE lites THEN 'licht MM_So_On %MM_White MM_Troms_On %MM_Lights MM_Heli_On %MM_Lights mPlay Thunderwood.channel, 0, 127 lites = %True END IF IF gesture.collision(3) > sens THEN 'added 13.05 IF ISFALSE strig THEN mPlay Troms.channel, 48,MIN(Gesture.impact(3) * 180, 127) 'cimbaal strig = %True END IF END IF ELSE IF lites THEN 'licht uit. MM_So_Off %MM_White MM_Troms_Off %MM_Lights MM_Heli_Off %MM_Lights mPlay Thunderwood.channel, 0, %False RESET lites END IF IF strig THEN IF gesture.collision(3) > sens THEN RESET strig END IF END IF END IF END SUB SUB Domi_Theacol_Trig () ' this is the inverse of the collision detection code ' here we look only into the acceleration data on order to detect theatrical collisions. ' these collisions have decelleration until standstill, followed by acceleration. ' we may want to make the timeframe adjustable (now 100) ' the task frequency is 256Hz ' modified 5.04.2010: velo's added on the moment of the detected collision ' timewindow can now be set with slider ' nu mapping op: Puff ' 05.04.2010: works reasonably well. ' 06.04.2010: recoded using Gesture_Analyser. ' 09.04.2010: velo's rescaled and sens increased. STATIC slnr, lites AS DWORD STATIC xtrig, ytrig, ztrig AS LONG LOCAL i AS DWORD STATIC sens AS SINGLE IF ISFALSE Task(%Theacol_Trigger).tog THEN ' IF ISFALSE Task(%Theacol_Trigger).hParam THEN ' DIM TaskParamLabels(0) AS STATIC ASCIIZ * 8 ' TaskParamLabels(0) = "sens" ' trigger level ' MakeTaskParameterDialog %Theacol_Trigger,1,Slider(),0,UDctrl(),TaskParamLabels() ' END IF ' IF ISFALSE slnr THEN ' slnr = TaskEX(%Theacol_trigger).SliderNumbers(0) ' Slider(slnr).value = 15 '10 ' SendMessage Slider(slnr).h, %TBM_SETPOS,%True, Slider(slnr).value ' END IF sens = 1 'start gesture_analyser IF ISFALSE Task(%Gesture_analyser).tog THEN starttask %Gesture_Analyser Task(%Theacol_Trigger).tog = %True END IF ' on theatrical collision, do something... 'sens = Slider(slnr).value / 10 IF gesture.theacol(0) > sens THEN IF ISFALSE xtrig THEN mPlay Puff.channel, MIN(Puff.Lowtes + ((gesture.theacol(0))*8),Puff.Hightes), MIN(gesture.impact(0) * 64,64) xtrig = %True END IF ELSE RESET xtrig END IF IF gesture.theacol(1) > sens THEN IF ISFALSE ytrig THEN mPlay Puff.channel, MIN(Puff.lowtes + ((gesture.theacol(1))*8),Puff.Hightes), MIN(gesture.impact(1) * 64,64) ytrig = %true END IF ELSE RESET ytrig END IF IF gesture.theacol(2) > sens THEN IF ISFALSE ztrig THEN ' avoiding multiple triggers on the same collision mPlay Puff.channel, MIN(Puff.Lowtes + ((gesture.theacol(2))*8),Puff.Hightes), MIN(gesture.impact(2) * 64,64) ztrig = %True END IF ELSE RESET ztrig END IF IF gesture.theacol(3) THEN IF ISFALSE lites THEN MM_Puff_On %MM_Lights lites = %True END IF ELSE IF lites THEN MM_Puff_Off %MM_Lights RESET lites END IF END IF END SUB SUB ButohHurdy () ' 18.07.2009 ' interactive doppler code for Hurdy & Human Body ' map X and Y vektor spektrum op de boventonen van elke snaar ' 19.07.2009: Works nicely, but everyso often Hurdy seems to freeze. Just restarting this ' task is a tested remedy. ' 22.07.2009: Premiere, but we forgot to tune the strings prior to the performance... ' 23.07.2009: May sound even better without the dampers. ' 27.07.2009: Hurdy hardware modified (zener diodes added) ' 28.07.2009: Motor UD added, e-drive slider added, damper removed on high string ' Fine tuning of code. ' 03.04.2010: Reused for choregraphy with Dominica Eyckmans: ' 16.04.2010: original procedure renamed ButohHurdy_Emilie () ' further tuning for ' 08.05.2010: rewritten to use the FFT task. LOCAL i AS LONG STATIC s AS SINGLE LOCAL mx AS SINGLE LOCAL my AS SINGLE STATIC TaskparamLabels() AS ASCIIZ * 8 IF ISFALSE Task(%ButohHurdy).tog THEN 'IF ISFALSE Task(%Doppler_FFT).tog THEN starttask %Doppler_FFT DIM Sp(128) AS STATIC SINGLE ' fast time buffers: 1024 S/s - 0.25 s timeframe DIM spx(127) AS STATIC DOUBLE AT gesture.pspf(0) DIM spy(127) AS STATIC DOUBLE AT gesture.pspf(1) DIM aro(127) AS STATIC SINGLE MM_Hurdy_On Controller Hurdy.channel, 69, 1 ' enable ebow low Controller Hurdy.channel, 70, 1 ' enable ebow high Controller Hurdy.channel, 5, 1 ' ebow lowstring on Controller Hurdy.channel, 6, 1 ' ebow highstring on Task(%ButohHurdy).tog = %True END IF ' for global moving surface estimation, following might be usefull: ' with integration: s = ((s * 7) + (SQR(@pDoppler.xa) + SQR(@pDoppler.ya) + SQR(@pDoppler.za))) / 8 ' this is used to steer the motor speed, if switched on IF gesture.explo(0) OR gesture.implo(0) OR gesture.flue(0) THEN ' MAT arr() = xfbuf() * Han() ' matrix multiply ' DFT_Dbl arr(), spx() FOR i = 0 TO 127 mx = MAX(mx,spx(i)) ' find the maximum value in spx() NEXT i IF mx THEN 'mx = %False is nog nooit voorgekomen... FOR i = 0 TO 127 Sp(i) = spx(i) * @pDoppler.xa/ mx ' Sp() must be normalized NEXT i ' could be faster with: ' MAT Sp() = (@pDoppler.xa/mx) * spx() provided both arrays were same type... END IF ArrayReduce_SNG (sp(), 8, aro()) ' in g_indep, returns the 8 strongest components in aro() ' memo: aro() has the 8 elements on the same places as they where in sp() ' now mPlay the highest components as harmonics on Hurdy i = 31 'highest multiplier on Hurdy DO IF aro(i) THEN mPlay Hurdy.channel, 40, 60 + i ' Slider(slnr).value * 0.8 ' fundamental Controller Hurdy.channel, 22, i ' multiplier EXIT DO END IF DECR i LOOP UNTIL i = 1 IF ISFALSE Hurdy.ctrl(121) THEN mPlay Hurdy.channel, 1, 127 ' lite Hurdy.ctrl(121) = %True END IF ELSE ' Noteoff on Hurdy low string. IF Hurdy.ctrl(121) THEN Release Hurdy.channel, 40, 1 '10 ' damper, gently NoteOff Hurdy.channel, 1 ' lite RESET hurdy.ctrl(121) END IF END IF IF gesture.explo(1) OR gesture.implo(1) OR gesture.flue(1) THEN ' MAT arr() = yfbuf() * Han() ' DFT_Dbl arr(), spy() FOR i = 0 TO 127 my = MAX(my,spy(i)) NEXT i IF my THEN 'my=%false is wel nog nooit voorgekomen... FOR i = 0 TO 127 Sp(i) = spy(i) * @pDoppler.ya/my NEXT i END IF ArrayReduce_SNG (sp(), 6, aro()) i = 24 '31 '128 DO IF aro(i) THEN mPlay Hurdy.channel, 64, 127 'Slider(slnr).value ' fundamental Controller Hurdy.channel, 23, i ' multiplier EXIT DO END IF DECR i LOOP UNTIL i = 1 IF ISFALSE Hurdy.ctrl(120) THEN mPlay Hurdy.channel, 0, 127 ' lite Hurdy.ctrl(120) = %True ' Hurdy.ctrl(127) = 120 ' slider(slnr).value END IF ELSE IF Hurdy.ctrl(120) THEN ' Release Hurdy.channel, 64, 1 '10 ' damper mPlay Hurdy.channel, 64, MIN( MAX(s * 64, 0), 10) ' drive at low volume Controller Hurdy.channel, 23, 1 ' reset to fundamental Noteoff Hurdy.channel, 0 ' lite RESET Hurdy.ctrl(120) END IF END IF ' tempo interaktief afhankelijk van de bewegingssnelheid: Task(%ButohHurdy).freq = MIN(MAX(@pDoppler.xf/8, @pDoppler.yF/8, 1.5), 8) END SUB SUB ButohHurdy_UD () ' call back for UpDown for Hurdy motor on/off LOCAL value AS BYTE value = UDCtrl(TaskEX(%ButohHurdy).UpdownNumbers(0)).value IF value > 1 THEN value = 1 IF value < 0 THEN value = 0 SetDlgItemText Task(%ButohHurdy).hparam, %GMT_TEXT0_ID + 16, "Mot:" & STR$(value) END SUB '************************************************************************************** SUB Bello_Links () ' 11.04.2015, for Dominica ' The Bello machine is a part of Balmec! ' it needs note-off's ! ' Robotorkest produktie 'Mekaniekjes', april 2015. ' 12.06.2016: taken up again for the Protest production STATIC noot1, noot2, noot3, kp1, kp2, kp3, on1, on2, on3 AS WORD IF ISFALSE Task(%Bello_Links).tog THEN MM_Balmec_On mPlay Balmec.channel, 120, 127 mPlay Balmec.channel, 126, 127 mPlay Balmec.channel, 127,127 logfile " Bello Links Started at " & TIME$ Task(%Bello_Links).tog = %True END IF noot1 = MAX(60, 94 - @pDoppler.xf/10) ' bij grote snelheden de laagste bellen ' door 94 te nemen als max, zal bij minimale snelheid geen ' bel klinken want 94 bestaat niet op Bello noot2 = MAX(60, 94 - @pDoppler.yf/10) noot3 = MAX(60, 94 - @pDoppler.zf/10) IF noot1 = noot2 THEN RESET noot2 IF noot1 = noot3 THEN RESET noot3 IF noot2 = noot3 THEN RESET noot3 kp1 =((kp1 * 3) + gesture.flue_val(0))/4 ' responsive for the note repetitions kp2 =((kp2 * 3) + gesture.flue_val(1))/4 kp3 =((kp3 * 3) + gesture.flue_val(2))/4 IF noot1 THEN IF Gesture.Edgy(0) > Gesture.Smooth(0) * 1.2 THEN Keypress Balmec.channel, noot1, kp1 mPlay Balmec.channel, noot1, @pDoppler.xa* 120 on1 = noot1 ELSE IF on1 THEN NoteOff Balmec.channel, on1 RESET on1 END IF END IF ELSE IF on1 THEN NoteOff Balmec.channel, on1 RESET on1 END IF END IF IF noot2 THEN IF Gesture.Edgy(1) > Gesture.Smooth(1) * 1.2 THEN Keypress Balmec.channel, noot2, kp2 mPlay Balmec.channel, MAX(Balmec.LowTes, Balmec.HighTes - @pDoppler.yf/10), @pDoppler.ya* 120 on2 = noot2 ELSE IF on2 THEN NoteOff Balmec.channel, on2 RESET on2 END IF END IF ELSE IF on2 THEN NoteOff Balmec.channel, on2 RESET on2 END IF END IF IF noot3 THEN IF Gesture.Edgy(2) > Gesture.Smooth(2) * 1.2 THEN Keypress Balmec.channel, noot3, kp3 mPlay Balmec.channel, MAX(Balmec.LowTes, Balmec.HighTes - @pDoppler.zf/10), @pDoppler.za* 120 on3 = noot3 ELSE IF on3 THEN NoteOff Balmec.channel, on3 RESET on3 END IF END IF ELSE IF on3 THEN NoteOff Balmec.channel, on3 RESET on3 END IF END IF 'Task(%Bello_Links).freq = uni.normspeed ' 1-3 END SUB SUB Bello_ouverture () STATIC noot1, noot2, noot3, kp1, kp2, kp3, on1, on2, on3, cnt AS WORD LOCAL velo1, velo2, velo3 AS WORD IF ISFALSE Task(%Bello_ouverture).tog THEN MM_Balmec_On mPlay Balmec.channel, 120, 127 mPlay Balmec.channel, 126, 127 mPlay Balmec.channel, 127,127 Task(%Bello_ouverture).tog = %True RESET cnt, on1, on2, on3 noot1 = 57 noot2 = 58 noot3 = 59 kp1 = 1 kp2 = 2 kp3 = 3 logfile "Namuda Bello Study Started at " & TIME$ Slider(0).value = 21 SendMessage Slider(0).h, %TBM_SETPOS,%True, Slider(0).value Task(%Bello_ouverture).freq = 1!/3! ' 3 sec END IF ' use cockpit slider 0 for speed control Task(%Bello_ouverture).freq = Slider(0).value / 64 ' amplitudes depending on moving surface. velo1 = gesture.flue_val(0) * 127 velo2 = gesture.flue_val(1) * 127 velo3 = gesture.flue_val(2) * 127 mPlay Balmec.channel, 126, velo1 mPlay Balmec.channel, 127, velo2 mPlay Balmec.channel, 120,velo3 ' wisselende drieklanken SELECT CASE cnt MOD 3 CASE 0 noot1 = noot1 + 3 IF noot1 > 93 THEN noot1 = (noot1 MOD 3) + 60 IF on1 THEN NoteOff Balmec.channel, on1 RESET on1 END IF mPlay Balmec.channel, noot1, velo1 on1 = noot1 CASE 1 noot2 = noot2 + 5 IF noot2 > 93 THEN noot2 = (noot2 MOD 5) + 60 IF noot2 = noot1 THEN INCR noot2 IF on2 THEN NoteOff Balmec.channel, on2 RESET on2 END IF mPlay Balmec.channel, noot2, velo2 on2 = noot2 CASE 2 noot3 = noot3 + 7 IF noot3 > 93 THEN noot3 = (noot3 MOD 7) + 60 IF noot3 = noot1 THEN INCR noot3 IF noot3 = noot2 THEN INCR noot3 IF on3 THEN NoteOff Balmec.channel, on3 RESET on3 END IF mPlay Balmec.channel, noot3, velo3 on3 = noot3 END SELECT ' keypressures increasing SELECT CASE cnt MOD 4 CASE 0 ' niks ' changed to this, for a somewhat faster evolution: IF cnt > 0 THEN INCR kp1 INCR kp2 INCR kp3 END IF CASE 1 IF noot1 THEN Keypress Balmec.channel, noot1, kp1 END IF INCR kp1 IF kp1 > 120 THEN kp1 = 3 CASE 2 IF noot2 THEN Keypress Balmec.channel, noot2, kp2 END IF INCR kp2 IF kp2 > 120 THEN kp2 = 1 CASE 3 IF noot3 THEN Keypress Balmec.channel, noot3, kp3 END IF INCR kp3 IF kp3 > 120 THEN kp3 = 2 END SELECT INCR cnt END SUB SUB Bello_Speedup () STATIC sens AS INTEGER STATIC noot1, noot2, noot3, kp1, kp2, kp3 AS WORD IF ISFALSE Task(%Bello_speedup).tog THEN MM_Balmec_On mPlay Balmec.channel, 120, 127 logfile " Bello Speedup Started at " & TIME$ Task(%Bello_speedup).tog = %True END IF IF ISFALSE sens THEN sens = 10 END IF IF gesture.speedup(0) > gesture.slowdown(0) + sens THEN IF noot1 THEN NoteOff Balmec.channel, noot1 kp1 = MAX( MIN (gesture.fixspeed_val(0) / 100, 2), 0) ' 0-2 noot1 = MAX(94 - @pDoppler.xf/6, 51) kp1 = kp1 * 63 Keypress Balmec.channel, noot1, kp1 mPlay Balmec.channel,noot1, @pDoppler.xa * 100 mPlay Balmec.channel, 126, 127 ELSE IF noot1 THEN NoteOff Balmec.channel, noot1 Keypress Balmec.channel, noot1, %False RESET noot1 NoteOff Balmec.channel, 126 END IF END IF IF gesture.speedup(1) > gesture.slowdown(1) + sens THEN IF noot2 THEN NoteOff Balmec.channel, noot2 kp2 = 63 * (MAX( MIN (gesture.fixspeed_val(1) / 100, 2), 0)) noot2 = MAX(94 - @pDoppler.yf/6, 51) Keypress Balmec.channel, noot2, kp2 mPlay Balmec.channel,noot2 , @pDoppler.ya * 100 mPlay Balmec.channel, 127,127 ELSE IF noot2 THEN NoteOff Balmec.channel, noot2 Keypress Balmec.channel, noot2, %False RESET noot2 NoteOff Balmec.channel, 127 END IF END IF IF gesture.speedup(2) > gesture.slowdown(2) + sens THEN IF noot3 THEN NoteOff Balmec.channel, noot3 kp3 = 63 * (MAX( MIN (gesture.fixspeed_val(2) / 100, 2), 0)) noot3 = MAX(94 - @pDoppler.zf/6, 51) Keypress Balmec.channel, noot3, kp3 mPlay Balmec.channel,noot3 , @pDoppler.za * 100 ELSE IF noot3 THEN NoteOff Balmec.channel, noot3 Keypress Balmec.channel, noot3, %False RESET noot3 END IF END IF END SUB SUB Bello_stop LOCAL i AS BYTE Controller Balmec.channel, 123,%False FOR i = 51 TO 93 Keypress Balmec.channel, i, %False NEXT i END SUB SUB Bello_Finale () ' finale for Namuda Study ' 18.04.2015 ' manual trigger on final jump ' no interactivity here. '12.06.2016: Chi added. STATIC cnt, So_note, So_vel AS DWORD IF ISFALSE Task(%Bello_Finale).tog THEN RESET cnt So_note = 24 So_vel = 120 MM_So_On MM_Qt_On MM_Hybr_On MM_Llor_On MM_Chi_On mPlay Qt.channel, 36, 64 mPlay Qtq.channel, 36, 64 Release Llor.channel, 36, 127 ' make sure the beater is in the fully returned position logfile " Finale Namuda Bello Study Started at " & TIME$ Task(%Bello_Finale).freq = 2 Controller Chi.channel, 74, 0 'set left limit to minimum Controller Chi.channel, 75, 126 'set right limit to maximum Task(%Bello_Finale).tog = %True END IF mPlay Troms.channel, RND(24,29), 127 - (cnt MOD 100) IF cnt = 1 THEN mPlay Chi.channel, 102, 80 'chi move left-right IF cnt = 16 THEN NoteOff Chi.channel, 102 IF cnt = 49 THEN mPlay Chi.channel, 100, 60 'chi gliss down SELECT CASE cnt CASE < 12 mPlay So.channel, So_Note, So_vel DECR So_Note CASE < 48 mPlay So.channel,So_Note,So_vel So_vel = MAX(0, So_vel - 6) CASE 48 MM_Qt_Off %MM_Notes mPlay Llor.channel, 36, 127 mPlay Hybr.channel, 33, 100 mPlay Hybr.channel, 34, 100 mPlay Hybr.channel, 35, 100 mPlay Hybr.channel, 36, 100 CASE < 60 Controller Hybr.channel, 7, 127 - ((cnt - 48) * 10) CASE 61 Controller Hybr.channel, 123, 0 Release Llor.channel, 36, 127 mPlay Chi.channel, 101, 40 'upwards glissando logfile "Namuda Bello Study Stopped at " & TIME$ Stoptask %Bello_Finale END SELECT INCR cnt END SUB