12 String Karplus-Strong MIDI Synth


This is a MIDI controlled synth that implements 12 Karplus-Strong strings. The code is written in assembly language.

This instrument's timbre is controlled by 4 pots (as well as 4 continuous controllers):
  • Reflection filter Fc value (which determines how quickly harmonics are rolled off).
  • Damping factor pot which causes the waveform to decay linearly across the spectrum.
  • Pluck pulse filter Fc value. This controls filtering of the pluck pulse. The harmonics of this pulse are important for the starting timbre of the instrument at pluck time. The plucks can be hard and sharp or they can be soft and thump-like.
  • Pluck pulse length. (this is also controlled by mod wheel CC).

  • Limited pitch bend is supported. Currently, the code supports:
    • 2 semitones up and 2 semitones down. (default)
    • 3 semitones up and 2 semitones down.
    • 7 semitones up and 7 semitones down.

The pots are all "shadowed" by equivalent continuous controllers. The controller and pot values are added so that the user can set a base value with one and modulate live with the other. If the base value is set to zero, then full range goes to the other control. Using an add operation also eliminates any possible glitch that might occur in other methods that "steal" control. Since the continuous controllers are all initialized to zero at power up, if there are no continuous controllers available, all of the range is available at the pots. Using continuous controllers also allows use of a sequencer to control timbre.

Pitch bend mode is currently selected (only one of two modes) by sensing that the sustain pedal was held down prior to power up. Currently, it switches between +2/-2 and +3/-2.

The synth with included MIDI controller and voice assigner is contained in one dsPIC33F IC.

Voice assignment consists of logic using a "gates" memory which is used to determine which voices are available. Part of the algorithm for deciding which voice is selected includes scanning the string models for any that are already set to the pitch of a newly received note on message. This feature provides two things:
1: A more realistic sound in that when the same pitch is played more than once on a real harp, the same string is reused. The synth does this whenever possible which results in fewer voices being stolen from another pitch. When a vibrating string is replucked, there is already wave information in the delay line. The pluck pulse modifies some of this data, so the new pluck can sound different just as it does with a real harp (or other struck or plucked string instrument).
2: Voice theft for new notes is limited and occurs when no matching pitch string can be found and when all voices are already in use. Unused voices are always used before sounding voices are stolen.
Voice theft is controlled by peak amplitude. When all voices are in use and a new note on message arrives, the voice with the least peak amplitude is stolen. Peak amplitude can often be zero especially for high notes and when the loop filter is set to a low cutoff frequency.

Musical Examples of the 12 String Karplus-Strong Instrument