Commit 364300cd authored by Arshia Cont's avatar Arshia Cont
Browse files

Major Update: Moving to Antescofo new OBJECT (object oriented programming) on SpatLib

Use Antescofo 0.9-53 or later from Forge (https://forge.ircam.fr/p/antescofo/downloads/555/)

Read SpatLib-5points-Test2.txt and the new lib: Lib_Stroppa-Spat7.txt

This new scheme, developed by JLG per request of Antescofo Complexity Watchdog makes the code extremely readable and portable!
parent abc3736a
BPM 60
@INSERT "zInclude/Lib_Stroppa-Spat7.txt"
;;; Initialize sources: syntax is ::InitSources($NumberOfSources, $NumberOfSpeakers, $prefix_namespace)
; Note that the $prefix_namespace should correpond to what you use in your max/pd patch. It'll be used to construct (e.g.) "src1-spat" receivers automatically for message passing in
::InitSources(10, 5, "src")
;;; Define your Map Vocabulary in $initlevels. Consisting of key-names (string) and coordinates (table)
$initlevels := map {
("FadeOut", [0., 0., 0., 0., 0.]),
; SINGLE LOUDSPEAKERS
("Front", [1., 0., 0., 0., 0.]),
("Left", [0., 1., 0., 0., 0.]),
("Rear", [0., 0., 1., 0., 0.]),
("Right", [0., 0., 0., 1., 0. ]),
("Vert", [0., 0., 0., 0., 1.]),
; DOUBLE LOUDSPEAKERS, WITH PHASE OPPOSITION
("FrontalDipole", [.7, 0., -0.7, 0., 0.]),
("LateralDipole", [0., .7, 0., -0.7, 0.]),
("FrontLeftCorner", [0.7, -0.7, 0., 0., 0.]),
("RearLeftCorner", [0., 0.7, -0.7, 0., 0.]),
("RearRightCorner", [0., 0., .7, -0.7, 0.]),
("FrontRightCorner", [-0.7, 0., 0., 0.7, 0.]),
("FrontVertCorner", [-0.7, 0., 0., 0., 0.7]),
("LeftVertCorner", [0., -0.7, 0., 0., 0.7]),
("RearVertCorner", [0., 0., -0.7, 0., 0.7]),
("RightVertCorner", [0., 0., 0., -0.7, 0.7]),
; DOUBLE LOUDSPEAKERS, IN PHASE
("FrontalDipole1", [0.6, 0., 0.6, 0., 0.]),
("LateralDipole1", [0., 0.5, 0., 0.5, 0.]),
("FrontLeftCorner1", [0.7, 0.7, 0., 0., 0.]),
("RearLeftCorner1", [0., 0.7, 0.7, 0., 0.]),
("RearRightCorner1", [0., 0., 0.7, 0.7, 0.]),
("FrontRightCorner1", [0.7, 0., 0., 0.7, 0.]),
("FrontVertCorner1", [0.7, 0., 0., 0., 0.7]),
("LeftVertCorner1", [0., 0.7, 0., 0., 0.7]),
("RearVertCorner1", [0., 0., 0.7, 0., 0.7]),
("RightVertCorner1", [0., 0., 0., 0.7, 0.7]),
; TRIPLE LOUDSPEAKERS, OUT OF PHASE
("FrontTriple", [0.65, -0.35, 0., 0.35, 0.] ),
("FrontTriple01", [0.65, 0.35, 0., -0.35, 0.]),
("FrontTriple02", [-0.65, .35, 0., 0.35, 0.]),
("LeftTriple", [0.35, 0.65, -0.35, 0., 0.]),
("RearTriple", [0., 0.35, 0.65, -0.35, 0.]),
("RightTriple", [-0.35, 0., 0.35, 0.65, 0.]),
; TRIPLE LOUDSPEAKERS, IN PHASE
("FrontTriple1", [0.65, 0.35, 0., 0.35, 0.]),
("LeftTriple1", [0.35, 0.65, 0.35, 0., 0.]),
("RearTriple1", [0., 0.35, .65, 0.35, 0.]),
("RightTriple1", [0.35, 0., 0.35, 0.65, 0.]),
; ALL LOUDSPEAKERS
("AllHorizontal", [.45, -.45, .45, -.45, 0.]),
("AllDipoles", [.45, .45, -.45, -.45, 0.]),
("AllHorizontalinPhase", [.45, .45, .45, .45, 0.]),
("AllVertical", [.4, .4, -.4, -.4, .4]),
("AllinPhase", [.4, .4, .4, .4, .4])
}
NOTE C4 5.0
; Use the @Space macro to move sources.
;;; syntax is <source-number>, <key string>, <duration-in-beats>
@Space(1, "Front", 0.0)
1.0 @Space(1, "Left", 1.0)
@Space(1, "Rear", 1.0)
@Space(1, "Right", 3.0)
@Space(1, "Vert", 2.0)
;;; You can use any string name defined in $initlevels
; The above @Space macro is equivalent to calling each source object using the defined goto method (see the Lib)
$action := $source[1].goto("Front",0.0)
1.0 $action := $source[1].goto("Left",1.0)
;;; The FadeOut macro does what it says given a duration! You need to define what "FadeOut" means in $initLevels (zero out in this case)
@FadeOut(1, 1.0)
@FadeOut(1, 1.0)
;;; A RandomSpace method is defined in the source Object! Use without moderation and see its documentation in Lib
$randomspace1 := $source[1].RandomSpace(["Front", "Left", "Right"] ,0.05, 0.1, 0.5)
abort ($source[1])
;**********************************************************************
; BALANCE OF INDIVIDUAL LOUDSPEAKERS (NORMALLY IT SHOULD BE SET UP AT THE MIXING BOARD)
; Four horizontal loudspeakers
NOTE C2 4.0 Lsp_hor
print "BALANCE OF INDIVIDUAL LOUDSPEAKERS (NORMALLY IT SHOULD BE SET UP AT THE MIXING BOARD)"
print "Four horizontal loudspeakers"
loop Lsp_hor 4.0 @tempo := 90.0
{
@Space(1, "Front", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "Rear", 0.5)
1.0 @Space(1, "Right", 0.5)
}
NOTE C#2 4.0 Lsp_hor_stop
abort Lsp_hor
@FadeOut(1, 0.1)
; all the loudspeakers
NOTE D2 5.0 Lsp_all
print "All the loudspeakers"
loop Lsp_all 5.0 @tempo := 90.0
{
@Space(1, "Front", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "Rear", 0.5)
1.0 @Space(1, "Right", 0.5)
1.0 @Space(1, "Vert", 0.5)
}
NOTE D#2 5.0 Lsp_all_stop
abort Lsp_all
@FadeOut(1, 0.1)
; alternance horizontal-vertical
NOTE F2 5.0 Lsp_hor-vert
print "Alternance horizontal-vertical"
loop Lsp_hor-vert 8.0 @tempo := 90.0
{
@Space(1, "Front", 0.5)
1.0 @Space(1, "Vert", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "Vert", 0.5)
1.0 @Space(1, "Rear", 0.5)
1.0 @Space(1, "Vert", 0.5)
1.0 @Space(1, "Right", 0.5)
1.0 @Space(1, "Vert", 0.5)
}
NOTE F#2 5.0 Lsp_hor-vert_stop
abort Lsp_hor-vert
@FadeOut(1, 0.1)
;**********************************************************************
; BALANCE SINGLE LOUDSPEAKER / DIPOLE
; NB: avoid using the same single loudspeaker as in a dipole
; Frontal Dipole
NOTE C3 5.0 FrontDipole ; front / rear
print "BALANCE SINGLE LOUDSPEAKER / DIPOLE"
print "Frontal Dipole"
loop FrontDipole 6.0 @tempo := 90.0
{
@Space(1, "FrontalDipole", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "FrontalDipole", 0.5)
1.0 @Space(1, "Right", 0.5)
1.0 @Space(1, "FrontalDipole", 0.5)
1.0 @Space(1, "Vert", 0.5)
}
NOTE C#3 5.0 FrontDipole_stop
abort FrontDipole
@FadeOut(1, 0.1)
; Lateral Dipole
NOTE D3 5.0 LateralDipole ; front / rear
print "Lateral Dipole"
loop LateralDipole 6.0 @tempo := 90.0
{
@Space(1, "LateralDipole", 0.5)
1.0 @Space(1, "Front", 0.5)
1.0 @Space(1, "LateralDipole", 0.5)
1.0 @Space(1, "Rear", 1.0)
1.0 @Space(1, "LateralDipole", 0.5)
1.0 @Space(1, "Vert", 0.5)
}
NOTE D#3 5.0 LateralDipole_stop
abort LateralDipole
@FadeOut(1, 0.1)
;______________________________________________________________________
; BALANCE DIPOLES
; BALANCE IN-PHASE / OUT-OF-PHASE DIPOLES
; not really impressive!
NOTE F3 5.0 InOutDipoles ; front / rear
print "BALANCE DIPOLES"
print "BALANCE IN-PHASE / OUT-OF-PHASE DIPOLES"
loop InOutDipoles 4.0 @tempo := 60.0
{
@Space(1, "FrontalDipole", 0.5)
1.0 @Space(1, "FrontalDipole1", 0.5)
1.0 @Space(1, "LateralDipole", 0.5)
1.0 @Space(1, "LateralDipole1", 0.5)
}
NOTE F#3 5.0 InOutDipoles_stop
abort InOutDipoles
@FadeOut(1, 0.1)
;**********************************************************************
; BALANCE SINGLE LOUDSPEAKER / CORNERS
; NB: avoid using the same single loudspeaker as in a dipole
; Horizontal Corners
NOTE C4 4.0 Hor_Corners
print "BALANCE SINGLE LOUDSPEAKER / CORNERS"
print "Horizontal Corners"
loop Hor_Corners 8.0 @tempo := 90.0
{
@Space(1, "FrontLeftCorner", 0.5)
1.0 @Space(1, "Right", 0.5)
1.0 @Space(1, "RearLeftCorner", 0.5)
1.0 @Space(1, "Front", 0.5)
1.0 @Space(1, "RearRightCorner", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "FrontRightCorner", 0.5)
1.0 @Space(1, "Rear", 0.5)
}
NOTE C#4 4.0 Hor_Corners_stop
abort Hor_Corners
@FadeOut(1, 0.1)
; Vertical Corners
NOTE D4 4.0 Vert_Corners
print "Vertical Corners"
loop Vert_Corners 8.0 @tempo := 90.0
{
@Space(1, "FrontVertCorner", 0.5)
1.0 @Space(1, "Right", 0.5)
1.0 @Space(1, "LeftVertCorner", 0.5)
1.0 @Space(1, "Front", 0.5)
1.0 @Space(1, "RearVertCorner", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "RightVertCorner", 0.5)
1.0 @Space(1, "Rear", 0.5)
}
NOTE D#4 4.0 Vert_Corners_stop
abort Vert_Corners
@FadeOut(1, 0.1)
;______________________________________________________________________
; BALANCE CORNERS
; BALANCE IN-PHASE / OUT-OF-PHASE CORNERS
; horizontal
NOTE F4 5.0 InOutCorners ; front / rear
print "BALANCE CORNERS"
print "BALANCE IN-PHASE / OUT-OF-PHASE CORNERS"
print "Horizontal"
loop InOutCorners 8.0 @tempo := 60.0
{
@Space(1, "FrontLeftCorner", 0.5)
1.0 @Space(1, "FrontLeftCorner1", 0.5)
1.0 @Space(1, "RearLeftCorner", 0.5)
1.0 @Space(1, "RearLeftCorner1", 0.5)
1.0 @Space(1, "RearRightCorner", 0.5)
1.0 @Space(1, "RearRightCorner1", 0.5)
1.0 @Space(1, "FrontRightCorner", 0.5)
1.0 @Space(1, "FrontRightCorner1", 0.5)
}
NOTE F#4 5.0 InOutCorners_stop
abort InOutCorners
@FadeOut(1, 0.1)
; vertical
NOTE G4 5.0 InOutVertCorners
print "Vertical"
loop InOutVertCorners 8.0 @tempo := 60.0
{
@Space(1, "FrontVertCorner", 0.5)
1.0 @Space(1, "FrontVertCorner1", 0.5)
1.0 @Space(1, "LeftVertCorner", 0.5)
1.0 @Space(1, "LeftVertCorner1", 0.5)
1.0 @Space(1, "RearVertCorner", 0.5)
1.0 @Space(1, "RearVertCorner1", 0.5)
1.0 @Space(1, "RightVertCorner", 0.5)
1.0 @Space(1, "RightVertCorner1", 0.5)
}
NOTE G#4 5.0 InOutVertCorners_stop
abort InOutVertCorners
@FadeOut(1, 0.1)
;**********************************************************************
; BALANCE SINGLE LOUDSPEAKER / TRIPLE CONFIGURATIONS
; NB: avoid using the same single loudspeaker as in a dipole
; FrontTriple
NOTE C5 5.0 SingleFront ; PB?
print "BALANCE SINGLE LOUDSPEAKER / TRIPLE CONFIGURATIONS"
print "FrontTriple"
loop SingleFront 2.0 @tempo := 60.0
{
@Space(1, "FrontTriple", 0.5)
1.0 @Space(1, "Rear", 0.5)
}
NOTE C#5 5.0 SingleFront_stop
abort SingleFront
@FadeOut(1, 0.1)
NOTE D5 5.0 SingleLeft ; PB?
print "BALANCE SINGLE LOUDSPEAKER / TRIPLE CONFIGURATIONS"
print "LeftTriple"
loop SingleLeft 2.0 @tempo := 60.0
{
@Space(1, "LeftTriple", 0.5)
1.0 @Space(1, "Right", 0.5)
}
NOTE D#5 5.0 SingleLeft_stop
abort SingleLeft
@FadeOut(1, 0.1)
NOTE F5 5.0 SingleRear ; front / rear
print "BALANCE SINGLE LOUDSPEAKER / TRIPLE CONFIGURATIONS"
print "RearTriple"
loop SingleRear 2.0 @tempo := 60.0
{
@Space(1, "RearTriple", 0.5)
1.0 @Space(1, "Front", 0.5)
}
NOTE F#5 5.0 SingleRear_stop
abort SingleRear
@FadeOut(1, 0.1)
NOTE G5 5.0 SingleRight ; front / rear
print "BALANCE SINGLE LOUDSPEAKER / TRIPLE CONFIGURATIONS"
print "RightTriple"
loop SingleRight 2.0 @tempo := 60.0
{
@Space(1, "RightTriple", 0.5)
1.0 @Space(1, "Left", 0.5)
}
NOTE G#5 5.0 SingleRight_stop
abort SingleRight
@FadeOut(1, 0.1)
;______________________________________________________________________
; BALANCE TRIPLE
; BALANCE IN-PHASE / OUT-OF-PHASE TRIPLE
NOTE A5 5.0 InOutTriple ; front / rear
print "BALANCE IN-PHASE / OUT-OF-PHASE TRIPLE CONFIGURATIONS"
print "InOutFrontTriple"
loop InOutFrontTriple 5.0 @tempo := 60.0
{
@Space(1, "FrontTriple", 0.5)
1.0 @Space(1, "FrontTriple1", 0.5)
1.0 @Space(1, "FrontTriple", 0.5)
1.0 @Space(1, "FrontTriple01", 0.5)
1.0 @Space(1, "FrontTriple02", 0.5)
}
NOTE A#5 5.0 InOutFrontTriple_stop
abort InOutFrontTriple
@FadeOut(1, 0.1)
NOTE B5 5.0 InOutTriple ; front / rear
print "BALANCE IN-PHASE / OUT-OF-PHASE TRIPLE CONFIGURATIONS"
print "InOutAllTriple"
loop InOutAllTriple 8.0 @tempo := 60.0
{
@Space(1, "FrontTriple", 0.5)
1.0 @Space(1, "FrontTriple1", 0.5)
1.0 @Space(1, "LeftTriple", 0.5)
1.0 @Space(1, "LeftTriple1", 0.5)
1.0 @Space(1, "RearTriple", 0.5)
1.0 @Space(1, "RearTriple1", 0.5)
1.0 @Space(1, "RightTriple", 0.5)
1.0 @Space(1, "RightTriple1", 0.5)
}
NOTE Bb5 5.0 InOutAllTriple_stop
abort InOutAllTriple
@FadeOut(1, 0.1)
;______________________________________________________________________
; BALANCE SINGLE LOUDSPEAKER / QUADRUPLE CONFIGURATIONS
; AllHorizontal / Vertical
NOTE C6 5.0 AllHorizontal ; front / rear
print "BALANCE SINGLE LOUDSPEAKER / QUADRUPLE CONFIGURATIONS"
print "AllHorizontal / Vertical"
loop AllHorizontal 6.0 @tempo := 60.0
{
@Space(1, "AllHorizontal", 0.5)
1.0 @Space(1, "Vert", 0.5)
1.0 @Space(1, "AllDipoles", 0.5)
1.0 @Space(1, "Vert", 0.5)
1.0 @Space(1, "AllHorizontalinPhase", 0.5)
1.0 @Space(1, "Vert", 0.5)
}
NOTE C#6 5.0 AllHorizontal_stop
abort AllHorizontal
@FadeOut(1, 0.1)
;______________________________________________________________________
; BALANCE SINGLE LOUDSPEAKER / ALL
; All vs. Single
NOTE D6 5.0 AllSingle
print "BALANCE SINGLE LOUDSPEAKER / ALL"
print "All / Single"
loop AllSingle 10.0 @tempo := 60.0
{
@Space(1, "AllVertical", 0.5)
1.0 @Space(1, "Front", 0.5)
1.0 @Space(1, "AllVertical", 0.5)
1.0 @Space(1, "Left", 0.5)
1.0 @Space(1, "AllVertical", 0.5)
1.0 @Space(1, "Rear", 0.5)
1.0 @Space(1, "AllVertical", 0.5)
1.0 @Space(1, "Right", 0.5)
1.0 @Space(1, "AllVertical", 0.5)
1.0 @Space(1, "Vert", 0.5)
}
NOTE D#6 5.0 AllSingle_stop
abort AllSingle
@FadeOut(1, 0.1)
NOTE F6 5.0 All
print "BALANCE ALL LOUDSPEAKERS"
print "All in/out Phase"
loop All 2.0 @tempo := 60.0
{
@Space(1, "AllVertical", 0.5)
1.0 @Space(1, "AllinPhase", 0.5)
}
NOTE F#6 5.0 All_stop
abort All
@FadeOut(1, 0.1)
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; END OF TESTS
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
NOTE C4 5.0 ModularMoves
@FadeOut(1, 0.1)
NOTE D4 5.0 Dipoles
@Space(1, "LateralDipole", 0.0)
@Space(1, "LateralDipole", 3.0)
@Space(1, "FrontalDipole", 3.0)
@Space(1, "FrontLeftCorner", 3.0)
@Space(1, "RearRightCorner", 3.0)
@Space(1, "LateralDipole", 0.0)
NOTE E4 5.0 Looping
sfplay1 open "s1_02_3.aif", 1, loop 1
sfplay2 open "s1_021_1.aif", 1, loop 1
sfplay1 0, loop 0
sfplay2 0, loop 0
abort clock
abort clockdipole
@FadeOut(1,0.1)
@FadeOut(2,0.1)
......@@ -8,7 +8,7 @@
"architecture" : "x86"
}
,
"rect" : [ 27.0, 45.0, 626.0, 436.0 ],
"rect" : [ 3.0, 45.0, 626.0, 436.0 ],
"bglocked" : 0,
"openinpresentation" : 1,
"default_fontsize" : 12.0,
......@@ -28,6 +28,52 @@
"digest" : "",
"tags" : "",
"boxes" : [ {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"frgb" : 0.0,
"id" : "obj-91",
"maxclass" : "comment",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 444.0, 71.0, 150.0, 20.0 ],
"presentation" : 1,
"presentation_rect" : [ 435.0, 72.0, 115.5, 20.0 ],
"text" : "Turn on for Sublime"
}
}
, {
"box" : {
"id" : "obj-81",
"maxclass" : "toggle",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "int" ],
"parameter_enable" : 0,
"patching_rect" : [ 241.0, 348.5, 20.0, 20.0 ],
"presentation" : 1,
"presentation_rect" : [ 412.0, 72.0, 20.0, 20.0 ]
}
}
, {
"box" : {
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-26",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 237.0, 397.5, 94.0, 18.0 ],
"presentation" : 1,
"presentation_rect" : [ 412.0, 95.0, 94.0, 18.0 ],
"text" : "incomingosc $1"
}
}
, {
"box" : {
"channels" : 5,
"clip_size" : 1,
......@@ -1478,7 +1524,7 @@
"fontname" : "Arial",
"fontsize" : 12.0,
"id" : "obj-7",
"items" : [ "SourceControl.js", ",", "SpatLib-5points-Test1.txt" ],
"items" : [ "SourceControl.js", ",", "SpatLib-2points-Test1.txt", ",", "SpatLib-5points-Test1.txt", ",", "SpatLib-5points-Test2.txt" ],
"maxclass" : "umenu",
"numinlets" : 1,
"numoutlets" : 3,
......@@ -1541,7 +1587,7 @@
"outlettype" : [ "" ],
"patching_rect" : [ 299.0, 201.0, 70.0, 18.0 ],
"presentation" : 1,
"presentation_rect" : [ 442.5, 116.0, 70.0, 18.0 ],
"presentation_rect" : [ 366.0, 41.0, 70.0, 18.0 ],
"text" : "nextlabel"
}
......@@ -1563,36 +1609,6 @@
"text" : ";\rtoMat clear;\r"
}
}
, {
"box" : {
"id" : "obj-24",
"maxclass" : "fpic",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [ 263.0, 111.0, 129.0, 94.0 ],
"pic" : "fleches.pic",
"presentation" : 1,
"presentation_rect" : [ 413.0, 30.0, 129.0, 94.0 ]
}
}
, {
"box" : {
"bgcolor" : [ 1.0, 0.890196, 0.090196, 1.0 ],
"fontname" : "Arial",
"fontsize" : 9.0,
"id" : "obj-26",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 194.0, 170.0, 74.0, 15.0 ],
"presentation" : 1,
"presentation_rect" : [ 367.0, 57.0, 74.0, 15.0 ],
"text" : "previousevent"
}
}
, {
"box" : {
......@@ -1607,7 +1623,7 @@
"outlettype" : [ "" ],
"patching_rect" : [ 302.0, 96.0, 73.0, 18.0 ],
"presentation" : 1,
"presentation_rect" : [ 441.5, 21.0, 72.0, 18.0 ],
"presentation_rect" : [ 366.0, 8.0, 72.0, 18.0 ],
"text" : "nextaction"
}
......@@ -1624,7 +1640,7 @@
"outlettype" : [ "" ],
"patching_rect" : [ 389.0, 171.0, 55.0, 15.0 ],
"presentation" : 1,
"presentation_rect" : [ 504.75, 57.0, 55.0, 15.0 ],
"presentation_rect" : [ 366.0, 26.0, 55.0, 15.0 ],
"text" : "nextevent"
}
......@@ -2406,11 +2422,13 @@
"presentation" : 1,
"presentation_rect" : [ 17.0, 88.0, 386.0, 25.0 ],
"saved_object_attributes" : {
"IncomingOscPort" : 5678,
"Warning" : 1,
"ascograph_height" : 768,
"ascograph_height" : 741,
"ascograph_width" : 1024,
"ascographconf" : [ "localhost", 6789 ],
"ascographpanel" : 1,
"ascographpos" : [ 60, 170 ]
"ascographpos" : [ 479, 551 ]
}