/ simulated_instruments / cymbal
Sign in
simulated_instruments / cymbal
cymbal / matlab / cymbal_defaults.m
83 lines · 2.5 KBBlameHistoryRaw
1function P = cymbal_defaults()
2% CYMBAL_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% Plate geometry (a 16-inch crash-ride)
7P.radius_m = 0.2032;
8P.hole_radius_m = 0.0064;
9P.bell_radius_m = 0.0450;
10P.bell_height_m = 0.0170;
11P.bow_height_m = 0.0200;
12P.thickness_bell_m = 0.00115;
13P.thickness_rim_m = 0.00075;
15% Material (B20 bell bronze)
16P.density = 8700.0;
17P.youngs_modulus = 1.05e11;
18P.poisson_ratio = 0.33;
19P.stiffness_trim = 1.00;
21% Hammering and lathing: the departure from an exactly axisymmetric plate
22P.hammer_mix = 0.55; % strength of the hybridization of near neighbours
23P.hammer_bw = 0.05; % relative frequency window it acts over
24P.hammer_detune = 0.004; % relative scatter of the mode frequencies
25P.hammer_seed = 7;
27% Discretization / mode retention
28P.n_elements = 28;
29P.n_diameters = 56; % highest circumferential order solved for
30P.min_mode_hz = 40.0;
31P.max_mode_hz = 10000.0;
33% Damping
34P.damp_rate = 1.70; % s^-1, frequency-independent decay rate
35P.loss_factor = 2.0e-5;
36P.loss_slope = 3.0e-10;
37P.radiation_loss = 1.0;
38P.mount_loss = 3.0; % N s/m dashpot at the inner edge (felt and stand)
40% Stick (nylon-tip drumstick)
41P.tip_radius_m = 0.0050;
42P.stick_mass_kg = 0.030;
43P.stick_youngs = 5.0e9;
44P.restitution = 0.55;
46% Strike gesture
47P.strike_velocity = 3.0;
48P.strike_r = 0.94; % 0 at the hole, 1 at the rim
49P.strike_angle_deg = 40.0; % 0 = normal to the surface, 90 = tangential
50P.strike_count = 1;
51P.strike_rate_hz = 6.0;
52P.roll_r2 = 0.80; % second contact radius when strike_count > 1
53P.timing_jitter_ms = 8.0;
54P.velocity_spread = 0.18;
55P.seed = 1;
57% Nonlinear cascade
58P.cascade_gain = 800.0;
59P.cascade_back = 0.45; % downward / upward transfer ratio
60P.cascade_ratio = 1.19; % frequency ratio of one transfer step (2^0.25)
61P.cascade_leak = 1.0; % 1 = energy leaving the top mode is lost
62P.cascade_step_ms = 1.0;
63P.turbulence = 0.0; % log-amplitude spread of the fluctuation (off)
65% Radiation / listener
66P.direct_gain = 1.0;
67P.dipole_scale = 1.0;
68P.n_azimuth = 224; % azimuthal samples in the listener transfer
69P.listener_x_m = 0.40;
70P.listener_y_m = 0.00;
71P.listener_z_m = 0.40;
72P.speed_of_sound = 343.0;
73P.air_density = 1.204;
75% Rendering / output
76P.sample_rate = 48000;
77P.oversample = 2;
78P.tail_s = 3.0;
79P.pre_delay_ms = 3.0;
80P.normalize = 1;
81P.peak_dbfs = -3.0;
82P.full_scale_pa = 5.0;
83end
↑↓ move↵openescclose