1% Render a cymbal crash with default parameters and print diagnostics.
2% Set P.strike_count = 8 for a repeated ride figure, P.strike_r = 0.1 for the
3% bell, P.strike_velocity = 0.7 for a tap on the same instrument, or
4% P.cascade_gain = 0 to hear the plate as an exactly linear resonator. Setting
5% P.hammer_mix = 0 recovers the ideal axisymmetric plate, which is worth
6% hearing once: it is a bell, because only its lowest few nodal-diameter
7% orders can radiate at all.
8% Run with: numbl run cymbal_demo.m
10P = cymbal_defaults();
11tic;
12[y, basis, dinfo] = cymbal_render(P);
13elapsed = toc;
15fprintf('modes kept : %d up to n = %d nodal diameters (%.0f Hz to %.0f Hz)\n', ...
16 dinfo.modesKept, dinfo.maxN, basis.f(1), basis.f(end));
17fprintf('lowest : ');
18fprintf('%.0f ', basis.f(1:min(10, basis.n)));
19fprintf('Hz\n');
20fprintf('strikes : %d at %.1f Hz (mean v %.2f m/s, mean contact %.0f us, peak force %.0f N)\n', ...
21 dinfo.strikeCount, P.strike_rate_hz, dinfo.meanV, dinfo.meanTauUs, dinfo.peakForceN);
22fprintf('cascade : peak w_rms %.1f um = %.2f thicknesses, %.1f%% of the injected energy left the top\n', ...
23 dinfo.peakWrmsUm, sqrt(dinfo.peakStrength), 100 * dinfo.cascadeLostJ / max(1e-30, dinfo.injectedJ));
24fprintf('peak press.: %.4f Pa (%.1f dB SPL) at %.0f cm\n', ...
25 dinfo.peakPa, dinfo.peakSplDb, dinfo.listenerDistM * 100);
26fprintf('length : %.2f s @ %d Hz\n', length(y) / P.sample_rate, P.sample_rate);
27fprintf('render time: %.2f s\n', elapsed);
28if dinfo.listenerInside
29 fprintf('WARNING : listener is at or inside the plate\n');
30end