Closed sepowitz closed 2 years ago
You can manipulate the audio pretty easily by passing a ToneAudioNode
as the destination
prop to activate
and then manipulating that node however you like.
For example:
import activate from '@generative-music/piece-zed';
import { Chorus } from 'tone';
const chorusNode = new Chorus().toDestination(); // create a chorus effect node and connect it to the audio destination
activate({
destination: chorusNode, // route the output of this generator through the chorus node
//...
}).then(([deactivate, schedule]) => {
const end = schedule();
// later, in response to some user input
chorusNode.frequency.value = 1;
chorusNode.wet.value = 0.5;
// etc
});
You could even build a whole chain of audio nodes, and just pass the first node of your chain as the destination
prop.
Hey Alex,
Firstly, I just wanted to say how great this (these repos) are. I was able to get samples set up locally, and have been playing around the some of the existing pieces you've created.
I was wondering if there is an existing pattern for manipulating pieces using Tone.js as they are playing via the activate method you provide.
For example, I begin playing a piece, and then can apply effects to it via some user input.
Thanks again!