AudioSequencerTest

               
by
Published May 11, 2022 at 11:40
Open In Editor


This patch implements a simple drum computer with pretty precise timing. It includes a bugfix of the webaudio based "SamplePlayer" op. The "time" parameter was not functional. How and why this works: For musical applications, playback of a sample has to be scheduled ahead with sample accuracy. The "PrecisionTriggerSeqTest" op calculates when exactly the next play has to happen, if a "drumgrid" step is set to play. It then outputs the trigger for ModifiedSamplePlayer together with a precisely calculated predelay, based on current update time. ModifiedSamplePlayer will take this delay, combine it with the "global internal time" provided by the WebAudio context, and schedules the play accordingly. Since all Sequencer ops use the same timebase for their calculation, and because the playback scheduling of WebAudio appears to be indeed sample accurate, this works!

This is a proof of concept. Improvements needed: Better estimate of how long ahead the scheduling has to happen, double trigger prevention, blah.

Have fun experimenting!

Licence: Attribution

Commercial use ok, must credit the author, can remix and reuse this work.
 



More patches made by cables users





what is cables?


Cables is a tool for creating beautiful interactive content. With an easy to navigate interface and real time visuals, it allows for rapid prototyping and fast adjustments.

cables is free to use!

Register