1% Render a pizzicato bass note with default parameters and print diagnostics.
2% Set P.note_count = 8 for a walking line.
3% Run with: numbl run bass_demo.m
5P = bass_defaults();
6tic;
7[y, basis, dinfo] = bass_render(P);
8elapsed = toc;
10fprintf('notes : %d (midi ', dinfo.noteCount);
11fprintf('%d ', dinfo.midi);
12fprintf(')\n');
13fprintf('fingerings : %d, %d coupled modes in total\n', dinfo.fingerings, dinfo.modesTotal);
14fprintf('fundamental: %.2f Hz, T60 %.2f s (note 1)\n', dinfo.fundHz, dinfo.fundT60);
15fprintf('body : A0 %.1f Hz, top corpus mode %.0f Hz\n', basis.bodyF(1), max(basis.bodyF));
16fprintf('peak press.: %.4f Pa (%.1f dB SPL) at %.0f cm\n', ...
17 dinfo.peakPa, dinfo.peakSplDb, dinfo.listenerDistM * 100);
18fprintf('length : %.2f s @ %d Hz\n', length(y) / P.sample_rate, P.sample_rate);
19fprintf('render time: %.2f s\n', elapsed);
20if dinfo.listenerInside
21 fprintf('WARNING : listener is at or inside the body\n');
22end