Bounce Audio Sample
-
Hey, I would like to Bounce a audio sample from my AudioLoop Player with all the effects.
I think I need to use
Engine.renderAudio(eventList, callback);
however I am not so sure how I can create a single MIDI Player.How can I trigger a single midi note and render the Audio?
-
@oskarsh create an array with two message holders, one note on and one note off and pass that into the function as eventList.
-
@Christoph-Hart I got the Audio to render however I am still wondering how someone would go about dragging this audio to a DAW? Can you share a minimal example or guide me into the correct direction with this?
inline function createEventList() { local events = []; local on = Engine.createMessageHolder(); on.setType(1); on.setChannel(1); on.setVelocity(127); on.setNoteNumber(60); on.setTimestamp(0); local off = Engine.createMessageHolder(); off.setType(2); off.setChannel(1); off.setNoteNumber(60); local numSamples = 24516; off.setTimestamp(numSamples/8); events.push(on); events.push(off); return events; } inline function onRender(obj) { local isFinished = obj.finished; if (isFinished) { Console.print('DRAG TO DAW NOW'); } } inline function renderAudio() { Engine.renderAudio(createEventList(), onRender); }
-
@oskarsh in the render finished callback, pass on the rendered buffer to a scriptpanel (save it in its data object). Then in the mouse callback on click, write the buffer to a temp file, then use this method:
(You might have to write the file in the render finished callback because it might start lagging the drag, but you‘ll see).
-
@Christoph-Hart Awesome thanks alot, will try!