# This example creates multiple output soundfiles for comparison.
# The room is fairly large, the well known sound source is intended
# to move linearly from near the left front corner of the hall at the beginning
# to near the right rear corner near the end. However, with only stereo speakers,
# the sound may appear to emanate only from in front of the listener, approaching
# from the left to the center and then receding to the right.
# 5 Output soundfiles are created include:
# (1) vspace1.wxyz : 1st order ambisonic 
#  Since this soundfile cannot be played, it has been decoded with ambidec
# to the stereo WAVE soundfile /sflib/x/vspace1.amb1decode.wav, like this:
#     ambidec /sflib/x/vspace1.wxyz  /sflib/x//sflib/x/vspace1.amb1decode.wav
# (2) vspace1.fmh : 2nd order ambisonic 
#  Since this soundfile cannot be played, it has been decoded with ambidec
# to the stereo WAVE soundfile /sflib/x/vspace1.amb2decode.wav, like this:
#     ambidec /sflib/x/vspace1.fmh  /sflib/x//sflib/x/vspace1.amb2decode.wav
# (3) vspace1.stereo.wav : a standard stereo WAVE format version
# with mics in the center of the hall, capturing mostly direct signal
# rather than reverberation
# (4) vspace1.revmono.wav : A monophonic WAVE soundfile to test the
# general qualities of the reverberation. Themic is near the center
# rear of the hall.
# (5) vspace1.revstereo.wav : A stereo WAVE soundfile to test the
# general qualities of the reverberation. Coincident mics are positioned
# near the 2 rear corners of the hall.
# Note that in the 2 WAVE reverb soundfiles the sound seems to grow louder
# as it approaches rear mics.
#######################################################################
##### [1] GENERAL parameters and EARLY & LATE REFLECTION parameters #####
# default values are used for the following parameters, so they are commented out here
# tempo 60;
# skip 0 ;
# # disable early reflections; # uncomment to disable EARLY REFLECTIONS
# early reflection time 0.25;   # default .25, normal range .25 - .75
# early reflection minimum gain 0.005;

# # disable late reflections  # uncomment to disable LATE REFLECTIONS
#    # late reflection time default: calculated from room dimensions
# #late reflection time ?? ;          # Normal range: .75 - 3.0
# late reflection gain 1;            # > 1.0 = wetter, < 1.0 = drier
# late reflection echo density 1.0;   # > 1.0 = wetter, < 1.0 = drier
# late reflection frequency density 1.0;   # > 1.0 = wetter, < 1.0 = drier
# # Low pass filter cutoff frequency : by default calculated from room dimensions
# # late reflection cutoff ?? ; # in hertz, normally between 1000 & 2000
# ===================================================================
##### [2]  ROOM DIMENSIONS & REFECTIVITY parameters  #####
#distance unit metre;
room {
# room is 41.91 (20.34 + 21.57) meters long, 23.29 (11.82 +11.47) meters
# wide and 10.57 (1.7 +8.87) meters high
dimensions     -20.34 ,  21.57,    -11.82 , 11.47 ,    -1.7 , 9.87 ;
#             -rear, front,   -right,  left ,    -down,  up

reflections     0.6, 0.6, 0.6, 0.6, 0.5, 0.6;
}
# ===================================================================
##### [3] RECORDING devices (mics) : each "recording" produces an output soundfile #####
# 5 output soundfiles are produced by this example:

# (1) 1st order B-format 4 channel ambisonic file: Playable only after decoded.
recording vspace1.wxyz  {
 device ambisonic;    # ambisonic produces a 1st order ambisonic file
 location <0, 0, 0>;
 core radius 1;
}
# -------------------------------------------------
# (2) Second-order ambisonic 9 channel ambisonic file. Playable only after decoded.
recording vspace1.fmh {
 device second order ambisonic; second order ambisonic produces a 2nd order ambisonic file
 location <0, 0, 0>;
 core radius 1;
}
# (3) Stereo WAVE soundfile with coincident mic pair near center of the hall:
recording vspace1.stereo.wav { 
device cardioid pair;    # cardioid pair produces a stereo WAVE soundfile
location <0, 0, 0> ,<0, 0, 0>; 
direction <0, 1, 0> , <0, -1, 0> ;
core radius 1;
}

# (4) Monophonic WAVE reverberation test, with mic near center rear of hall:
recording vspace1.revmono.wav {
device omnidirectional;   # omnidirectional produces a mono WAVE soundfile
location <-18.5, 0.0 , 2.3>;
gain 3;  # amplitude, which otherwise would be quite low, is tripled
}

# (5) Stereo WAVE reverberation test, with mics near the rear
# corners of the hall
recording vspace1.revstereo.wav {
device cardioid pair;  # cardioid pair produces a stereo WAVE soundfile
location <-18.5, 10.0, 2.3> ,<-18.5, -10.0, 2.3>;
direction <0, 1, 0> , <0, -1, 0> ;
gain 3;  # amplitude, which otherwise would be quite low, is tripled
}

# ===================================================================
##### [4] TRACK parameters (MIX and MOTION) #####
track {    #  only one track is created
	mix	{
0  /sflib/x/voicetest.wav  gain 2.0 ;
}
motion	{
   # Over 6.5 beats (seconds) the sound moves from close to the left front corner 
   # to close to the right rear corner
   # Sound begins close to the left front corner (17 meters forward, 10
   # meters to the left of the listener)  and over 6.5 beats (seconds) moves
   # to a spot close tothe right rear corner (16.5 meters behind and 10 meters
# to the right of the listener)
0 to 6.5 line  <17.0, 10.0, 0> to <-16.5, -10.0, 0>;
6.5  fixed <-16.5, -10.0, 0> ;
	}
}

