Amazingly, with just a few lines of code, we created an instrument capable of playing any pitch. But we're not stopping there. Let's explore some modifications to make our instrument more unique. We have the Katiana instrument that plays cat samples according to the right pitch. Surprisingly, it was much easier than expected with the help of the ToneJS library. We also have the sampler element, which allows us to map samples to the right note. And don't judge too soon, because I've created something special: the doggyana instrument, which plays dog samples. There are many different elements in this library, including synthesizers, parts, noise, and audio tracks, that can enhance the user experience.
How does that look and sound like? Amazingly, those few lines of code, we created the instrument which is capable to play any pitch you want. But we are not stopping here because so far, we're using just default sounds. And for that, I thought to add some a bit modifications to make our instrument a bit more unique.
We have this is Katiana instrument which plays cat samples but still according the right pitch. And honestly, I was surprised how easy that is to make the ToneJS library, because in my imagination, I thought that I will need to change every sample by myself and then just to map it to the help of Tone library. But that was way easier than this. Let's look into.
We have one more element from Tone library, it is called the sampler. And for sampler initialization, I had to provide the original cat sample, which is here. And then to map it to the right note. So to understand what cat was singing, that was the tough part. But nothing more was needed to provide. All other adjustments were done by the library itself. And you see that in the play note now I'm triggering sampler and synthesizer together.
Now, some of you may think, cat sound instrument, super useful information. But don't judge me too soon. Because for those few of you, I went an extra mile. And I created something else, something special. This is doggyana instrument, which plays dog samples according to the right pitch. But not only this. There are many different elements and I do not want to overhelm you with many different details but just quick overview what you can use in this library. Let's start with different synthesizers, before I was using synth now you see that I have polysynth as well. I can provide different parameters as different oscillators, squares, sines and so on and so on. Then there is the part, part is element which helps you to play predefined notes with predefined instrument. I'm taking for example here chords even from separate constant files and then I have the loop on top of everything and so on. Then different element is noise, noise here I'm not just playing straightly I'm adding the filter, auto filter which makes some waving effect and then back to basics I have some audio tracks I'm playing them randomly and the general parameters is changing tempo, the speed of the microphone, the speed of the mic and speed up a bit so there are many different elements which you can use according to different users actions and usually when we are thinking about front end development our full focus is only on visual parts sometimes we totally forget that we have audio possibility in the dev, but please know that sometimes the right audio can really enrich our visuals and in this way we can create the next level user experience in the dev. And with this, I want to finish up.
Comments