Find us here, too
  OMENIE
  • ABOUT
  • Church Organ for Mac
  • Pipe Organ
  • Player Organ
  • St Just in Roseland Organ
    • Quick Start
    • FAQ
    • St. Just Organ Videos
  • Pipe Organ tones without Samples
  • Streetlytron Series
  • Sopranotron 2
  • CARDonate
  • Contact
  • Privacy Policy
  • pipistrelle

The Omenie Synth Collection for
​Raspberry Pi Zero

A free, high performance, high quality music synthesis platform for musical learning, playing, performing, composing, experimenting and making. 

What is it?
The Omenie Synth Collection is a multi-instrument music synthesis platform for the $5 Raspberry Pi Zero computer. The SYnth Collection supports up to 8 simultaneous instruments on a single Raspberry Pi Zero, with 3 different synthesis models, and an effectively limitless tonal palette. In addition to the synthesizers a collection of delays, reverb and vibrato/chorus effects add further colour and atmosphere to your synthesized music.

How does it work?
At the heart of the Omenie Synth Collection is a 'synthesis server' that runs in the background on your Raspberry Pi Zero and synthesizes CD quality audio under the control of client programs that connect to the server. The client configures the synthesizers within the server, connects up and configures any effects, pushes MIDI commands into the server to command it to make music, and pulls the synthesized music out to be sent to the Raspberry Pi audio system. A number of example client programs are provided for you both as compiled programs and as complete C++ source code, to show you how easy writing a new client is, and to allow you to get coding and get making. All clients follow the same easy to follow pattern - attach to the server, connect a callback function to the Raspberry Pi audio system, and then push MIDI commands into the server to configure the system and create music. 

Example 1 - Plug in and Play
The simplest example of all is the playkeys client. Just plug in a USB MIDI keyboard, and fire up playkeys, and you are instantly making music. You can play a virtual piano, a drum kit, an organ, a fat, warm 'analog' monosynth, a cool 1980s-era polysynth, or even a classic 1960s Mellotron to emulate orchestral instruments. The system is powerful enough to support multiple MIDI keyboards plugged in* and performed simultaneously, yet is powered by the world's cheapest computer, and the source code of playkeys.cpp is less than 100 lines long. 


Example 2 - Compose and perform
The playsequence client is a giant project to get your teeth into, and again all C++ source code is provided. Like the playkeys client it still supports plug and play music making, but it also contains a multi-synth sequencer with its own 'sequence language', compiler and run-time. A hardware-accelerated waveform visualiser provides lightning-fast, low-overhead visuals to accompany your performances, which is very educational as you can see as well as hear the sounds you are creating. The waveform display also includes a 'visual metronome' for count-ins and synchronisation. Additionally, playsequence supports MIDI filters, which can transform the commands from your keyboard in arbitrary ways before passing the command into the synth server. Last but not least, it contains code that allows you to capture the synthesized audio as a wav file. So you upload your performances and compositions to SoundCloud, or even create your own sample sets for SRsynth by capturing rich sounds generated by multiple VAsynths and WTsynths. All this is provided as C++ source code for you to learn from, reuse in your own projects, or just criticise if you are feeling snarky.


Example 3 - 'makesamples'
This tiny example allows you to customize the Synth Collection by creating entirely new instruments using SRsynth. The makesamples client records the output audio into a form that can be used directly by SRsynth as a set of samples. Since SRsynth uses less CPU when it synthesizes comapred to the other instruments, this can be a big performance win. Also, VAsynth is monophonic, and by sampling a VAsynth setting you can create your own custom polysynth. Capturing the output audio to create new sampled instruments samples opens up the opportunity to create sounds that are bigger, richer and more complex - you can blend existing SRsynth sounds with VAsynth and WTsynth sounds to create absolutely massive, novel instruments. Get creating! 

Example 4 - 'recordsamples'
The recordsamples client records from an attached microphone, formats the recording, and lets the resuling wav file be used directly by SRsynth as a set of samples. Whip out your recorder, saxophone or pet cat and get sampling! 

