Tone.js – A framework for making interactive music in the browser
github.com
github.com
Using recordings from my guitar (of each and every note) I was able to build an interactive fretboard that could play guitar tabs/chords. Also the Transport API made it simple to build a drum looping machine very quickly.
Ableton has built something similar, also using Tone.js: https://learningmusic.ableton.com/make-beats/make-beats.html
Performance on mobile leaves a lot to be desired. I found there was considerable lag.
One request - could you use a slightly longer attack on your 'basic tone' sound in the lessons? Currently there's a harsh click each time the tone plays. Just 0.05 seconds of attack would still give a 'punchy' sound, without the clicks.
is unusable in an iphone 10 and perfectly fine in chrome desktop. if anyone knows how to fix that I'd love to hear.
That is, if you set up a Tone transport to fire events every 100ms, it's not like your event handler gets called precisely 100ms later. Rather, it gets called early - say 85ms later - with a parameter saying "hey that event you wanted is precisely 14.7803ms away". Then you can call an API saying "okay, play a tone 14.7803ms from now", and Tone passes that along to web audio, and the end result is that your note plays with sample-level precision.
But if you used Tone's transport to do something other than calling web audio APIs it wouldn't be any more precise than setInterval. (IIRC Tone actually uses setInterval to fire its events.)
(listen at: https://pocoapollo.hdor.is)
Tone.js is really good at doing things related to music.
We were able to build a scratch type programming language for music, so that kids could learn programming and music at the same time.
I was thinking earlier today of creating an F1 engine note simulator. I would want to play with the number of cylinders, v angle, crank offset (v8 normal crank/180 crank) and maybe some kind of exhaust system variables (tuned length, crossover pipe), and of course RPM. I don't know where to start, could you point me at the type of programming I would want to look at to figure out how to do this?
Here is an f1 car engine playing God Save the Queen [1], sounds atrocious, but still cool.
1) Process recordings of real F1 engines at fixed RPMs to seamlessly go from one to another.
2) Approximate the sound sources and what happens to them on he way to the ear, so: oscillators and noise generators passing through filters and delays to modify the spectrum.
3) A real attempt at modelling the sound sources and the acoustics of the enclosures and pipes in terms of "what happens to the air pressure variations here".
Or use something already existing: https://www.krotosaudio.com/igniter/
For plausible approximations, which is the right way to go, you should check out PureData or (better) MaxMSP. See this tutorial by Andy Farnell
Red Bull did one too, it sounds a bit better: https://www.youtube.com/watch?v=gZIUGreqrCY
Regarding WebRTC. Combined with net latency. Can we build an online "jamming" demo?