Stationary source room-simulation.
in RTcmix/insts/std/MMOVE
MPLACE(outskip, inskip, dur, AMP, dist-xpos, angle-ypos, (-)dist_mikes[, input_channel])
RVB(outskip, inskip, dur, AMP)
space(front, right, -back, -left, ceiling, absorb, rvbtime)
mikes(mike_angle, pattern)
mikes_off()
set_attenuation_params(min_dist, max_dist, dist_exponent)
matrix(amp, matrixval1, matrixval2, … matrixval144)
CAPITALIZED parameters are pfield-enabled for table or dynamic control (see the maketable or makeconnection scorefile commands). Parameters after the [bracket] are optional and default to 0 unless otherwise noted.
MPLACE employs several subcommands to set the room-simulation characteristics and one sub-instrument (RVB) to operate.
For these commands, parameters labled as Dynamic can receive dynamic updates from a table or real-time control source.
MPLACE
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | output start time | seconds | no | no | |
p1 | input start time | seconds | no | no | |
p2 | duration (or endtime if negative) | seconds | no | no | |
p3 | amplitude multiplier | relative multiplier of input signal | yes | no | |
p4 | distance to sound source | feet | no | no | polar |
OR x-coordinate of sound source | feet | no | no | cartesian | |
p5 | angle to sound source | degrees; 0 degrees is straight in front | no | no | polar |
OR y-coordinate of sound source | feet | no | no | cartesian | |
p6 | distance between ‘mics’ (stereo receivers) in the room | feet | no | no | if negative, cartesian coords, else polar |
p7 | input channel | - | no | yes | default: 0 |
RVB
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | output start time | seconds | no | no | |
p1 | input start time | seconds | no | no | |
p2 | duration (or endtime if negative) | seconds | no | no | |
p3 | amplitude multiplier | relative multiplier of input signal | yes | no |
NOTE: this associated instrument is required for MPLACE to function
space
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | distance to front wall of room | feet | no | no | |
p1 | distance to right-hand wall of room | feet | no | no | |
p2 | distance to back wall of room | feet | no | no | specified as negative |
p3 | distance to left-hand wall of room | feet | no | no | specified as negative |
p4 | distance to ceiling of room | feet | no | no | |
p5 | wall absorption factor | 0-10 | no | no | 0 == more ‘dead’, 10 == more ‘live’ |
p6 | reverberation time | seconds | no | no | 0 - ~5 work best |
NOTE: this subcommand is required for MPLACE to function
mikes
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | microphone angle | degrees, 0 degrees is straight in front | no | no | |
p1 | microphone pattern | 0-1; 0 == omnidirectional, 1 == highly directional | no | no |
NOTE: this subcommand is optional for MPLACE to function (the default is “mikes_off”)
mikes_off
No pfields. This turns off the microphone angle and pattern settings to allow binaural simulation.
NOTE: this subcommand is optional for MPLACE to function
set_attenuation_params
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | minimum distance | feet | no | no | default: 0 |
p1 | maximum distance | feet | no | no | default: infinite |
p2 | distance attentuation exponent | - | no | no | default: 2 |
NOTE: this subcommand is optional for MPLACE to function
matrix
Param Field | Parameter | Units | Dynamic | Optional | Notes |
---|---|---|---|---|---|
p0 | total matrix gain | relative multiplier of input signal | no | no | |
p1-p145 | 12 x 12 matrix amp/feedback coefficients | - | no | yes | defaults to internal matrix |
NOTE: this subcommand is optional for MPLACE to function
MPLACE is an updated version of PLACE, Doug Scott’s room simulation RTcmix instrument. It places a sound in a room of your design and simulates the acoustic resonances of the room. Early reflections are computed using a ray-tracing approach based in the distances between the source, the listening ‘microphones’ and the walls. The generalized room reverberation is simulated using a 12 x 12 matrix of delay elements with feedback and filtering designed to imitate the global reverberation response of the specified room. This is done using the associated RVB instrument. Localization of the source sound is very good using MPLACE.
The room design for MPLACE depends on parameters specified in the setup subcommand. The parameters work by assuming that the listener (YOU) is placed at point [0,0] in a coordinate space. The locations of the four walls are specified in this x,y coordinate system (“front”, “right”, “-back”, “-left”):
y
|
-x---0---x
|
-y
Therefore the distance to the back and left walls must be specified as negative. All, including height, are in feet. “absorb” is a number between 0 (minimum) and 10 (maximum) that determines how reflective the walls are. “rvbtime” is the approximate length of reverb in seconds (the actual length depends on the size of the room).
MPLACE sets the location of the source sound by specifying the distance to the sound (“dist-xpos”) and the angle (“angle_ypos”) of the sound:
0.0 source
| /
| /
| /
| /
|/
you
using feet and degrees, respectively (see below for an alternative method of specifying the source location). Be sure to stay inside bounds of the room (it may take a bit of trigonometry [or guessing] to do that) The “AMP” pfield is a multipler of the input audio prior to any processing by MPLACE. The “dist_mikes” parameter sets how far apart the two ‘listening’ points are from the [0,0] center of the coordinate room (you can choose to think of this is how big the listener’s head is…).
A call to MPLACE should be followed by a call to RVB to create the diffuse room reverberation. RVB should be configured using the bus_config aux bus system to received the audio output from MPLACE.
When specifying the parameters for MPLACE, be aware that the interpretation of the p4 and p5 pfields (“dist-xpos”, “angle-ypos”) depends on whether or not p6 (“dist_mikes”) is positive or negative. The distance to the mikes (p6) will be interpreted as a positive number in any case, but if it is entered as negative it will cause p4 and p5 to be interpreted as cartesian coordinates on a coordinate plane where the center of the listener is located at [0, 0]. The default interpretation is to use polar coordinates for the sound source information (distance to sound, angle to sound).
The optional subcommands that may be used to set the parameters for MPLACE include mikes and mikes_off. mikes is a setup call for times when you wish to simulate microphone recording (most of the time, actually). The arguments are “mike_angle”, which is the angle each microphone makes with a line drawn between them (i.e., 45 puts them at a 90 degree angle FROM EACH OTHER). “pattern” is a value between 0 and one; 0 produces an omnidirectional mike, 1 produces a hypercardioid pattern, 0.5 produces the familiar cardioid pattern. The default pattern will be omnidirectional.
mikes_off is used following a previous call to mikes in order to cancel mike mode in the event that you wish to use binaural mode, or default to omnidirectional.
set_attenuation_params can set certain values that may be important during processing. p0 sets a minimum distance for a sound in feet. If the sound approaches the mike or ear closer than this, its volume will not increase beyond the maximum level (unity gain). Default is 0.0.
p1 sets the maximum distance for a sound in feet. If the sound exceeds this distance, its volume is not attenuated beyond the level associated with the maximum distance. Default is infinite.
The attentation factor (p2) determines the amount sound will decay over the distance traveled. Sounds will attenuate according to the formula:
a = 1.0 / ((d/mindistance) ** (factor))
where d is the distance to the sound, and factor is the attenuation factor (2.0 is the default value). NOTE: In the current version, ALL sound path gains are affected by these values, including all first- and second-generation reflections! Modifying these values will therefore produce significant and interesting changes in the reverb as well as the gain of the sounds.
matrix is used to replace the default set of amplitude/feedback coefficients for the RVB matrix – all 144 of them. This is tricky to use.
Note that multiple MPLACE notes can feed into a single RVB instrument for more efficient processing.
MPLACE/RVB requires stereo output.
basic use:
rtsetparams(44100,2,4096)
load("MPLACE")
bus_config("MPLACE", "in 0", "aux 0-1 out")
bus_config("RVB", "aux 0-1 in", "out 0-1")
rtinput("mysoundfile.wav")
mikes(45, 0.5)
dist_front = 100
dist_right = 130
dist_rear = -145
dist_left = -178
height = 100
rvbtime = 3
abs_fac = 8
space(dist_front, dist_right, dist_rear, dist_left, height, abs_fac, rvbtime)
insk = 0
outsk = 0
dur = DUR(0)
pre_amp = 120
dist2sound = 60
angle_sound = 90
dist_mikes = 5
//dist_mikes = 0.67 /* binaural */
inchan = 0
MPLACE(outsk, insk, dur, pre_amp, dist2sound, angle_sound+180, dist_mikes, inchan)
MPLACE(outsk+(256/44100), insk, dur, pre_amp, dist2sound, angle_sound, dist_mikes, inchan)
MPLACE(outsk+0.5, insk, dur, pre_amp,dist2sound*1.3, angle_sound+270, dist_mikes, inchan)
RVB(0, 0, dur+rvbtime+0.5, 1)
DMOVE, FREEVERB, GVERB, MMOVE, MOVE, MROOM, PLACE, REV, REVERBIT, ROOM, SROOM