Sound board simulator
Sound board simulator
Section titled “Sound board simulator”Implementation of the Training sound-board practice step. The math lives in ui/src/lib/training/soundBoard.ts. The cue clock lives in ui/src/components/study/StudySimulatorStep.vue. The sanctuary view is ui/src/components/training/SanctuaryScene.vue, which loads ui/src/lib/training/sanctuaryScene.ts (and Babylon.js) only when that step is on screen. The board is ui/src/components/training/SoundBoard.vue with one ConsoleFader.vue and the channel ConsoleKnob.vue controls per strip. The Web Audio graph is ui/src/lib/training/soundBoardAudio.ts. Shared places for the meshes and the panners live in ui/src/lib/training/sanctuaryLayout.ts. Profiles, scenarios, mic-color offsets, and practice results live in the API. Scoring reads the displayed meter. It does not read the audio graph. Levels are linear amplitudes unless a row says dB.
Learner flow
Section titled “Learner flow”A mentor looking at the step sees a note that the learner practices here. The mentor does not get the board. A learner gets the board beside the cue panel. On a narrow screen the cue panel stacks above the board.
flowchart TD
openStep[Open a Simulator step]
mentor{Mentor view?}
note[Show the practice note and stop]
load[Load scenarios whose slugs are on the step]
pick[Learner picks a scenario]
start[Start resets faders and the clock]
run[Clock advances cues and the acoustic loop]
mark{Learner marks the live cue?}
miss[lateEnd passes with no mark]
judge[Judge timing, displayed level, and feedback]
more{Cues left?}
results[Show the practice score and each cue]
save[Save practice result]
finish[Finish practice requires a saved row]
openStep --> mentor
mentor -->|yes| note
mentor -->|no| load
load --> pick --> start --> run
run --> mark
mark -->|yes| judge
mark -->|no| miss --> judge
judge --> more
more -->|yes| run
more -->|no| results --> save --> finish
The intro drill is the scenario intro-drill: mute the pulpit, then unmute it and set the fader near 0 dB. The timed runs are pulpit-cues (walk up, pages, singing) and choir-cues (the choir stands, then sings). Each cue has its own window on the same clock, measured from Start.
Saving always writes purpose practice. Finishing the step checks that this learner has a practice row for the step. It does not write a certification.
Scene and components
Section titled “Scene and components”The step places the cue panel beside a generic sanctuary, with the board docked under the sanctuary. On a narrow screen the cue panel stacks above the sanctuary and the board. Babylon is a dynamic import from SanctuaryScene.vue, so other pages do not load it. The room is built from boxes, cylinders, and spheres, plus two CC0 models: a grand piano and an organ console. There is no brand and no venue name.
The orbit camera is an ArcRotateCamera. Beta stays between 0.7 and 1.45, radius stays between 8 and 26, and alpha stays within 0.75 radians of the rear view. Panning is off. The nave is about twice as long as the first room, with a center aisle of pews. The platform has the pulpit at the front center, four chairs split to either side of it, a modesty rail, and a choir the full width of the platform behind that rail. A baptistry is recessed into the platform wall, clear of the choir. A gooseneck stands on the pulpit. Two mics hang above the front of the choir, spaced about four times their distance to the singers so they keep the 3:1 rule. Another mic hangs above the baptistry. A grand piano sits off the platform on the left, and an organ console with several manuals sits off the platform on the right. Both keyboards face away from the platform. The live cue’s channel highlights one zone: pulpit, pastor, and handheld light the pulpit; choir lights the risers and the rail; congregation lights the pews; piano and playback light their own meshes. The organ, the baptistry, and the spare channel have no zone. Two floor wedges sit on the front lip of the platform, at the same coordinates the headphone panners use. If WebGL cannot start, the scene shows a short note and the board below still runs.
Each strip is a label, a status line, a mute button, then a fader. The fader is a rectangular cap with one grip line on a slotted track, and that strip’s own scale runs from +10 down to −∞. Arrow keys step 1 dB. Page keys step 5 dB. Home and End go to −∞ and +10. Pointer and touch drag the same 0–1 position faderDb already uses. The control is an ARIA slider. Mute all is the M key, the Esc key, and the Mute all button. Esc still works while a label is focused. M does not.
flowchart TD step["StudySimulatorStep"] model["soundBoard.ts"] scene["SanctuaryScene"] sanctuary["sanctuaryScene.ts mountSanctuary"] babylon["Babylon.js chunk"] board["SoundBoard"] fader["ConsoleFader"] audio["soundBoardAudio.ts createSoundBoardAudio"] step --> model step --> scene step --> board step --> audio scene --> sanctuary sanctuary --> babylon board --> fader audio --> model sanctuary --> pulpit["Pulpit, front center"] sanctuary --> chairs["Four platform chairs"] sanctuary --> choir["Choir behind a modesty rail"] sanctuary --> baptistry["Baptistry, recessed in the wall"] sanctuary --> seating["Pews along the nave"] sanctuary --> piano["Piano, off the platform"] sanctuary --> organ["Organ, off the platform"] sanctuary --> playback["Playback speaker"] sanctuary --> wedges["Floor wedges"]
Web Audio graph
Section titled “Web Audio graph”Audio is created on Start, or when the learner turns audio on. Both are presses, so the context stays suspended until then. Audio off sets outputMute to 0 and leaves scoring on the meter and the ring and feedback labels. The first time a strip shows building or howling while audio is running, the step shows one warning: the sound is capped, and Mute all or Esc stops it.
Each channel picks one procedural voice. Speech is filtered noise bursts. The choir pad is a sustained chord. Page rustle is highpassed noise. A sung cue, and the piano, use a harmonic tone. Nothing is a recording. The voice gain is 1 for the chosen voice and 0 for the others. A mic-color offset, a short chain of biquads from the scenario, colors that dry voice before the strip. Source gain is the cue level S. Mute gain is 0 or 1. The channel EQ is a high-pass, a low shelf, a sweepable mid, and a high shelf. Fader gain is dbToGain(faderDb(position)). Source, mute, and fader are the post-fader program P. The offset and the EQ change the spectrum. They are not a second broadband trim.
The bus sums every P. Master mute and the master fader follow. Each mic has a sine at that mic’s worst peak, on the house path or on a wedge path, the same hertz the strip prints. Its gain is the regenerative excess e, from excessFromTone. The ring joins the sum after the master fader, so the sum is the master meter: (Σ P) × master mute × master fader + Σ e.
The house sum still runs through one biquad peaking filter per room peak, then a delay of loopDelayMs mixed with the dry path at ROOM_DELAY_MIX. That delay does not feed back. The model already owns growth and decay. Headphones do not listen to that chain a second time. Each post-fader channel, and each wedge, goes through its own PannerNode in HRTF mode into a spatial sum. One ConvolverNode carries a generated impulse. There is no named room. PFL taps the channel after the EQ and before the fader. AFL taps it after the fader. Either solo opens a dry bus and closes the convolver. A fast compressor, then hardCap at HARD_MASTER_CAP, then outputMute, then the destination.
flowchart LR speech["Speech bursts"] choir["Choir pad"] rustle["Page rustle"] tone["Sung tone"] voice["Voice gains"] offset["Mic-color offset"] source["Source gain S"] mute["Mute gain"] hpf["High-pass"] eq["3-band EQ"] fader["Fader gain"] pre["Pre-fader send"] post["Post-fader send"] aux["Aux master"] wedge["Wedge panner"] pfl["PFL"] afl["AFL"] solo["Solo bus"] bus["Bus"] masterMute["Master mute"] master["Master fader"] ring["Ring oscillator"] ringGain["Ring gain e"] ringBus["Ring bus"] sum["House sum"] panner["HRTF panner"] spatial["Spatial sum"] conv["Convolver"] roomHear["Room hear"] hear["Headphone mix"] limiter["Limiter"] cap["Hard cap"] outMute["Output mute"] dest["Destination"] speech --> voice choir --> voice rustle --> voice tone --> voice voice --> offset --> source --> mute --> hpf --> eq eq --> pfl --> solo eq --> fader eq --> pre --> aux --> wedge --> spatial fader --> post --> aux fader --> afl --> solo fader --> bus --> masterMute --> master --> sum fader --> panner --> spatial ring --> ringGain --> ringBus --> sum ringBus --> spatial spatial --> conv --> roomHear --> hear solo --> hear hear --> limiter --> cap --> outMute --> dest
Cue timeline and judgments
Section titled “Cue timeline and judgments”A cue is live while the clock is inside [openMs, lateEndMs] and the learner has not committed it. The prompt for the next cue can show before openMs. Mark is enabled only while the cue is live. After lateEndMs the clock commits a miss.
sequenceDiagram
participant Clock
participant Learner
participant Judge
Clock->>Learner: openMs, prompt is visible
alt Mark before onTimeStartMs
Learner->>Judge: Mark
Judge-->>Learner: early, 1 point
else Mark from onTimeStartMs through onTimeEndMs
Learner->>Judge: Mark
Judge-->>Learner: on time, 2 points
else Mark after onTimeEndMs and by lateEndMs
Learner->>Judge: Mark
Judge-->>Learner: late, 1 point
else No mark when the clock passes lateEndMs
Clock->>Judge: missed, 0 points
end
Judge->>Judge: level from the displayed meter
Judge->>Judge: worst feedback bout on this cue
Timing points: on time 2, early or late 1, missed 0.
Level uses the same displayed meter as the strip and the clip light. Clip is a meter above 1.
| Condition | Level | Points |
|---|---|---|
| Meter above 1 | clipping | 0 |
| Cue expects mute, and the channel is muted or the meter is within the max | good, unless the meter clips | 2 |
| Cue expects mute, and the channel is up past the max | too hot | 1 |
| Cue expects sound, and the channel is muted | too quiet | 1 |
| Meter above targetMax | too hot | 1 |
| Meter below targetMin | too quiet | 1 |
| Otherwise | good | 2 |
The intro unity cue targets 0.35 to 0.95 on that displayed meter. At 0 dB, source 0.5, and 8 dB under unity, the meter is about 0.83, so the cue scores good and the clip light stays off.
Feedback points sit on the same cue. A bout starts when a mic on the live cue is ringing or feeding back, and ends when that clears. The worst bout is the one with the fewest points.
| Bout | Points |
|---|---|
| No bout | clean, 2 |
| Ring pulled down within fastCorrectionMs | ringing corrected, 1 |
| Ring still present, or corrected too late | left ringing, 0 |
| Feedback pulled down within fastCorrectionMs | feedback corrected, −1 |
| Feedback left running | feedback, −2 |
Cue total is timing plus level plus feedback. The maximum is 6. A cue that asks for a natural voice adds up to 2 tone points. A cue that names a monitor adds up to 2 monitor points. The saved score is the sum. The saved max is the sum of those per-cue maxima, so a cue drill stays at 6 per cue.
Feedback and ringing
Section titled “Feedback and ringing”Loop gain L is in dB. Unity is 0 dB. μ is 10^(L/20) when the mic is open, and the loop is open (no recirculation) when the mic is muted, the channel fader is at −∞, or the master is muted or at −∞.
The room filter chooses the frequency. Each peak is a Lorentzian bump of frequency, Q, and gain on a 0 dB floor. Peaks add in linear amplitude, in phase. The critical frequency is the peak center with the highest room gain. Other frequencies shift L by roomDb(f) − roomDb(fCrit), so the worst peak is not counted twice. The loop delay is the time for one trip. It sets how fast a tone grows or decays. It is not a second reverb time.
Open mics on the same mix add 10·log10(N) dB to L when N > 1, and 0 dB for one mic. Only channels listed as mics count. A doubled count is about 3 dB less gain before feedback.
stateDiagram-v2 [*] --> Stable Stable --> Ringing: L inside the margin, program into the mic, tail audible Ringing --> Stable: input stops, the tail decays, or L leaves the margin Ringing --> Building: L reaches 0 dB before the tail is audible Ringing --> Howling: an audible ring crosses unity Stable --> Building: L reaches 0 dB and the tone is still under the audible threshold Building --> Howling: the tone reaches the audible threshold Building --> Stable: L drops below 0 dB before the tone is audible Howling --> Ringing: L returns inside the margin while the cue is still present and the tail is audible Howling --> Stable: L drops below the margin and the tail decays, or mute opens the loop
Each resonant peak has its own loop gain. The strip follows the peak, and the path, whose loop gain is highest. A narrow mid cut at that frequency lowers the loop gain there and raises the fader position where the loop reaches unity. A cut at some other frequency leaves that threshold where it was. The house path and each wedge run the same machine on their own peaks and their own delay. Pulling the channel fader down opens a post-fader wedge. It does not open a pre-fader wedge. Mute opens every path on that mic.
Inside the margin (default 6 dB below unity, set per scenario) the loop is stable. Sound into the mic excites a tail at the critical frequency. The tail lasts longer as L approaches 0 dB. With no input, a stable loop does not ring, and the noise floor is not injected.
At or above unity the loop is unstable. The noise floor seeds it when nothing is going into the mic, and the post-fader program feeds it when there is a cue. The strip shows Feedback immediately, then FEEDBACK once the tone crosses the audible threshold. An audible ring that is pushed across unity howls immediately. It does not pass through the building state, because the tail is already loud. More excess gain grows faster. Pulling the fader back inside the margin while the cue is still present rings, and that tail then decays to stable. Pulling it below the margin, or muting, takes the strip to stable. Mute or −∞ clears the tone on the next trip.
Signal path
Section titled “Signal path”S is the cue source level, linear. P is the post-fader program, linear. y is the closed-loop sum stored by nextToneDb, linear. e is the regenerative excess the meter adds, linear. Trim is fixed at 0 dB. This slice has no trim control.
flowchart LR
cue["Clean cue source"]
offset["Mic-color offset"]
trim["Source gain S"]
mute{"Channel mute"}
hpf["High-pass"]
eq["3-band EQ"]
fader["Channel fader dB"]
program["Post-fader program P"]
pre["Pre-fader aux"]
post["Post-fader aux"]
aux["Aux master"]
wedge["Wedge path"]
gbf["Gain before feedback"]
nom["Open-mic loss 10 log10 N"]
room["Peaks on this path"]
noise["Noise floor"]
loop["Loop gain L at each peak"]
sumY["Closed-loop sum y"]
excess["Excess e"]
bus["House sum of every P"]
master["Master fader and mute"]
meter["Channel meter P plus e"]
clip{"Clip light"}
score["Scoring tap uses the same meter"]
solo{"PFL or AFL"}
roomHear["Convolver and HRTF"]
dry["Dry solo bus"]
cue --> offset --> trim --> mute
mute --> hpf --> eq
eq --> pre --> aux --> wedge
eq --> fader --> post --> aux
eq --> fader --> program
program --> bus --> master
program --> meter
gbf --> loop
nom --> loop
room --> loop
eq --> loop
fader --> loop
master --> loop
wedge --> loop
noise --> sumY
program --> sumY
loop --> sumY
sumY --> excess --> meter
meter --> clip
meter --> score
eq --> solo
fader --> solo
solo -->|room| roomHear
solo -->|PFL or AFL| dry
The return path is the closed-loop sum through the room, through μ, back to the mic as the next trip of y. The loop is excited by P, not by the raw source. The meter shows P + e, not P + y. Adding y again would count the program twice, because a settled loop below unity holds y = P / (1 − μ) at every fader position.
| Stage | Formula | Unit |
|---|---|---|
| Cue source | S = sourceLevel while that channel’s cue is live, else 0 |
linear |
| Mic-color offset | Sum of the scenario bands at frequency f, applied to the dry source before the strip. variationDb wobbles shelf and peaking gains on each replay, inside that bound |
dB |
| Input trim | Broadband gain stays S. The offset is a filter, not a trim knob |
dB |
| Channel mute | Muted forces P = 0 and every path on that mic opens, so y clears |
— |
| High-pass | 2nd-order high-pass, sweepable from 40 Hz to 400 Hz, Q = 1/√2 | Hz, dB |
| Low shelf | Shelf at 120 Hz, gain from −15 dB to +15 dB | dB |
| Mid | Peaking filter, frequency 200 Hz to 8 kHz, gain −15 dB to +15 dB, Q 0.4 to 8 | Hz, dB, Q |
| High shelf | Shelf at 8 kHz, gain from −15 dB to +15 dB | dB |
| Channel EQ at f | eqDb(f) is the sum of those four filters. Flat knobs are about 0 dB through the voice range |
dB |
| Channel fader | channelDb = faderDb(position). Position 0 is −∞. P = S × 10^(channelDb/20) when the channel is up |
dB, then linear |
| Gain before feedback | gainBeforeFeedbackDb for that mic. A sensitive mic is a lower number. It enters loop gain as a subtraction |
dB |
| Summing bus | bus = Σ P over every channel |
linear |
| Master | masterDb = faderDb(master position). Master starts at 0 dB. Muted master output is 0, otherwise bus × 10^(masterDb/20) |
dB, then linear |
| Open-mic loss | N is mics that are unmuted, with a finite channel fader, and a master that is unmuted and finite. NOM = 0 when N ≤ 1, else 10×log10(N) |
dB |
| Room filter | Lorentzian peaks, added in linear amplitude on a 0 dB floor. roomDb(f) = 20×log10(1 + Σ (10^(gainDb/20) − 1) × resonance). The critical peak is the highest roomDb. Delay is loops = dtMs / loopDelayMs |
dB, and trips |
| Pre-fader aux | sendDb + auxMasterDb after EQ and mute, before the channel fader. The channel fader does not change it |
dB |
| Post-fader aux | channelDb + sendDb + auxMasterDb. The channel fader at −∞ silences it |
dB |
| Wedge loop | L = auxSendDb + eqDb(f) − wedgeGainBeforeFeedbackDb + NOM + wedgeRoomDb(f) − wedgeRoomDb(fCrit). Each wedge has its own peaks and loopDelayMs |
dB |
| Loop gain | House: L = channelDb + masterDb + eqDb(f) − gainBeforeFeedbackDb + NOM + roomDb(f) − roomDb(fCrit). Not open: L is −∞. The worst peak after EQ sets the strip |
dB |
| Loop factor | μ = 10^(L/20) when the mic is open |
linear |
| Noise floor | Added to the excite only when L ≥ 0. Stable loops do not ring from noise |
linear |
| Closed-loop sum | y advances by loops trips: μ^k × y + excite × (μ^k − 1) / (μ − 1). Excite is P, plus the noise floor when L ≥ 0. Settled, μ < 1: y = P / (1 − μ) when there is no noise. At unity, y grows by the excite each trip |
linear |
| Regenerative excess | e = max(0, y − P). Settled, with no noise: e = P × μ / (1 − μ) at every fader. Above unity, e follows the growing y |
linear |
| Channel meter | M = P + e |
linear |
| Clip light | On when M > 1 |
— |
| Master meter | Master output of the bus, plus Σ e. The excess is not multiplied by the master gain again |
linear |
| Scoring tap | judgeLevel(M, targetMin, targetMax, expectMuted, muted). Same M as the channel meter and the clip light |
linear |
| Voice | One procedural source per channel: speech bursts, choir pad, page rustle, or sung tone. The chosen voice gain is 1. The others are 0 | linear |
| Source gain | S |
linear |
| Mute gain | 0 when the channel is muted, else 1 | linear |
| Fader gain | dbToGain(faderDb(position)). With source gain and mute gain, the product is P |
linear |
| Bus | Σ P |
linear |
| Master mute | 0 when the master is muted, else 1 | linear |
| Master fader | dbToGain(masterDb) |
linear |
| Ring oscillator | Sine at the mic’s worst peak, the same hertz as the strip | Hz |
| Ring gain | e = excessFromTone(P, toneDb). Settled, with no noise, that is P × μ / (1 − μ) |
linear |
| Sum | (Σ P) × master mute × master fader + Σ e. This is the master meter |
linear |
| Peaking filters | One biquad peaking filter per room peak: frequency, Q, and gain taken from that peak | Hz, Q, dB |
| Loop delay | One trip of loopDelayMs / 1000 seconds, mixed with the dry path. No second recirculating loop |
seconds |
| Limiter | Compressor before the output. Threshold −1 dB, knee 0, ratio 20, attack 0.003 s, release 0.05 s | — |
| Hard cap | Constant HARD_MASTER_CAP (0.25) after the limiter |
linear |
| Output mute | 0 when audio is off, else 1. Mute all closes every channel and the master, which opens every loop | linear |
| HRTF panner | One PannerNode per channel and per wedge, panningModel = HRTF, at the sanctuary coordinates. The listener follows the camera |
— |
| Convolver | One generated stereo impulse, about 0.7 s, exponential decay, no venue name. It is what the headphones play when no solo is on | — |
| PFL | Gain 1 after the EQ and before the fader. The convolver gain goes to 0 | linear |
| AFL | Gain 1 after the fader, still dry. The convolver gain goes to 0 | linear |
| Tone score | Mean absolute of eqDb(f) + offsetDb(f) across octave-ish samples, against flat. A narrow cut at the scenario’s ring frequency is left out. Over-EQ is the largest overshoot past the offset |
dB, points |
| Monitor score | Aux program judged against the cue’s monitor window. Good is 2, too hot or too quiet is 1 | linear, points |
Data model
Section titled “Data model”Scenarios belong to one profile. A study-plan step does not get a foreign key. Its completion_config.scenarioSlugs names the scenarios, and materializing a study copies that config onto the study step. A practice result points at the learner, the study step, and the scenario. purpose is only practice in this slice.
erDiagram
SoundBoardProfile ||--o{ SoundBoardScenario : has
SoundBoardScenario ||--o{ SoundBoardPracticeResult : scored
User ||--o{ SoundBoardPracticeResult : owns
StudyStep ||--o{ SoundBoardPracticeResult : records
StudyStep }o--o{ SoundBoardScenario : "scenarioSlugs in completion_config"
SoundBoardProfile {
uuid id
string slug
string name
int channel_count
string audience
json channels
json room
}
SoundBoardScenario {
uuid id
uuid sound_board_profile_id
string slug
string title
string kind
json cues
json settings
}
SoundBoardPracticeResult {
uuid id
int user_id
uuid study_step_id
uuid sound_board_scenario_id
string purpose
int score
int max_score
json cue_outcomes
}
StudyStep {
uuid id
string completion_mode
json completion_config
}
channels is a list of {key, label}. room is {loopDelayMs, peaks: [{hz, q, gainDb}], monitors: [{id, label, loopDelayMs, gainBeforeFeedbackDb, peaks}]}. settings holds ringMarginDb, fastCorrectionMs, noiseFloor, audibleThreshold, goal, offsets, and mics: [{channelKey, gainBeforeFeedbackDb, sensitive}]. An offset is {channelKey, variationDb, bands: [{type, hz, gainDb, q}]}. type is highpass, lowpass, lowshelf, highshelf, or peaking. Each cue holds id, prompt, channelKey, openMs, onTimeStartMs, onTimeEndMs, lateEndMs, sourceLevel, targetMin, targetMax, expectMuted, hint, toneGoal, notchHz, monitorId, monitorTargetMin, and monitorTargetMax. Cues without a tone goal or a monitor id still score out of 6.
The seeded profile is generic-8: eight channels plus a master strip drawn by the UI. The master is not a profile channel. One room is seeded, with two wedges. It has no venue name. The level 3 scenarios are notch-the-ring (boomy pastor, notch 1.6 kHz), pastor-monitor (Monitor 1, pre-fader), and choir-monitor-tone (muddy choir, Monitor 2). A thin handheld offset is seeded beside the pastor on the notch scenario so a new color is another block in the catalog.
flowchart TD
pick[Learner picks a level 3 scenario]
start[Start rolls offset variation and clears EQ]
hear[Headphones play the colored mic in the room]
act{What is the goal?}
notch[Narrow cut at the ring, fader stays up]
wedge[Aux send into the monitor window]
tone[EQ cancels the offset toward flat]
mark[Mark]
score[Timing, house meter, feedback, tone, monitor]
pick --> start --> hear --> act
act -->|ring| notch --> mark
act -->|wedge| wedge --> mark
act -->|muddy choir| tone --> mark
tone --> wedge
mark --> score
Level 3 pipeline
Section titled “Level 3 pipeline”This is the path from a colored mic to the headphones, one stage at a time. The model in soundBoard.ts decides the meter, the ring, and the score. soundBoardAudio.ts copies those gains onto Web Audio nodes. The two stay aligned because they read the same functions. They do not read each other.
What the learner is doing
Section titled “What the learner is doing”Three practice scenarios sit after the cue drills.
- Notch the ring. The pastor mic starts boomy. At 0 dB the house loop is inside the ring margin at 1.6 kHz, so the voice rings. A narrow mid cut there drops that peak below the next one and puts the loop outside the margin, so the fader can stay up. Pulling the fader down, or cutting some other frequency, does not.
- Pastor monitor. Monitor 1 is pre-fader. The send has to land in a window. Hotter than that and the wedge path rings on its own peaks, even if the house fader comes down.
- Choir monitor and tone. The choir mic starts muddy. The learner cancels that offset with the channel EQ and sets Monitor 2 without waking the second wedge.
Stage by stage
Section titled “Stage by stage”-
Mic source. One procedural voice is selected. Speech, choir, page rustle, or a sung tone. The other three voice gains are 0. Nothing is a recording.
-
Mic-color offset. Before the strip, a chain of biquads from the scenario colors that dry voice. A boomy mic is a low shelf and a low-mid bump. A thin mic is a low shelf cut and a little extra air. A muddy mic is low-mid buildup and a dull top. Each band is
{type, hz, gainDb, q}.variationDbis the most a shelf or a peaking gain may move on the next Start. A high-pass or low-pass band does not wobble. Each Start draws a fresh value inside that bound. The score uses the bands from that start, so the learner is judged on the voice they heard. A bad band is rejected byvalidateMicOffsetand is not applied. -
Source gain. The cue level
S. Mute and the fader have not happened yet. -
Mute. Gain 0 or 1. Mute opens the house loop and both wedge loops for that mic.
-
High-pass. Sweepable from 40 Hz to 400 Hz, a 2nd-order Butterworth. It is the rumble and boom control. Parked at 40 Hz it is nearly transparent through the voice range.
-
Low shelf. Fixed at 120 Hz, ±15 dB. This is the direct opposite of a lowshelf offset at the same frequency.
-
Mid. Frequency, gain, and Q. This is the notch. A narrow cut (Q at least 2, a few dB down) at the ring frequency is what raises gain before feedback.
-
High shelf. Fixed at 8 kHz, ±15 dB. This puts air back on a dull mic, or tames a thin bright one.
-
Fader and the post-fader program.
P = S × mute × fader gain. Position 0 is −∞. The broadband meter starts fromP. The EQ has already shaped the spectrum that will be judged for tone and for loop gain. It is not a second fader. -
Pre-fader send. Taken after the EQ and the mute, before the fader. Monitor 1 and Monitor 2 each have a knob and a Pre/Post button. Pre ignores the channel fader.
-
Post-fader send. Taken after the fader. The channel fader at −∞ silences it. Only one of pre or post is open on a given send.
-
Aux master. Each wedge bus has its own master knob and mute. The send level in dB is the channel fader (only when the tap is post) plus the send plus the aux master.
-
Wedge path. Each aux master feeds a panner at that wedge’s place on the platform. The wedge is its own feedback path: its own peaks, its own delay, its own gain-before-feedback. Open mics on that aux add
10·log10(N). The house can be stable while a wedge is ringing. Mute, or taking the send to −∞, or muting the aux master, opens that path. A pre-fader path stays shut only when those happen, not when the channel fader comes down. -
Per-frequency loop. For every peak on a path,
L(f) = gain into that path + eqDb(f) + the path's room curve relative to its own worst peak. The offset is not part ofL. It colors the voice. The channel EQ is in the loop because it is on the way to the speakers and the wedges. The worstLdrivesnextToneDbfor that path. Ringing still needs program inside the margin. Feedback still grows from the noise floor at or above unity. Recovery is the same machine as before, once per path. -
House sum. Every
Psums, then the master mute and the master fader. The ring oscillator, gaine, joins after the master so the sum matches the master meter. -
Limiter and hard cap. The headphone mix enters a fast compressor (threshold −1 dB, knee 0, ratio 20, attack 3 ms, release 50 ms), then a gain of
HARD_MASTER_CAP(0.25), then the output mute. Audio off is that output mute at 0. Mute all and Esc still close every channel and the master. -
Room path. With no solo, the learner hears the sanctuary on headphones. Each channel’s post-fader tap and each wedge enter an HRTF
PannerNodeat the mesh coordinates insanctuaryLayout.ts. The listener pose is the Babylon camera: position, forward, and up, sent every frame. Those panners sum into oneConvolverNode. The impulse is generated in the browser: a short stereo decay with a few early taps, deterministic, and not a recording of a real room. The older peaking filters and the single delay stay on the house sum so the resonant model is still in the graph. Their headphone gain is 0, so the voices are not played twice. The ring that represents those resonances is mixed into the spatial sum, which is what the convolver hears. -
PFL and AFL. PFL is the channel after EQ and before the fader. AFL is the channel after the fader. Both skip the panners and the convolver and sum on a dry solo bus, the way console headphones do. If any solo is on, the convolver path is gated off. Releasing the last solo opens the room again. The limiter and the 0.25 cap stay on either path.
What the learner hears
Section titled “What the learner hears”| Stage | Node | Model value | What the learner hears |
|---|---|---|---|
| Mic source | Buffer or oscillators, then a voice gain | One of speech, choir, rustle, tone at gain 1 | The chosen voice, dry and clean |
| Mic-color offset | Up to six BiquadFilterNodes |
Scenario bands, plus replay wobble within variationDb |
That mic’s character: boomy, thin, or muddy |
| Source gain | GainNode |
Cue level S |
The voice gets louder when the cue is live |
| Mute | GainNode |
0 or 1 | Silence, and the loops open |
| High-pass | BiquadFilterNode highpass |
40–400 Hz, Q = 1/√2 | Rumble and boom fall as the knob rises |
| Low shelf | BiquadFilterNode lowshelf |
Gain at 120 Hz | Warmth comes up or goes away |
| Mid | BiquadFilterNode peaking |
Frequency, gain, and Q | A narrow cut or a wider tone move |
| High shelf | BiquadFilterNode highshelf |
Gain at 8 kHz | Air, or a darker top |
| Fader | GainNode |
faderDb(position) |
The channel level in the house |
| Pre-fader send | GainNode after EQ |
Send gain when the tap is Pre, else 0 | The wedge feed, independent of the fader |
| Post-fader send | GainNode after the fader |
Send gain when the tap is Post, else 0 | The wedge feed follows the fader |
| Aux master | GainNode |
Aux fader, or 0 when muted | How loud that wedge bus is |
| Wedge | PannerNode HRTF |
Wedge coordinates, path L(f), path delay |
The wedge in the room. It can ring by itself |
| House sum | Bus, master mute, master fader | (Σ P) × master |
The house mix |
| Feedback | Oscillator into the ring bus | e at the worst peak’s hertz |
The ring, then the howl, on the path that is worst |
| Room | PannerNodes into one ConvolverNode |
Generated impulse, camera pose | The sanctuary on headphones |
| PFL | GainNode before the fader |
1 while PFL is on | Dry channel, room gone |
| AFL | GainNode after the fader |
1 while AFL is on | Dry post-fader channel, room gone |
| Limiter | DynamicsCompressorNode |
Threshold −1 dB, ratio 20 | Peaks are held down |
| Hard cap | GainNode |
0.25 | The safety cap, always |
| Output mute | GainNode |
1 when audio is on, else 0 | Silence when audio is off. The meter keeps moving |
How the meter and the headphones stay in step
Section titled “How the meter and the headphones stay in step”The strip meter, the clip light, and judgeLevel all read displayedMeter. That is the post-fader program plus the regenerative excess from the house loop, plus the excess from each wedge loop. It is unlimited. The headphones are not. They pass through the solo switch, the convolver or the dry solo bus, the limiter, and the 0.25 cap. Those last stages protect the ears. They are not copied back into the meter, so a capped howl still scores as feedback and can still light the clip. Audio off sets only the output mute to 0. The labels and the meter keep running. Mute all and Esc close the channels and the master, which opens the loops, so the meter and the headphones both fall quiet together. Tone points and monitor points are extra on the cues that ask for them. A cue with neither still totals at most 6, from timing, level, and feedback.
Saving and reading results
Section titled “Saving and reading results”Queries and the save mutation require a logged-in learner. soundBoardProfiles and soundBoardScenarios return the catalog. soundBoardPracticeResults(studyStepId) returns only rows for the signed-in user on a study they own, newest first.
sequenceDiagram
participant Learner
participant API
participant DB
Learner->>API: saveSoundBoardPracticeResult
alt Not signed in
API-->>Learner: Unauthenticated
else Study belongs to someone else
API-->>Learner: Study not found
else Step is not a Simulator
API-->>Learner: This step is not a simulator
else Slug is not on the step, or unknown
API-->>Learner: That scenario is not on this step
else Cue list or points disagree with the table
API-->>Learner: Practice score does not match the cue results
else Owned Simulator step, slugs and points match
API->>DB: insert purpose practice
API-->>Learner: id, purpose, score, maxScore, createdAt
end
Learner->>API: soundBoardPracticeResults
API->>DB: rows for this user and this step
API-->>Learner: practice history
The API recomputes each cue’s points from the timing, level, and feedback strings, and from the tone and monitor strings when that cue asks for them. It does not resimulate loop gain. A later certification pass can rescore from a control trace. The client cannot choose a purpose. The column is always practice.
Admin scenario editor
Section titled “Admin scenario editor”Curriculum designers edit scenarios at /admin/simulator. The form writes the fields the practice engine reads: name and description, channel keys and mic labels, gain before feedback, mic-color offset bands (type, Hz, gain, Q) and variationDb, room and wedge feedback peaks, aux taps (pre or post), and cue scoring (meter window, ring frequency, wedge assignment, tone goal).
Those layout fields are stored on the scenario. The shared generic-8 profile is left as seeded. When a scenario has its own channels, room, or wedges, the scenario query returns that copy as profile. auxSends is the starting tap for each channel and wedge. A missing pair stays pre-fader.
Offset bands are checked with MicOffset on the API and validateMicOffset in the editor. A band the validator rejects is not saved. The study-plan step editor still only chooses which scenario slugs a simulator step includes.