Example 5 - Experiment and Make
OK, there is no example 5. We ran out of time and energy. But do not let that stop you - we want there to be an example 4. So take the supplied examples and expand and twist them, use them to create something amazing of your own. Write a bridging module to create your own Python bindings for the synthesis server. Somebody will want this, and I am definitely not going to write it, I know nothing about Python. So go for it. Write something that will create generative music. You know you want to. Build a better sequencer than mine, with a proper graphical user interface rather than the sequencing language - everyone will love you for that one. Make your own set of samples for SRsynth out of physical instruments. If you can sing, why not sing a scale, record it and turn yourself into a Mellotron choir. Or get really exciting and build your own hardware interface, and use it to generate MIDI commands that for the server. Why not make a flute or a recorder or a guitar or a harp or a drum kit or a trombone or a set of steel drums or a violin or an oboe or a lap steel or a harmonica or or or ... just make something. Then use it to make a noise. 


Or if you are like me, and are a bit 20th century and old-fashioned, just get together with your friends and make beautiful music. 


The world is your musical oyster. Go play. 

​Synth Collection Details

VAsynth features

The Virtual Analog synthesizer provides a monosynth with 2.5 oscillators, a switchable filter and a rich, powerful modulation system. 

Oscillators
​

2 full-feature oscillators OSCA and OSCB plus sub oscillator OSCC.

OSCA and OSCB support individual feet settings, from 32’ to 4’ - 8’ sounds the MIDI note as played

Fine Pitch, Coarse Pitch, Level, Phase Distortion Amount, Wave Shape are driven by the Modulation Matrix

Wave Shape - two end points are specified, and the Modulation Matrix output drives between these end points - e.g. sin/sin, sin/saw, saw/square and some hybrid shapes e.g sinsquare (first half of the waveform is a sin, second half is square).

Phase Distortion is effectively PWM of arbitrary wave shapes. The Modulation Matrix output pulls the π / 0.5 point of the wave closer to zero, compressing the early half of the wave and stretching the late half, leaving the period and fundamental intact and introducing harmonics. Maximum Phase Distortion represents an 8x squashing of the first half of the wave. 

Antialiasing of oscillators is achieved by backing off the generated wave towards a pure sine shape if generated frequencies will get too close to the Nyquist limit. Wave shape is backed off towards sine, and Phase Distortion is backed off towards zero. The net result is a seamless change towards a smoother sound, with aliasing largely inaudible. Some alias energy will break through, but the overall effect is to massively reduce aliasing artifacts with virtually zero run-time expense within the oscillator section. 

OSCB may be selectively hard-synced to OSCA

A ring modulator, driven by the Modulation Matrix, smoothly blends between (OSCA+ OSCB) and (OSCA x OSCB) as the value of the modulator is increased. 

OSCC may be switchable between a sinusoidal oscillator (which is always pitched at 32’ and frequency-locked to OSCA) or a white noise generator. 

Filter

The filter is in fact a pair of filters. One of the filters may be enabled at any time, or both may be left disabled. 

Filter 1 - a Moog-like 4-pole low-pass filter with resonance, tuned to be playable by the keyboard

Filter 2 - a Minibrute-like / ‘Hal Chamberlin’ 2-pole, state-variable filter with resonance, supporting low-pass, high-pass, bandpass, notch and peaking behaviours, tuned to be playable by the keyboard

If the filter is switched out altogether, this improves performance of the monosynth allowing a larger number of active copies.

Envelope Generators

The EGs take 6 parameters rather than the usual 4. These are 

A - attack time (0.1ms to ‘infinity’, which is around 120 seconds)
D - decay time
S - sustain level
λ - sustain half-life (implements decay during sustain phase - great for pianos)
R - release time
V - velocity sensitivity - controls the level at which the attack phase stops rising and begins decay

EG0 always drives the overall level of the monosynth, and all 4 EGs  are available to the Modulation Matrix

Low Frequency Oscillators

The LFOs may be sine, saw, triangle, square or sample/hold

LFO amplitudes are under modulation matrix control.

LFO frequency ranges from 60Hz down to 0.05Hz

Modulation Matrix

Up to 8 MIDI CCs may be used by a single monosynth as inputs to the Modulation Matrix. This maps onto the typical affordable controller keyboard with 8 rotary or slider controls.

The Modulation Matrix takes inputs from the current key being pressed (for velocity), the current frequency being synthesized (tapped from OSCA and used for filter cutoff), 4 EGs and 4 LFOs, and drives 24 modulation outputs. 

Driven outputs are :

OSCA and B - OSC LEVEL, FINE PITCH, COARSE PITCH, PHASE DISTORTION, WAVE SHAPE
OSCC - OSC LEVEL
FILTER - CUTOFF, RESONANCE
RING MODULATION - AMOUNT
LFO0 to 3 - level - this allows e.g. LFO3 to be amplitude modulated by LFO0

Each modulation output has a number of input parameters that are programmable. These are 

EG selector : in range 0 to 3
LFO selector : in range 0 to 3
EG amount : in range 0.0 to +1.0
LFO amount : in range 0.0 to +1.0
MOD amount : in range 0.0 to +1.0 - passes Mod Wheel through to this Modulator
CC selector - in range 0 to 7 - selects which of the available synth knobs drives this modulator
CONST - in range -1.0 to 1.0 - selects which of the available synth knobs drives this modulator

The output of the Modulation Matrix is given by 

(EG[EGsel] * EGamount) + CC + CONST + LFO[LFOsel]

Modulation is very rich and very powerful, possibly too rich and complex given the limited nature of the target platforms, and a simplified modulation system  is under consideration. 

Modal settings of monosynth

Various modal settings that control the system are :

OSCA and OSCB - feet, wave shape end points, enable/disable
OSCB - hard Sync enable
OSCC - noise or sub-bass, enable/disable
LFO0 - LFO3 - shape, freq
EG0 - EG3 - ADSλRV
Filter Mode - disable / 4-pole LP / LP / BP / HP / NOTCH / PEAK
Filter settings - Key Follow - 0%, 33%, 66%, 100%

Pitch bend range - always +2 semitones, switchable -2 or -12 for either symmetrical or ‘divebomb’ pitch bend behaviour

SRsynth features

​The samples used by the system are of arbitrary sample rate (typically sampled at 36kHz as a good quality/storage compromise), are 16-bit samples, and may be mono or stereo. The samples may be selectively ‘garbled’ on the filing system to aid asset copy protection. For very limited memory footprint systems an 8-bit sample representation is supported, whereby a 16-bit sample from the filing system is logarithmically compressed to an 8 bit value, and is decompressed as the sound is performed. This adds a small amount or run-time cost (a single lookup table) but the memory footprint of sample replay instruments is halved, a big win on extremely constrained systems, and the audio quality of companded samples is suprisingly good. 

Voices and Presets

Between 1 and 32 samples (‘notes’) per voice

Pitched voices are always sampled at minor third intervals, unpitched voices are ‘chromatic’ (i.e. a different sample plays on each key)

A voice is loaded from a .wav file or a .wag file, which is a .wav header with a proprietary garble of the payload for content protection

Note stretching is supported on pitched voices. An octave below the lowest pitched sample and above the highest pitched sample are reconstructed by squashing or stretching the top and bottom note respectively during playback

A pitched voice may be selectively looped as the samples are read into the engine. Looping is performed once, as the voice is loaded into memory. A window of the sampled note is looped with cross-fades over transitional regions to eliminate clicks and pops. This auto-looping has proven very effective in Omenie’s Mellotrons, and in the Sample Replay synth allows for very short samples. In many cases samples of under 2 seconds are looped very effectively into organs, strings and brass instruments.

A ‘preset’ - which is what is switched in and out as the user changes the Program Change MIDI controller -  consists of a single unpitched voice (e.g. drum kit or sound effects), or 1 or 2 layers of voice for pitched voices.

The current implementation assumes a reasonable amount of memory on the target platform - say 128MBytes - and pre-loads all available voices for instantaneous preset change. For extremely memory-constrained systems a 'load on demand' system will be needed, which will result in a sample replay instrument temporarily being muted as a program change forces sample memory to be reloaded from the filing system.

Envelope Control

Very limited envelope control is provided. Sampled sounds are assumed to require preservation of the recorded attack and decay phases. Two parameters -‘sustain half-life’ and ‘release half life’ - may be specified for each layer of a preset, and these control the rate at which the level of that layer droops when the note is held and after the release of a note. 

Note that ‘sustain half life’ allows a piano voice to use very short, looped samples, and still deliver a very realistic exponential drop in volume over a held note.

During the ‘release’ phase an unlooped layer plays to completion, a looped layer continues to loop until the signal level is less than an inaudible fraction of the peak level.

Playback

If a pitched voice has 2 layers, layer B may be detuned relative to layer A in a range +-5 cents to +-1 octave

Playback is by linear interpolation, which is extremely fast and good quality.

A preset may contain a looped and an unlooped voice layer. In this case behaviour is as expected, so that ‘piano plus strings’ may be built as a preset, sustaining the strings forever via looping while the piano decays.

There is no antialiasing of high frequencies (squashed notes) during sample playback, so although notes beyond the sampled range are playable there may be noticeable alias energy. Objectionable aliasing can be compensated by using more samples at the top of an instrument’s range. This is a deliberate choice to make playback as fast and efficient as possible for this synth, and results are outstanding.

MIDI controllers

There are no LFOs and no modulation in the sample replay synth, so this synth responds only to Pitch Wheel and Mod Wheel. 

Pitch operates as expected, with a bend range of +2 semitones always, switchable -2 or -12 for whole octave ‘divebomb' bends.  

The level of Layer B may be changed via the Mod Wheel. Two settings are provided - ‘Cross’ will cross-fade from A to B, giving pure B at full Mod Wheel. ‘Ramp’ will bring up the level of Layer B, and decrease Layer A somewhat, so that at full Mod Wheel the synth is outputting (A+B)*0.75. This allows a sense of crescendo without a brutal doubling of level under Mod Wheel control. 

WTsynth features

Wavetables

A wavetable is 1024 x 16-bit mono samples, supporting a fundamental of 43Hz without interpolation. Thus basses are very clean and precise, without crunchy / lumpy interpolation artifacts. 
​
Wavetables are internally expanded into wavetable-per-octave over 8 octaves for antialiasing, giving a fundamental range of 43Hz to 11kHz

Wavetable octaves are generated internally by FFT / filter / iFFT of the root (fundamental) wavetable, with an option to invert the relative phase of certain harmonics. This is important as otherwise certain wavetable trajectory traversals could result in harmonic cancellation due to phase inversions between adjacent tables in the trajectory. 

Layers
​

A copy of WTsynth uses either a single layer or 2 layers of trajectories, referred to as Layer A and Layer B. Hence in a single preset, 2 different wavetables may be sounding at any time. In fact as a result of the octave antialiasing and trajectory traversal, a played note is typically a seamless blend of 8 different wavetable octave representations. 

Layer B may be detuned relative to layer A, in a range +-5 cents to +-1 octave. The detuning is via a CC.

The level of each layer is driven by a full ADSλRV Envelope Generator

Wavetable palette

​The entire system of up to 8 concurrent wavetable synths may select from a palette of 128 wavetables - i.e. the system, once running, has a total palette of 128 wavetable to select from. 

Programming of WTsynth is currently achieved via a text file that is read at start-up time, but this could easily be mapped onto MIDI CCs allowing the sequencer engine or a user with a MIDI controller to directly program a preset. 

Wavetable trajectories

A set of up to 8 wavetables form a ‘wavetable trajectory’, the path taken through a set of wavetables over the lifetime of the note by a given layer.

A trajectory is traversed at a ‘constant’ rate (true constant, early biased, late biased), but this rate may be modified by an LFO to provide additional movement over extended note durations

LFOs

Each synth contains 2 LFOs - LFO0 and LFO1

Each may be set up as sine, square, triangle or saw, with frequency ranging from 0.05Hz to 60Hz

LFO0 is ‘always on’ and may be used to drive pitch and trajectory modulation, with user-programmable sensitivity.

LFO1 is dedicated to the Mod Wheel, and (LFO1 * Mod Wheel) is used to modulate the pitch of Layer A and/or Layer B. The sensitivity of layer pitch to Mod Wheel input is user-programmable. 


                                                                                        
Picture