/ simulated_instruments / recorder
Sign in
simulated_instruments / recorder
recorder / matlab / recorder_defaults.m
64 lines · 2.0 KBCodeBlameHistory
5623b11Recorder simulator: MATLAB jet-drive model and interactive web appJeremy Magland 1function P = recorder_defaults()
2% RECORDER_DEFAULTS Default parameters, mirroring the web app's params.ts.
3% A soprano (descant) recorder in C. The output duration is not a parameter:
4% it is note_count * note_dur_s + (note_count - 1) * gap_ms + tail_s.
6% Bore (window at x = 0, open foot at x = bore_length_m)
7P.bore_length_m = 0.3015;
8P.bore_r_head_m = 0.0067;
9P.bore_r_foot_m = 0.0052;
10P.wall_m = 0.003;
11P.hole_scale = 1.0;
12P.thumb_pinch = 0.35;
13P.pinch_loss = 0.5;
15% Window, windway, and jet
16P.cutup_m = 0.0045; % flue exit to labium (window length along the bore)
17P.window_width_m = 0.010;
18P.flue_h_m = 0.0010; % flue exit height
19P.flue_w_m = 0.010; % flue exit width
20P.labium_offset_m = 0.0004;
21P.jet_gain = 1.0; % receptivity trim
22P.jet_growth = 0.4; % instability growth per flue height of travel
23P.jet_conv = 0.55; % jet wave speed as a fraction of Uj
24P.jet_stcut = 0.45; % jet instability cutoff, Strouhal-like: f_c = jet_stcut Uj / W
25P.vortex_loss = 1.0; % nonlinear mouth loss coefficient
26P.noise_level = 0.03; % turbulence displacement noise on the jet
27P.direct_gain = 1.0;
29% Breath and gesture
30P.breath_pa = 350.0; % blowing pressure for C5; higher notes track up
31P.breath_track = 1.6; % pressure grows as (f_note / 523.25)^breath_track
32P.attack_ms = 12.0;
33P.release_ms = 25.0;
34P.vibrato_hz = 5.0;
35P.vibrato_depth = 0.0;
36P.note_count = 1; % 1..3
37P.note1 = 5; % index into the fingering chart: 5 = G5
38P.note2 = 6; % A5
39P.note3 = 7; % B5
40P.note_dur_s = 1.6;
41P.gap_ms = 60.0;
42P.seed = 1;
44% Modal fit
45P.max_mode_hz = 10000.0;
46P.max_modes = 12;
47P.grid_hz = 2.5;
49% Radiation / listener (window at the origin, foot along -y, holes toward +z)
50P.listener_x_m = 0.25;
51P.listener_y_m = -0.10;
52P.listener_z_m = 0.35;
53P.speed_of_sound = 343.0;
54P.air_density = 1.204;
56% Rendering / output
57P.sample_rate = 48000;
58P.oversample = 2;
59P.tail_s = 0.4;
60P.pre_delay_ms = 3.0;
61P.normalize = 1;
62P.peak_dbfs = -3.0;
63P.full_scale_pa = 0.5;
64end
↑↓ move↵openescclose