I created a patch at uni which let me use my xbox 360 controller as an intelligent MIDI controller which could be synced to any musical scale - great fun to play!
I've labeled some of the stuff in the image, so if you're familiar with the architecture of FM synths you might have an idea what's going on. I only have two modulator waves and one carrier right now. The green boxes control the frequency of the waves and the reddish ones control the gain / intensity. To make it more musically pleasing I'll probably set the modulator waves to move in a regular proportion to the carrier frequency, rather than just wherever the user sets them. Here is the patch itself if anyone is interested in tinkering with it:
FL comes with the ability to build your own synths. I don't hardly use it, as I can't code anything, but it comes with pre-made modules you can lump together.
What it actually does is transform a saw wave into a pulse of variable width. The transformation happens at the "<~" box, called "less-than operator." The essence of a pulse wave is that it is always either "on" (max value) or "off" (min value), so what the "less than" operator does is compare the value of the saw wave to the value of an incoming signal from the blue knob. When the value of the saw wave is lower than the value of the blue knob, then the "<~" box outputs "1" as its signal, and when the value of the saw wave is great than the value of the blue knob the "<~" box outputs "1" as its signal. Nothing but 1s and 0s gives you a pulse. The width of the resulting pulse will depend on the value sent from the knob, which you can adjust. You can hear that happening in the second part of the sound file.
I added a detuning knob as well. This sends out a value set by the user -- from 1 (no change) to 1.0595 (about one semitone) -- which is then multiplied against the original frequency in one oscillator and divided against it in the other oscillator, giving a spread on both sides of the chosen frequency. If you want to turn an oscillator off, you can simply set its blue "Pulse Shaper" knob to 0.
In this one you can load a sample into a little player by pressing the "read" box -- the "groove" box is what plays the sample. You can change the start and end points of the sample as it's looping, which is part of what I was doing in the file, and you can change the playback rate (and pitch) in the number box above the "sig~" box. The stuff on the right is a ring modulation setup, which is the effect playing through the first part of the file. You can change the modulation by turning the lower big gray knob. I'm going to try and getting around to making it so that you can load multiple files for playback and simply scroll through them on a menu or something.
I think I have an idea how I can let the user specify the BPM and the length of the loop, and also which bar of the loop to play -- for example you could switch back and forth between bars or individual beats and repeat them without necessarily playing them in order or playing the whole loop. That's my project for tonight. Maybe I can even figure out a way to let the user tell which ring mod setting to use on each bar. Might end up with a nice little loop-mangling machine if I can pull this off.
You can now specify how long you want the loop to be in beats -- so the decimal value ".5" would make the loop repeat every half beat, for example. You can set the values down quite small to get some really glitchy, Aphex Twin-esque metallic effects, and switch between the values as the loop is playing as well. You can also scroll through the gray number box on the middle left to change which chunk of the sound file is playing. I'll try to upload an example of some manipulation later, but here's the patch if anyone wants to play with it (press the "read" button to load a sample, and toggle the "X" box to turn looping on and off):