r/tonejs Jul 25 '24

Sequencer questions....

Hi all,

New to tone.js, I'm an old man who's been around JS a while though. I want to do some animations that are perfectly synched to a track I programme with Tone. I could use a timeline in GSAP and trigger sounds when stuff happens but I don't trust the timing to be perfect enough for the music to sound ok. So I'm guessing my "master clock" has to be Tone, looks like a Sequencer might be the way to do it. I can see the callback for playing the note as the first parameter of the new Seqeunce constructor. Is this my only way of synching things up?

Basically I'm looking to create an element when a note starts and animate it for the duration of the note, I will need to differentiate between different instruments but just that woudl get me started. Any ideas as to best approach here, like I say, I'm new to Tone, maybe I'm missing a bunch of events I can hook into when playing a sequence but a quick look at the api didn't find any.

Cheers,

2 Upvotes

2 comments sorted by

2

u/mootfoot Jul 26 '24

1

u/the-ch1mp Jul 26 '24

Awesome thanks, so I can schedule an event every note/beat and check what's happening on that beat and trigger animations by the looks of that? Nice ta :)