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