Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Please stop embedding files/images from Discord. Discord has anti-hotlinking logic in place that breaks links to Discord hosted files and images when linked to from anywhere outside of Discord. There are a multitude of file/image hosting sites you can use instead.
aaaaand... I just realized that, for some reason, I don't have those ptcops that I gave to Noxid for use in Hungry Mahins saved on my computer. It seems that they now only exist in pttune format.
For this particular synthesizer, this scheme works perfectly. However, there's a subtle flaw which makes it not work as expected for some synthesizers. I'm going to stop here for now and see if you can find said flaw on your own. A hint or two may be dropped along the way.
To use the synthesizer would then be a matter of, at each sample frame, setting the inputs to their correct values, and then calling output.getValue() and doing something with the result (probably either playing it or writing it to a wav file).
We'd also need some way of giving inputs to the synthesizer, for which we have the very simple Input device, which allows the programmer to freely modify the value it outputs:
Code:
class Input implements Device{
public double value;
public double getValue(){return value;}
}
Basically, by thinking of a synthesizer in terms of a bunch of relatively simple "devices" strung together, you can create arbitrarily complex synthesizers without having to massively reprogram everything.
Now, we're almost ready to start looking at some Java code for this. First, though, I want to attempt to illustrate the benefit of this block diagram approach.
Alright, so the waveforms we've made block diagrams for are square and sawtooth. We can easily make one for sine by introducing a device which outputs sin(2*pi*input).