All the instruments in the Orchestra section are named rather than numbered. Some normally run continuously as part of the audio chain; others are invoked as needed to play notes or set parameters.
The notes are generated by ‘ManualS’ and ‘ManualG’—the “Swell” and “Great”, Upper and Lower, manuals respectively. They can be triggered by either score events or MIDI.
Drawbar settings can come from score events or MIDI. ‘DrawbarsS’ and ‘DrawbarsG‘ handle score events, and can also turn Vibrato for the corresponding manual Off or On. DrawbarsS also has parameters as switches for Percussion. These latter are passed on to the ‘Percussion’ instrument, which can also be invoked from the score directly, to do the actual setting. (ManualG doesn’t have percussion.) Settings via MIDI are handled by the respective manuals themselves.
Percussion for ManualS can also be adjusted as to amplitude and fast and slow decay times via the ‘PercussionParams’ instrument. Again this can be invoked by a score event, or through MIDI. The actual percussion envelope is generated by ‘percussion_envelope’, which is triggered by ManualS when needed.
The audio generated by the manuals then goes in sequence through the (always on) ‘Vibrato’, ‘Spring_Reverb’, ‘Overdrive’, ‘Leslie’, and ‘Output’ instruments, described individually below. The Output instrument is also used to monitor various MIDI controllers and change settings appropriately.
The ‘Rotor’ instrument controls Leslie speed. It can either be invoked by MIDI note events (on channel 3) to select predefined speeds for the high and low frequency horns, or by score event to set the two speeds directly. The horns—being mechanical—don’t adapt the new setting immediately, but ramp to it. The ramp times are currently fixed at 1 second for the high-frequency horn, and 2 for the lower.
Instrument ‘Control’ can be invoked via score event to set miscellaneous parameters. It is different from the others in that it only has an initialization phase; it has no k-time activity. So p3 doesn’t set duration, but is instead used to select the parameters to be set. See the README for the details.
The original source of waveforms in an actual Hammond is a set of spinning toothed tone wheels (91 in all) that induce (nearly) sinusoidal signals in adjacent magnetic pickups. These are all driven by gearing from a common 1200 rpm central shaft. Because of the limitations of gear-ratios, the frequencies they generate are neither exactly on the equal temperament scale nor exact harmonics (though they are close to both).
Rather than using Csound’s built-in midi-note-number to frequency conversion, this emulation has a table of the actual 91 frequencies resulting from those gear-ratios and the number of teeth on each wheel, in the hopes that this gets even closer to the “Hammond sound”.
In a Hammond, the 91 tonewheels rotate continuously, and contacts under each key (nine of them per key in most cases) pick off the requisite harmonics to be played. These nine signals go to the nine corresponding drawbars, where the amplitude of each harmonic can be controlled.
In the simulation, the situation is a bit different. Each key pressed invokes a new instance of the instrument, which has its own nine oscillators that are set to produce the harmonics required. The drawbar settings just control the amplitude of each oscillator. The original drawbar values (0..8) are converted to actual loudness value for this using 3dB steps. (According to some, this may not be totally accurate. An alternative—commented-out— ‘giDrawbar’ table corresponding to apparent actual measurements is included in the Orchestra for the experimentally-minded.) Each tonewheel also has its own amplitude scaling so that higher frequencies are not overpowering.
Because—rather than a single tonewheel for each frequency— there is a set of oscillators for each key, there can be more than one instance of a given harmonic being generated at the same time. If these just free-ran, their phase would depend on exactly when a key was pressed, and their outputs would interfere with each other, resulting in awkward changes in harmonic amplitude. To prevent this, the startup phase of an oscillator is calculated (from clock time and frequency) to ensure that multiple instances are always in phase.
Hammond “Percussion”—somewhat oddly named—is the transient addition of one of the harmonics of the fundamental (the 2nd or 3rd) to the signal. This transient can be “fast” or “slow” and—in the Hammond—“soft” or “normal”. It is also “single-triggered”—meaning that it is triggered by the first note struck, but will not be activated again until all keys have been released. A separate subinstrument is used to generate the percussion response, so that it can be independent of further keys once triggered.
I haven’t found any numeric values for decay-time and magnitude of the percussion, but a “fast” decay of about 0.2 sec looks plausible, as does 3.0 for “slow”. Magnitude is a fully adjustable score parameter, so you can pick something that sounds right, rather than just “soft/normal”. Default is 2.0; the MIDI range is scaled from 0.5 to 10.0. You can also set ‘Fast’ decay between 0.01 and 0.5 secs and ‘Slow’ between 1.0 and 10.0.
Because the various harmonics that create the final sound are selected by contacts under the keys, there is a noticeable click at onset. This is probably mainly because of the fact that the phase of the waveform from a tonewheel is independent of the moment the key is pressed, so sharp voltage changes can occur. Also, there are nine contacts for each key, and they will not all close at exactly the same instant, somewhat staggering those steps. The contact transient may be reasonably represented by using a very steep rise-time (‘giClickRise‘), but the possible effect of stagger is not modelled.
There is also a ‘giClickNoise’ parameter that will introduce a noise transient at note onset if desired. This is zero by default, as I don’t find it attractive. If it is used, there is also a ‘giClickBeta‘ parameter that applies a low-pass to the noise. Both the transient rise-time and any click noise desired can be adjusted by a score event.
Other artefacts of the Hammond’s electromechanics aren’t modelled at all. Actual hardware has magnetic and electrical crosstalk between the tones that apparently results in a ‘throatier’ sound, but I have no information or feeling as to its characteristics. The motor switch on an organ is often used to ‘bend’ the pitch; this probably wouldn’t be hard to emulate, but isn’t modelled.
Vibrato and Chorus on a Hammond are created by a scanner, rotating at 412 rpm (i.e. 6.87 Hz), that picks the signal off selected taps on an inductor-capacitor ‘delay line’, with a total delay of about 1.1 milliseconds. As it rotates in each cycle, the scanner first moves down the line and then back, thus alternately lowering and raising the tones in the signal slightly. For the lowest vibrato—‘V1’—it scans about 45% of the line, ‘V2’ goes about 66%, and ‘V3’ scans the whole line. The taps are arranged so that the sweep is fairly triangular, with a slight flat spot at low delay. The waveform used in the emulation is intended to recreate this sweep. Chorus is the same as Vibrato, except that the original signal is mixed back in (assumed to be 50/50, but it’s infinitely variable if a score event is used).
Because the line is built from inductors and capacitors, it also acts as a low pass filter, with the roll-off frequency decreasing on taps with greater delay. A variable low-pass filter is used to emulate this. The values of the inductors don’t seem to be available, so there is no good way of calculating this roll-off. Instead the score command for vibrato has three parameters—Filter Cutoff Frequency, Frequency ‘Wobble’ Factor, and filter “Q”—that can be adjusted for a good sound.
A fourth parameter in the score command controls “Buzz”. The scanner is a capacitative pickup passing over 16 stator vanes, and although transition between vanes is fairly smooth, there is some amplitude modulation at 109.92 Hz (6.87×16). Apparently this can be audible, so it is emulated here.
The Hammond has a Spring Reverb unit, which is emulated in this version. This is implemented by convolving an actual spring impulse response with the audio signal. It requires the supplied file ‘spring_reverb24.raw’, which is derived from a sample that Stefan Bilbao used in his research at CCRMA. The original WAV is ‘Unit2Spring3.wav’, available from CCRMA. Only a single spring is currently simulated, though the usual physical reverb tank may have two or three. More springs might be investigated in the future.
The reverb level setting just controls the mix of direct and reverb signal. Bear in mind that by the nature of a spring full reverb entails considerable latency in the resultant output, which will be disturbing in live playing.
The “Leslie” is the rotating speaker unit that gives much of the character to the “Hammond sound” (the “Rotor” of the “Rotor Organ”). It does mechanically and acoustically somewhat the same sort of thing as the Vibrato. [In fact my guess is—as Hammond himself hated the Leslie—that the Vibrato, which came later, was intended to displace it, but it never did. In the end they can be used together rather well.]
The true effect of the Leslie is very complex, as there is Doppler shifting of frequencies, plus varying direct and reflected sound transmission, as the speakers (or rather attached horns and scoops) rotate. This makes it very hard to emulate properly, and this scheme probably still doesn’t come close.
This version is rather Different from Hans’ original. The algorithm uses essentially the same swept delay line as the Mikelson one to produce the Doppler effect, and similarly splits the signal into “high”, “midrange”, and “low” frequencies for different ‘rotation’ effects (the higher frequencies are much more directional, and so their amplitude is much more affected by the rotation). However, it explicitly includes reflections (in a rather basic fashion).
The audio fed into the delay line is (for the high and mid frequencies) tapped off again in three ways, a ‘direct’ channel, a ‘left-directed’ one, and another ‘right-directed’. The low frequencies only have the ‘direct’ tap because the ear is not very sensitive to direction there. All the taps are swept back and forth along the delay line at the rotation rate of the appropriate speaker (the high range and bass speakers spin at slightly different rates, adding to the effect). However the rotation phases of the ‘left’ and ‘right’ ones are 90° displaced from the ‘direct’ and have the specified reflection delay added in. All these channels are modulated by the angle-amplitude function appropriate to the frequency band (as in Hans’ version) and mixed back to left/right stereo. The function tables for amplitude vs rotation angle, which I believe Hans derived from some published plots, are unchanged from his code.
The relative levels of direct and reflected high, mid, and low frequency response can be adjusted via score events. By default they are flat.
Preceding the Leslie is a section to emulate the “overdriving” distortion possible with the tube amplifier of the Leslie. This is purloined from Peter Billam’s Csound synth, which he in turn borrowed from a LADSPA plugin by Steve Harris. It replaces the original method built in to the Leslie code.
The Output instrument also has a reverb, intended to approximate room characteristics. Unlike the Spring reverb, it is stereo, using opcode ‘reverbsc’. The raw reverb level can be between 0 and ~0.95 or so. (>1.0 is unstable), but there’s little effect below 0.6, so the MIDI control has a transfer function that rises rapidly to 0.5 at MIDI value 20, and then linearly increases to 0.95 at MIDI 127.