Music synthesiser/sequencer using wavefolding for tone generation

Technologies: Java, Java Sound API, Swing

Foldy is a music app that writes buffers of 16bit amplitude values to an output line provided by the Java Sound API. It takes a sequence of pitch values (as MIDI note numbers) through a Swing desktop user interface, and generates a tone for each one by wavefolding a sine wave.

I used a Taylor series with 3 terms to approximate a sine function, taking inspiration and some bitwise tricks from this article.

More info