Commit 0eddd2af authored by Marco Stroppa's avatar Marco Stroppa
Browse files

Added a more rational organisation of the SpatLib in three layers: general...

Added a more rational organisation of the SpatLib in three layers: general lib, space configurations, tests.
parent 6de7299b
; 7-POINT TOTEM FOR DONAU 2016
; Current configurations (space vocabulary)
; Include it with the score files
; ACTIVATE THIS IF THE TEST IS LOADED ALONE
;@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
; ACTIVATE THIS IF THE TEST IS LOADED ALONE
;::InitSources(10, 7, "src")
;;; Define your Map Vocabulary in $initlevels. Consisting of key-names (string) and coordinates (table)
$initlevels := map {
("FadeOut", [0., 0., 0., 0., 0., 0., 0.]),
; SINGLE LOUDSPEAKERS
("Ctr", [0., 0., 0., 1., 0., 0., 0.]),
("Up1", [0., 0., 1., 0., 0., 0., 0.]),
("Up2", [0., 1., 0., 0., 0., 0., 0.]),
("Up3", [1., 0., 0., 0., 0., 0., 0.]),
("Dw1", [0., 0., 0., 0., 1., 0., 0.]),
("Dw2", [0., 0., 0., 0., 0., 1., 0.]),
("Dw3", [0., 0., 0., 0., 0., 0., 1.]),
; DOUBLE ADJACENT LOUDSPEAKERS
("CtrUp", [0., 0., .7, .7, 0., 0., 0.]),
("CtrDw", [0., 0., 0., .7, .7, 0., 0.]),
("Up12", [0., .7, .7, 0., 0., 0., 0.]),
("Up23", [.7, .7, 0., 0., 0., 0., 0.]),
("Dw12", [0., 0., 0., 0., .7, .7, 0.]),
("Dw23", [0., 0., 0., 0., 0., .7, .7]),
; TRIPLE ADJACENT LOUDSPEAKERS
("CtrUp3", [0., .5, .5, .5, 0., 0., 0.]),
("Up123", [.5, .5, .5, .7, .7, 0., 0.]),
("CtrDw3", [0., 0., 0., .5, .5, .5, 0.]),
("Dw123", [0., 0.0, 0., 0., .5, .5, .5]),
; QUADRUPLE ADJACENT LOUDSPEAKERS
("CtrUp4", [.4, .4, .4, .4, 0., 0., 0.]),
("CtrDw4", [0., 0., 0., .4, .4, .4, .4]),
; EVEN/ODD LOUDSPEAKERS
("Odd", [.3, 0., .3, 0., .3, 0., .3]),
("Even", [0., .4, 0., .4, 0., .4, 0.]),
}
; 7-POINT TOTEM FOR DONAU 2016
; TESTS OF THE SETUP
BPM 60
@INSERT "zInclude/Lib_Stroppa-Spat7.txt"
@INSERT "SpatLib-7_Totem_configs.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, 7, "src")
;**********************************************************************
; BALANCE OF INDIVIDUAL LOUDSPEAKERS
; SEND A NOISE FROM MAX
; All the loudspeakers from up [1] to down [7]
NOTE C2 4.0 Lsp_up_down
print "BALANCE OF INDIVIDUAL LOUDSPEAKERS"
print "All the loudspeakers from up to down"
loop Lsp_updw 7.0 @tempo := 90.0
{
@Space(1, "Up3", 0.5)
1.0 @Space(1, "Up2", 0.5)
1.0 @Space(1, "Up1", 0.5)
1.0 @Space(1, "Ctr", 0.5)
1.0 @Space(1, "Dw1", 0.5)
1.0 @Space(1, "Dw2", 0.5)
1.0 @Space(1, "Dw3", 0.5)
}
NOTE C#2 4.0 Lsp_updw_stop
abort Lsp_updw
@FadeOut(1, 0.1)
;----------------------------------------------------------------------
NOTE D2 4.0 Adjacent_2
print "BALANCE OF DOUBLE LOUDSPEAKERS"
print "All the loudspeakers from up to down by 2 adjacent ones"
loop Lsp_updw_2 6.0 @tempo := 90.0
{
@Space(1, "Up23", 0.5)
1.0 @Space(1, "Up12", 0.5)
1.0 @Space(1, "CtrUp", 0.5)
1.0 @Space(1, "CtrDw", 0.5)
1.0 @Space(1, "Dw12", 0.5)
1.0 @Space(1, "Dw23", 0.5)
}
NOTE C#2 4.0 Lsp_updw_2_stop
abort Lsp_updw_2
@FadeOut(1, 0.1)
;----------------------------------------------------------------------
NOTE E2 4.0 Adjacent_3
print "BALANCE OF TRIPLE LOUDSPEAKERS"
print "All the loudspeakers from up to down by 3 adjacent ones"
loop Lsp_updw_3 5.0 @tempo := 90.0
{
@Space(1, "Up23", 0.5)
1.0 @Space(1, "Up123", 0.5)
1.0 @Space(1, "CtrUp3", 0.5)
1.0 @Space(1, "CtrDw3", 0.5)
1.0 @Space(1, "Dw123", 0.5)
}
NOTE Eb2 4.0 Lsp_updw_3_stop
abort Lsp_updw_3
@FadeOut(1, 0.1)
;----------------------------------------------------------------------
NOTE F2 4.0 Adjacent_4
print "BALANCE OF QUADRUPLE LOUDSPEAKERS"
print "All the loudspeakers from up to down by 4 adjacent ones"
loop Lsp_updw_4 2.0 @tempo := 90.0
{
@Space(1, "CtrUp4", 0.5)
1.0 @Space(1, "CtrDw4", 0.5)
}
NOTE F#2 4.0 Lsp_updw_4_stop
abort Lsp_updw_4
@FadeOut(1, 0.1)
;----------------------------------------------------------------------
NOTE G2 4.0 OddEven
print "BALANCE OF ODD VS. EVEN LOUDSPEAKERS"
print "All the odd vs. even loudspeakers"
loop Lsp_oddeven 2.0 @tempo := 90.0
{
@Space(1, "Odd", 0.5)
1.0 @Space(1, "Even", 0.5)
}
NOTE F#2 4.0 Lsp_oddeven_stop
abort Lsp_oddeven
@FadeOut(1, 0.1)
;**********************************************************************
;;; A RandomSpace method is defined in the source Object!
; Use without moderation and see its documentation in Lib
NOTE C3 4.0 Random_3
$randomspace1 := $source[1].RandomSpace(["Centre", "Up1", "Dw1"] ,0.05, 0.1, 0.5)
NOTE C#3 4.0 Random_3_stop
abort ($source[1])
;----------------------------------------------------------------------
NOTE D3 4.0 Random_5
$randomspace1 := $source[1].RandomSpace(["Centre", "Up1", "Dw1", "Up2", "Dw2"] ,0.05, 0.1, 0.5)
NOTE D#3 4.0 Random_5_stop
abort ($source[1])
;----------------------------------------------------------------------
NOTE C3 4.0 Random_7
$randomspace1 := $source[1].RandomSpace(["Centre", "Up1", "Dw1", "Up2", "Dw2", "Up3", "Dw3"] ,0.05, 0.1, 0.5)
NOTE C#3 4.0 Random_7_stop
abort ($source[1])
;----------------------------------------------------------------------
@FadeOut(1,0.1)
@FadeOut(2,0.1)
;**********************************************************************
; SPATIAL LIBRARY FOR ...of Silence, version 2014
; Last update: 01/01/2015
; SPATIAL LIBRARY FOR STROPPA ANTESCOFO/MAX LIBRARIES
; Last update: 24/02/2016
/* NOTES:
This library uses an Antescofo map called $initlevels that contains destinations (as key strings)
......@@ -95,6 +95,23 @@ if (@is_undef($source))
}
}
;; goto_i method: same as goto, but with the possibility to specify the kind of interpolation
@proc_def goto_i($destination, $dur, $itp)
{
curve FlyingEngine @Grain := 0.05s,
@Action :=
{
$coordinates := $x ; store in internal/local coordinates of this source to keep track
@command($prefix_namespace+$idnum+"-spat") ($x)
}
{
$x
{
{ ($coordinates) } @type "sine_in_out"
$dur { ($initlevels($destination)) } @type $itp
}
}
}
;; Random space local method
;_________________________________________________________________________________________
/**** Random Granular Spatial Movement Process
......@@ -147,6 +164,20 @@ if (@is_undef($source))
;$sdur print Final coordinate of source ($snum) is ($source[$snum].$coordinates)
}
; SPACE_I Macro: same as SPACE with the choice of the interpolation
; Arguments:
; 1st argument: source number (integer)
; 2nd argument: movement type (string) --> must be in the $initlevels map. Must be wrapped in quotations
; 3rd argument: duration (float, or time in second or milli-second: ex. 3.0 or 3.0s or 3.0ms)
@macro_def Space_i($snum, $stype, $sdur, $itp)
{
; Call the specific GOTO method for source object $snum
_ := $source[$snum].goto_i($stype,$sdur, $itp)
;print Initial coordinate of source ($snum) is ($source[$snum].$coordinates)
;$sdur print Final coordinate of source ($snum) is ($source[$snum].$coordinates)
}
;FadeOut
@macro_def FadeOut($sourcenum, $dur)
{
......@@ -158,30 +189,7 @@ if (@is_undef($source))
//////////////////////////////////////////////////////////
; SPACE VOCABULARY
; SINGLE LOUDSPEAKERS
; Front [1], Left [2], Rear [3], Right [4], Vert [5]
; NB: -Lsp = phase opposition (ex. -1)
; DOUBLE LOUDSPEAKERS
; DIPOLES [1] = IN PHASE
; FrontalDipole[1] [1-3] / LateralDipole[1] [2-4]
; HORIZONTAL
; FrontLeftCorner[1] [1-2] / RearLeftCorner[1] [2-3] / RearRightCorner[1] [3-4] / FrontRightCorner[1] [4-1]
; VERTICAL
; FrontVertCorner[1] [5-1] / LeftVertCorner[1] [5-2] / RearVertCorner[1] [5-3] / RightVertCorner[1] [5-3]
; TRIPLE LOUDSPEAKERS
; FrontTriple[1] [1-2 3], LeftTriple[1] [1-2 3], RearTriple[1] [2-3 4], RightTriple[1] [3-4 1]
; QUADRUPLE LOUDSPEAKERS
; AllHorizontal [1-2 3-4]
; AllDipoles [1 2-3-4]
; AllHorizontalinPhase [1 2 3 4]
; AllVertical
; AllinPhase
; SPACE VOCABULARY: SEE EACH CONFIG FILE
;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment