You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
teensymoog/README.MD

98 lines
7.3 KiB

# TeensyMoog
![teensymoog 1](https://github.com/troisiemetype/teensymoog/blob/master/misc/picures/1.jpg)![teensymoog 2](https://github.com/troisiemetype/teensymoog/blob/master/misc/picures/2.jpg)
## What is it ?
_Teensymoog_ is a synth, inspired by the legendary minimoog.
It aims at looking and functionning as close as possible of the orinal, but using digital tools, namely Teensy and Arduino boards.
It uses three boards, one Teensy 4.0 that handles the heavy computing (sound generation), and two Arduino Mega (chinese copies in a small form factor), that are used as "port expander", which read keys, switches and potentiometers and send their value on change to the Teensy.
## How it's made :
It's based on a Teensy 4.0 running the incredible audio library by _Paul Stoffregen_ of [PJRC.com](https://www.pjrc.com/teensy/td_libs_Audio.html).
The whole interface (`minimoog_teensy/audio_setup.h`) has been developped with the associate [visual online audio system design tool](https://www.pjrc.com/teensy/gui)
Two Arduino Mega pro are used to poll all the switches and potentiometer and sending any update to the teesny. The communication between the boards uses MIDI messages, mainly control change (or continuous control) messages. I've tried to stick as close as possible to the MIDI specification, and using the existing and available control numbers. There are cases where it's not the case (_e.g._ filter cutoff frequency uses a two bytes control change to increase resolution).
A Pimoroni's phatDAC is used to output high quality audio from the i2s stream generated by the audio library. A USB B port is mounted on the rear panel so the synth can be connected to anything, as a USB midi device or USB audio device (not available in Arduino IDE for Teensy 4.0 yet, but I know it will come !). There is also provision for (not implemented yet !) MIDI in and out (DIN-5 pins, but maybe 3.5 jack would be a better idea) sustain and expression.
A smartphone charger has been repurpose as the main adaptor.
The enclosure has been made out of would and acrylic.
The base plate is made of plywood. The mains parts are made of walnut, from a table I found in the street two years ago. For a long time I wanted to repair it, but I didn't like its feet, so this is a good opportunity to make room in there ! The wood has been treated with tung oil, wich gives a soft and smooth finish that I really love.
The main and lateral control panels, control panel bottom and rear enclosure are made of 2mm acrylic (PMMA). It has been cut and engrave with a CO2 laser cutter. The engravures are filled with white paint. SVG files for the panels are included in the repository.
There was no sketch made for the walnut enclosure, but I should have done some : it's quite thin (around 7cm tall), and it gave me headaches to integrate some components in it. There is plenty of room, but I had to change things several time to accomodate the keyboard height, the front panel with sontrols and the rear panel with plugs...
## Function implemented
As said above, the goal is to have something looking as close as possible to the original Minimoog.
The keyboard is smaller, 2 1/2 cotaves instead of 3 1/2 (or 30 keys instead of 44), not by choice, but because the _Bontempi_ electric organ it cames from.
### Global description
It has three oscillators, a mixer section with noise and feedback (post-filter output is re-fed to the mixer), a filter, two envelopes generator for filter and notes, a LFO, a pitchbend wheel and a modulation wheel.
### Oscillators
Oscillators have each six waveforms to choose from, six requency range (or octave transposition) and osc. 2 & 3 can be detuned by +- 1 octave regarding the base note. Osc.3 can be disconnected from the keyboard control, and used as a drone.
### Noise
There is one noise source, with pink and white noise.
### Feedback
The original minimoog has a external input mixer entry, so anything (guitar, another synth, etc) could be processed through the mixer. It was often used as a feedback path by plugin the headphone jack back into this input. The minimoog reissue has hard-wired this by connecting the output to this external input internally when nothing is connected to the jack.
Maybe external input will be implemented once, but I wanted this feedback.
### Mixer
the mixer is copy-paste on the original minimoog : a potentiometer for each of the five channels, and a switch for rapid on / off.
### Filter
The filter is (I believe) close from the minimoog one. Cutoff frequency and emphasis (resonance) are available. Their is an associated envelope generator that modulates the cutoff frequency. Their is also an addition compared to the minimoog : there is a knob to slide continuously from low pass to band pass, to high pass filter.
### Envelope generator
There are two envelope generators : one for the filter, the other for the global sound shape. On the original minimoog, decay can be used (_via_ a switch) to add release to notes. On this one a knob is there for, so this is a classic ADSR envelope.
### LFO
There is a LFO avialble, with continuous rate and waveform selection.
### Modulation
The modulation can be applied to oscillators and or filter, and is controlled by the modulation wheel. Four modulation sources can be used, and mix together. osc.3 or filter envelope can be mixed to noise or LFO.
### Glide (portamento)
Portamento can be from 0 to ten seconds, and switch on and off.
### Octave transpose
There is +- 2 octave transpose available to compensate the only 2 1/2 octave from the keyboard.
### Function settings
There are "hidden" settings available through a function switch. When turn on, the keyboard can be used to change the behavior of some things. Each of this setting is saved when powered off.
#### Keyboard priority mode
This defines the way the keyboard behave. There are four mode available :
1. lower note priority : a note will be played only if it's lower than the one already playing.
1. first note priority : a note will be played only if no note is already playing.
1. last note priority : a note will be played anyway.
1. upper note priority : a note will be played only if it's upper than the one already playing.
In any case, ten notes are tracked, so when several key are pressed releasing a key will play another, according to their position or the order they was pressed.
#### Note retrigger
This defines how a new note is played. If some keys are already pressed when a new note is played, it can retrigger the envelopes, or let them to their state. This can be turned on or off.
#### Keyboard detune
The original minimoog has a resistor ladder keyboard, wich implies small variations in tonality regarding a perfect pitch. This setting reproduce this by applying detune to each note and letting you choice :
1. off : perfect pitch for each key
1. soft : lightly detuned, +-10% of a semitone
1. medium : a bit more detuned, +-30%
1. hard : play drunk, two adjacent notes can almost same the same, +-50%
1. reset : this generate a new random detune table.
The detune table stores a fix detune coefficient for each of all 128 MIDI notes.
#### Bitcrush
Output resolution can be changed. The default is 16 bits, but any bitsize between 4 and 16 can be choose.
The bitcrushing is applied at the end of the audio stream, just before the i2s / USB output.
#### MIDI channel setting
The MIDI channel the synth listens and emit on when connected _via_ USB can be changed. Any channel from 1 to 16.