Closed Alextopher closed 2 years ago
Thanks @Alextopher, I like the idea as this might motivate some people who want to build synthesizers! :D I'll try to have a deeper review after work and test it!
@Alextopher while testing the example, I could hear some volume differences, so I recorded each sound wave, and here is the result:
Sine | Triangle | Square | Saw | Saw reversed |
---|---|---|---|---|
Seems all good! | Volume lower, from the image we can see it does not span across the [-1,0[ value range. We might want to fix that | All good! :) | All good! | This one is easy to fix: just substract 1 to the final values (return currentValue - 1) ;-) |
Sorry for the delay to answer~
Awesome catches! I'm not big into this audio stuff and thought I heard some off sounds. It never occurred to me to use something like Audacity to debug them. If I contribute again I'll keep that trick in mind.
I was experimenting with some simple waveform generators. I noticed the
generators
sub package could generate a sine wave. Is there any interest in adding some other classic waveforms? Proposing adding Sine, Square, Triangle, Sawtooth, and Reversed Sawtooth generators.I updated the tone-player example. It's not just an example on using the new waveforms, it also using many of the compositors.
A breaking change: the frequency argument to the previous sine generator was an integer which was then casted to a float. There's no particular reason to not accept a float as the argument other than it would now introduce a breaking change.