function [y, basis, dinfo] = bass_render(P) % BASS_RENDER Full render: notes -> basis -> radiate -> output. % Convenience composition of the stage functions; the web app calls the % stages separately so it can cache intermediates (the per-fingering % eigensolves above all). [tOn, midi, str, stop, force, ninfo] = bass_notes(P); basis = bass_basis(P, str, stop); fsHi = P.sample_rate * P.oversample; [p, radinfo] = bass_radiate(P, basis, tOn, str, stop, force, fsHi); [y, peakPa] = bass_output(P, p, P.oversample); dinfo.noteCount = ninfo.count; dinfo.durationS = ninfo.durationS; dinfo.meanForce = ninfo.meanForce; dinfo.maxForce = ninfo.maxForce; dinfo.midi = midi; dinfo.tOn = tOn; dinfo.str = str; dinfo.stop = stop; dinfo.fingerings = basis.nf; dinfo.modesTotal = basis.n; dinfo.fundHz = radinfo.fundHz; dinfo.fundT60 = radinfo.fundT60; dinfo.peakPa = peakPa; dinfo.peakSplDb = 20 * log10(peakPa / 20e-6 + 1e-30); dinfo.listenerDistM = radinfo.listenerDistM; dinfo.listenerInside = radinfo.listenerInside; dinfo.ninfo = ninfo; end