The Mixed Control Oscillator is inspired by Tom Wiltshire’s (aka Electric Druid) article on how the Roland Juno series DCO (Digitally Controlled Oscillator) work.
It’s called Mixed Control because it’s capable of both digital and analog control.
Digital control is done with an SPI interface (this is very common, you can find one on almost every microcontroller these days, including the Arduino, Propeller and LaunchPad).
Analog control uses the 1V/Octave scale, meaning that increasing the input modulation voltage by 1 volt will double the output frequency. It is limited to -2.5V to +2.5V of range so far (meaning 2.5 octaves below the base frequency, given by digital control, to 2.5 octaves above).
The central part of the MCO is the microcontroller (the Driver), that does the following:
- Read SPI messages to change the base frequency (among other commands)
- Read analog input to modulate this frequency
- Generate the clock and slope signals, needed by the Saw generator.
- Handle a few other features, like
- Hard Sync
The microcontroller is an ATtiny84 from Atmel, programmed with C/C++ code (which is going to be published soon).
It uses the internal 16 bit timer to generate the clock, and a 8bit timer to generate the slope (which requires less precision as it sets the Saw amplitude). These timers (and the whole microcontroller) are clocked using a 16MHz quartz.
Digital control handles the following control messages:
- Change coarse base frequency, as MIDI notes (semitones)
- Change fine base frequency, as MIDI notes + 1 to 99 cents detuning (semitones + cents)
- Set Global detune frequency (the frequency for A4 is default 440Hz, but it can be set to anything else).
- Portamento settings
- Mode: Constant time or constant speed (more about that in a dedicated post).
- Enable/Disable some features on the fly
- Hard sync
- Analog modulation
- Digital lowpass filter on modulation
Analog modulation uses the internal 10bit ADC (Analog to Digital Converter). The signal is centred on 2.5V, so that positive and negative modulations (around the base frequency) can be achieved.
Hard sync can be done using an interrupt pin. When the sync pulse occurs, the timer resets, and a new waveform cycle begins.
Next time: Analog input.