This is a “Hammond Organ with Leslie Rotor” simulation for the Csound music synthesis system. [Csound is a venerable, open-source, cross-platform, extremely flexible, hard-to-learn, software synthesis scheme. Look for it on the web.]
The simulation is intended to be driven by two channels of MIDI note input (to emulate the two manuals (keyboards) of a real Hammond). Real-time control of Drawbar settings and Leslie Rotor speed can be either through MIDI or text-line input. The simulation has Hammond ‘Vibrato’, ‘Percussion’ and Reverb, controllable via text input. In fact, the emulation goes as far as to use exact tone wheel frequencies (all 91 of them), rather than a true equal-temperament scale. (The tone wheels are neither exact harmonics nor equal-temperament, which may contribute to the “Hammond sound”.)
Depending on your system, you may not be able to drive all the possible MIDI inputs —the author has a custom software ‘rig’ that splits a piano range into the two manuals, displays a ‘Drawbar Panel’ for mouse access, and selects command lines with mouse-clicks— but you can run the simulation with a single MIDI channel (ignoring the second manual), and control other parameters through the Csound Score file or run-time text lines (to stdin).
[In case you’re wondering, I’m afraid there is no built-in GUI for this app, as the widget libraries provided for some versions of Csound are not available on my system.]
These Csound files are an adaptation of Hans Mikelson’s “MIDI Rotor Organ”, though by now most of the original code has been considerably rewritten. The orchestra code has been reorganized for a little more flexibility, and for convenience in playing from live keyboard MIDI input. I’ve added the tone wheels and the Vibrato feature, improved the Percussion mechanism, written a new Leslie, put in Reverb, and included the second keyboard manual. (No ‘Pedalboard’, though!)
This release 7.1 has a more uniform perceived volume across the entire harmonic range. (Previous versions simply used constant amplitude over the range, which meant that higher notes were objectionably louder, and the bass tended to get lost.) It also has an added Instrument 11 to set parameters of Vibrato, Leslie, and Reverb. Apparently the current version of Csound5 (unlike Csound4) will not accept a command for an instrument that is already running, so a separate temporary instrument must handle the command instead. The default MIDI keyboard channels are now 1 and 2 (rather than 4 & 5) for greater convenience.
The ‘Key Click’ present in a real Hammond has also been revisited. The ‘white noise’ transient in the original code was not either realistic or pleasant to my ear, so I dropped it. The key click is actually mostly due to the arbitrary point in a cycle where a harmonic is picked up, causing a transient when the key is pressed. This effect has been duplicated in the latest code, and seems preferable to the complete absence of transient in earlier versions, so it is enabled by default.
The essential parts of the package are the usual Csound ‘Orchestra’ and
‘Score’ files: rotororgan.orc and rotororgan.sco. They are intended to
be used in a Csound configuration that receives both MIDI and text input
in real-time. The command line will probably be similar to:
csound -L stdin -M <midi-in> -b-1 -o devaudio rotororgan.orc rotororgan.sco
“-L stdin” here indicates that commands can arrive through standard input.
The <midi-in> parameter should be set to the device on your system
that handles midi input.
“devaudio” (or “dac”)
is Csound’s usual standard name for the audio
output device. The “-b-1” argument may be needed for ensuring
no delay in the buffered output; Linux seems to prefer it absent.
Running the emulation like this, with MIDI from your keyboard coming in on channel 1, will let you play the organ with the defaults set up by the score file. Switch your keyboard to channel 2, and you can try the other manual. If your system can handle live text input (Linux can, for example), you can try typing or pasting instructions into the shell window to change drawbar settings, vibrato, and so on. See the included ‘presets’ file for possibilities.
At a minimum, you can always edit the text of the score file to set all the parameters as you wish. With a more elaborate MIDI setup, you can have still greater control, as described in more detail below.
Two MIDI channels (by default 1 & 2, driving Csound instruments 4 & 5) correspond to the “Swell” (upper) and “Great” (lower) manuals. These accept Note-On/Off events in the standard 61-key range of a Hammond (two octaves below middle-C to three above), a “Swell Pedal” as Controller 11, and a contiguous bank of Controllers (by default 20-28) for Drawbar settings. MIDI channel 3 (default) will accept a small range of Note-On/Offs to vary Leslie speed; the default for these is the lowest 8 notes of an 88-key keyboard.
Instead of MIDI Controller input, you can set Drawbar positions with Score commands, either added to the Score file itself or sent in real-time to Csound’s stdin. Similarly, Leslie speed may be set by command rather than MIDI. Other Leslie characteristics, Vibrato/Chorus, and Reverb can only be altered via commands—Score or stdin. More details below.
Supplying three MIDI channels—and run-time text input—may not be possible on your system, but the simulation could at a minimum still be used with one MIDI channel, relying on the score file for other control settings. I actually use my own ‘midi preprocessor’ software to split 88-key input into the two manuals, and octave-shift them into something like the same range (not twin 61-keys, but good enough for a lot of things). Typically, I have from middle-C upward (four octaves) as Upper Manual, the bottom 8 keys of the 88 control the Leslie speed, and the intervening two and a half octaves or so are assigned to the Lower Manual. If you can feed your computer with two keyboards set to suitable channels, that would be even better.
(A quick word about my “rig” may make the decisions I made clearer. For a start, I run an older version (4.23) of Csound under the Be operating system. This has advantages to compensate for the lack of later facilities… (:-/) Everything runs in a unified configuration, with MIDI being preprocessed in a few respects before being passed to Csound’s input. Also, Csound’s stdin can be simultaneously fed command lines from a separate window; the window is loaded up with convenient commands at startup, but these can be edited or added to as desired. Hence I can make parameter changes quickly at any time while playing.)
The MIDI channels used by default are ‘1’ for the ‘Upper/Swell’ keyboard and ‘2’ for the ‘Lower/Great’, mapped to the internal Instrument numbers 4 & 5, but these can be changed by constants defined near the start of the Orchestra file. For example, the MIDI channel for the Swell manual is set by giChanSwell, so if you want to drive it from other than channel 1, change this appropriately. Similarly other defaults are defined there and can be changed if you wish. All the function tables are also specified there, so you can make modifications, or you can experiment by overriding them in the Score file.
There are also a couple of parameters to adjust the “Key-Click”. One sets the rise-time (‘attack’) of the notes, and is set by default to give a reasonable click (0.001 sec). Making it larger (up to 0.1 or so) will reduce the attack transient and give a ‘smoother’ note. The other parameter actually inserts a spike of white noise at the start of a note. Whether this corresponds to key noise in a real Hammond is not clear. By default it is zero, but if you want the effect you can increase it (probably keeping it less than 1). You can experiment with these values at run time via Instrument 11.
Please note carefully — and distinguish — the usage of MIDI channels and Instruments. MIDI channels 1 and 2 are (by default) the two keyboard manuals, but drive Instruments 4 and 5. Drawbar settings in the score or from stdin for those channels are, however, handled by corresponding Instruments 1 and 2. MIDI Drawbar changes should be sent to the same channel as note events, and will be mapped appropriately.
The instruments in the Orchestra file, “rotororgan.orc”, are, briefly (control sources in parentheses):
They are set up thusly:
Both percussion strength and decay time are controlled by that parameter. The amplitude is set by the (absolute) numeric value entered in the field; a value of 1 is probably way too low—try ‘3’..’8’ for ‘soft’ percussion, and something like ‘20’, even as high as ‘40’, for ‘strong’. The decay time is by default ‘short’, but can be changed to ‘long’ by making the value in the field negative. (I guessed at the ‘short’ and ‘long’ (exponential) decay times from the components in the circuit diagram, but they are global variables in the .orc file that you can change as you desire. You can also play un-Hammond-like games with the amplitude values if you like. Another point to note is that percussion is “Single Triggered” —i.e. it is generated only by the first key down, as in the real organ. If you don’t want this, it’s a simple change in the .orc file. Turning on percussion does not remove the 9th drawbar as it does in the real organ.)
Instruments 1 and 2 are controlled by Score commands or text to stdin. (Note that Csound will give a warning if you, say, just supply drawbar values, but it actually leaves previous values of the missing trailing parameters alone, so you can do this safely, provided they have been previously set at least once.)
If you have the MIDI capability to do so, you can also change Drawbar settings (only—not percussion etc) by sending Controller values directly to the relevant MIDI channel; see instruments 4 & 5 below.
Instrument 3 sets the rotations-per-sec of the Leslie rotors. It accepts events from either Score/stdin or MIDI channel 3. From score/stdin it takes a couple of parameters (range about 0 to maybe 10) that specify the true speed of each rotor:
From MIDI, it expects one of 8 keys that will be translated to actual speeds by a couple of tables in the orchestra file. By default these are the lowest keys of an 88-key source (this can be adjusted by a parameter in the Orchestra file). Note that score commands set the revs/sec directly; MIDI input sets them via tables (that can also be adjusted if you wish).
Because the speed ramps fairly slowly (as a real Leslie does), the key (or score event) must be held for a couple of seconds.
Instrument 4 is the actual Upper Manual, driven by MIDI on channel 1. It is currently set—unlike an actual organ—to accept key-velocity values, because I like to have that facility available sometimes. For normal use, the MIDI preprocessing I use simply removes velocity variations before passing events to Csound. The instrument also accepts ‘Expression” events (a.k.a “Swell Pedal”) from controller 11; the default table supplied in the Score file restricts the range to 10-100%, with a slightly ‘convex’ curve; whether this is anything close to a real Hammond I have no idea, but it’s convenient for playing. (As is standard in Csound, it also responds to controller 64 ‘sustain’, but you will probably want to avoid passing these in, both for realism and to avoid overloading with sounding notes.) If your setup permits it, you can set Drawbars individually by sending MIDI Controller values (restricted to the range 0..8) to the instrument; the source Controller should be one of a contiguous set of 9, representing the 9 drawbars; by default these begin at Controller 20.
Instrument 5 is the Lower Manual, driven by MIDI channel 2, and behaves just as Instrument 4, but with its own drawbar settings (from Instrument 2 or MIDI) and no percussion.
Instrument 6 is the Vibrato Unit, controlled by Score/stdin events. Parameters in Instrument 1 and 2 commands determine whether Vibrato is actually applied to the associated Manual, but Depth/Chorus settings are common and controlled by commands to this instrument.
Once started, by a non-zero p4, it remains running. In Csound4, new parameters or a ‘stop’ event can be sent at any time. This doesn’t work in Csound5 — use Instrument 11 if you want to alter things while it’s running. As in a real unit, the rate is fixed at 6.87 Hz (the shaft rotates at 412 RPM). The parameters (p4..p9) are as follows:
The remaining are “fiddle factors”, because theory only takes one so far! The values given seem reasonable, but feel free to experiment…
Instruments 8 and 9 are Leslie units, using different algorithms. Normally you will run one or the other, but you can run both together if you really want to. You can have neither running, but distortion is inserted in the Leslie, so you will lose that too. Note, though, that you can have a Leslie running but set the speed to zero —effectively turning the rotors off without affecting distortion. Like the Vibrato, they are started by a non-zero p4, and run until they are stopped by a command to ‘i11’ (or a zero p4 in Csound4). (They have no MIDI control, aside from the—common—instr-3 rotor speed above.)
Instrument 8 is a newer scheme that has a different approach from Hans’ original. It assumes there will be reflections from side walls, resulting from sound emitted by the rotating speakers at right angles to the direct signal. The intensity and time-lag of these can be controlled. The parameters are:
- p4: Mode: 0=off, 1=with (Horn) deflectors, 2=no deflectors.
- p5: Reflection amount: fraction of direct radiation (0.0..1.0)
- p6: Time-delay: of reflected sound in millisec—try 10..30
Instrument 9 is the original algorithm (with a redundant parameter removed, and deflector/non-deflector versions combined). Stereo is a result of a phase difference between left & right channels. Unfortunately this needs to be large—as if microphones were on opposite sides of the Leslie—to get any noticeable effect.
- p4: Mode: 0=off, 1=with (Horn) deflectors, 2=no deflectors.
- p5: Stereo Separation: phase difference (0.0..1.0) of horn rotation for left & right.
Instrument 10 should be started at time zero by the Score, and will remain running until exit. It manages the actual audio output for all the other instruments. It also will provide Reverb, with decay time (‘seconds’) controlled by parameter p4. Default in the Score file is 0.3 (about 1/3 sec), but it can be changed at any time by sending an event to ‘i11’ with p3=10 and an appropriate p4 (zero for no reverb). (Under Csound4 you can also send the change directly to ‘i10’.) Suitable reverb times will be a matter of taste, but a value of 2 or so can be quite impressive!
This instrument is needed — in Csound 5 — to change parameters of Vibrato, Leslie, and Reverb, once these instruments are running. (It is not needed in Csound 4, but can be used for consistency there too.) It can also be used to experiment with the ‘Key Click’ settings.
Its invocation is a bit unusual, in that p3 is used to select the instrument to be controlled — it is not ‘duration’… instrument 11 only runs to set parameters and then turns itself off. The remaining parameters, if any, are the same as would be sent directly to that instrument at startup. Only Vibrato and Reverb (or key-click) can currently be arbitrarily changed; the Leslies can only be turned off (no parameters needed), and can then be restarted with new settings.
As an example, to set Vibrato (instrument 6) to ‘C3’ (p4=0.5, p5=1.0, p6=10000, p7=1, and p8=1), use the command:
i 11 0 6 0.5 1.0 10000 1 1
The supplied Score file, “rotororgan.sco” simply provides initial Drawbar, Vibrato, and Percussion registrations, turns on the Leslie (the newer version, with deflectors), and ramps it up. It also starts instrument 10 to handle audio output and reverb. Further settings can be sent in real time to stdin as appropriate. If you don’t like the file defaults, remedy that with a text editor.
The score needs no tables, because everything is set up to defaults in the orchestra. It does contain commented-out versions of a couple of these, though, to demonstrate how you might change them. You can also send the text of new tables at run-time—to change distortion, for instance.
A third file of “presets” is provided. This contains an expanded set of drawbar etc. settings (some for the Lower Manual) , configured as Score ‘i’-format instructions , so they can be sent directly to Csound’s stdin; most are adapted from the examples contained in Hans’ original score file. It also has alternatives for Vibrato and Leslie etc. Csound command lines are freely intermixed with explanatory comments that should not be sent to Csound, but the actual command lines should be fairly obvious as they all begin with ‘i’ (or ‘f’). (In my setup this file gets loaded into a “command” window at startup.)
A further “other_presets” file contains a bunch of registrations gleaned from the Hammond Wiki, for your experimentation. (All directed to the Upper Manual, but intended for playing with.)