/ simulated_instruments / triangle
Sign in
simulated_instruments / triangle
triangle / matlab / triangle_defaults.m
60 lines · 1.4 KBCodeBlameHistory
96aec9cTriangle strike simulator: MATLAB model and interactive web appJeremy Magland 1function P = triangle_defaults()
2% TRIANGLE_DEFAULTS Default parameters, mirroring the web app's params.ts.
3% The output duration is not a parameter: it is
4% (strike_count - 1) / strike_rate_hz + tail_s.
6% Rod geometry (equilateral, open at the bottom-left corner)
7P.side_length_m = 0.152;
8P.gap_m = 0.015;
9P.rod_diameter_m = 0.008;
11% Rod material (steel)
12P.density = 7850.0;
13P.youngs_modulus = 2.0e11;
14P.poisson_ratio = 0.30;
15P.stiffness_trim = 1.00;
17% Discretization / mode retention
18P.n_elements = 60;
19P.min_mode_hz = 20.0;
20P.max_mode_hz = 22000.0;
22% Damping
23P.loss_factor = 6.0e-5;
24P.loss_slope = 4.0e-10;
25P.radiation_loss = 1.0;
27% Beater (steel rod tip)
28P.beater_radius_m = 0.0045;
29P.beater_mass_kg = 0.022;
30P.beater_youngs = 2.0e11;
31P.restitution = 0.60;
33% Strike / roll gesture
34P.strike_velocity = 1.5;
35P.strike_pos = 0.17; % arclength fraction: middle of the base
36P.strike_angle_deg = 20.0; % 0 = in the plane of the triangle, 90 = normal to it
59c69d1Default to a twelve-strike rollJeremy Magland 37P.strike_count = 12;
96aec9cTriangle strike simulator: MATLAB model and interactive web appJeremy Magland 38P.strike_rate_hz = 12.0;
39P.roll_pos2 = 0.40; % second contact point of a roll (the right leg)
40P.timing_jitter_ms = 6.0;
41P.velocity_spread = 0.15;
42P.seed = 1;
44% Radiation / listener
45P.direct_gain = 1.0;
46P.listener_x_m = 0.20;
47P.listener_y_m = 0.10;
48P.listener_z_m = 0.40;
49P.speed_of_sound = 343.0;
50P.air_density = 1.204;
52% Rendering / output
53P.sample_rate = 48000;
54P.oversample = 2;
55P.tail_s = 5.0;
56P.pre_delay_ms = 3.0;
57P.normalize = 1;
58P.peak_dbfs = -3.0;
59P.full_scale_pa = 2.0;
60end
↑↓ move↵openescclose