# 5 tracks are used, each with a fixed spatial location
# A 6 element set (or ostinato) of source sound timbres recurs in the  order:
#  xylophone-rattle-violin martele- bird - logdrum - speech fragment ("significance")
# A rhythmic ostinato of 5 elements (quarter note/eighth note/half note/ 2 16ths)
# The 5 tracks provide a 5 element spatial ostinato (coinciding with the 5 element
# rhythmic ostinato) in the order:
#  hard left - right center - left center - center -- hard right
# The fact that the 6 element timbral ostinato does not coincide with the 5 element
# rhythmic and spatial ostinati tends to disguise the regularity and repetitions
# of these patterns.
# Here is how the coincident 5 element rhythmic and spatial ostinati and the
# non-synchronous timbral ostinato line up:
# quarter note  eighth    half             16th note    16 note (repeats 3 times)
# hard left    right center   left center  center     hard right (repeats 3 times)
#---------timbre ostinato: repeats shown by |   --------------------
# xylophone    rattle     violin martele   bird         logdrum  
# voice    |   xylo.      rattle           violin       bird 
# logdrum      voice   |  xylo.            rattle       violin 
# bird         logdrum    voice    |       xylo.        rattle 
# violin  

# The pedagogical point of this example (which understandably may have eluded you)
# is to illustrate the use of several tracks each with a stationary spatial placement.
# The tempo has been increased to 90 bpm
# The microphone gain has been raised to 1.8 so that the peak amplitude of the output
# soundfile is near maxamp, for good signal resolution.
# The room is fairly small and dry (reflectiviy of the walls has been lower to .4)
# The B format output soundfile "vspace3.wxyz" has been converted with ambidec
# to the stereo /sflib/x soundfile vspace3.decode.wav

##### [1] GENERAL parameters and EARLY & LATE REFLECTION parameters #####
tempo 90;
skip 0 ;
# disable early reflections; 
early reflection time 0.25;
early reflection minimum gain 0.005;

# disable late reflections
#late reflection time ?? ;
late reflection gain 1; 
late reflection echo density 1.0;
late reflection frequency density 1.0;
# late reflection cutoff ?? ;
# ===================================================================
##### [2]  ROOM DIMENSIONS & REFECTIVITY parameters  #####
distance unit metre;
room {
dimensions     -6.3, 7.3  ,     -4.22 , 4.17 ,        -1.11 , 4.19 ;
#             -rear, front,   -right,  left ,    -down,  up
reflections     0.4,  0.4,   0.4, 0.4,      0.4, 0.4 ; # fairly dry room
}
# ===================================================================
##### [3] RECORDING devices (mics) : each "recording" produces an output soundfile #####
 recording vspace3.wxyz  {
  device ambisonic ;
  location <0, 0, 0>; # use for all mics except cardioid pair
  gain 1.8 ;
#  core radius 1;
 }
# -----------------------------------------------------
##### [4] TRACK parameters (MIX and MOTION) #####
track {   # track 1 ------------------
  mix     { 
     0  /sflib/perc/xylo1.c4.wav gain 1.0; 
     4.0 /sflib/x/voicetest.wav  gain 1.01  from .36  to  1.28 ; # "significance"
     8.0  /sflib/africa/logdrum1.g2.wav  gain 0.7; 
     12.0  /sflib/env/bird.2.wav gain 1.0; 
     16.0  /sflib/string/vln.m.e6.wav gain 1.0; 
          }
  motion  { 0 fixed <0,4.0,0> ; }  # 4 meters to the left
}
track {   # track 2 ------------------
  mix     { 
     1  /sflib/america/rattle3.1.wav gain 1.0; 
     5.0  /sflib/perc/xylo1.g5.wav gain 1.0; 
     9.0 /sflib/x/voicetest.wav  gain 1.01  from .36  to  1.28 ; # "significance"
     13.0  /sflib/africa/logdrum1.c2.wav  gain 0.7; 
          }
  motion  { 0 fixed <2.0,-2.0,0> ; }   # 2 meters forward, 2 meters to right
}
track {   # track 3 ------------------
  mix     { 
     1.5  /sflib/string/vln.m.as4.wav gain 1.0; 
     5.5  /sflib/america/rattle3.2.wav gain 1.0; 
     9.5  /sflib/perc/xylo1.c6.wav gain 1.0; 
     13.5 /sflib/x/voicetest.wav  gain 1.01  from .36  to  1.28 ; # "significance"
          }
  motion  { 0 fixed <2.0,2.0,0> ; }  # # 2 meters forward, 2 meters to left
}
track {   # track 4 ------------------
  mix     { 
     3.5  /sflib/env/bird.1.wav gain 1.0; 
     7.5  /sflib/string/vln.m.e5.wav gain 1.0; 
     11.5  /sflib/america/rattle3.3.wav gain 1.0; 
     15.5  /sflib/perc/xylo1.g5.wav gain 1.0; 
          }
  motion  { 0 fixed <4.0,0,0> ; }  # 4 meters forward, straight ahead
}
track {   # track 5 ------------------
  mix     { 
     3.75  /sflib/africa/logdrum1.c3.wav  gain 0.7; 
     7.75  /sflib/env/bird.2.wav gain 1.0; 
     11.75  /sflib/string/vln.m.ef3.wav gain 1.0; 
     15.75  /sflib/america/rattle4.1.wav gain 1.0; 
          }
  motion  { 0 fixed <0,-4.0,0> ; }  # 4 meters to the right
}

