Chapter 6 - Instrument editor



The instrument editor is where you adjust the synthesis and playback parameters of a given sample to create an instrument (similar to a Program in the terminology of samplers).

Bhajis Loops handles up to 64 instruments. Each instrument is identified by a name, a color, and references one of the samples loaded in memory. That is to say, two instruments can use the same sample, but have different synthesis parameters.


User interface

The Edit field lets you select which one of the 64 instruments you want to edit. A shortcut is to use the up / down hard keys.

The Name field is used to rename the selected instrument. A tap on the "..." at the right of the field displays a dialog box that provides a convenient way of quickly selecting common instrument/sample names.

The Color selector on the right allows you to select a color for this instrument. It popups the standard PalmOS© color selection dialog.

The Sample selector is used to select which sample is assigned to the current instrument. To open another sample, go back to the sample editor.

Tip! A tap on the Name caption gives to the instrument the same name as its sample.

Tip! A tap on the Sample caption opens the sample loader.

Note: when the Dynamic Input Area is collapsed, the waveform of the sample is also displayed.



The center of the screen shows different potentiometers corresponding to various synthesis parameters. You can modify them with the stylus, or with the left and right buttons of the 5-way navigator (in this case, the last control touched with the stylus is modified).

This control modifies the sample offset, that is to say the position at which the playing of the sample starts. When set to 0, the sample is played from its beginning ; when set to its maximal value, the sample is played just a few ms before its end.

For example, you can create different instruments playing the same drum loop but starting at different positions, instead of slicing it.

This controls fine-tunes the sample. It ranges from -100 to 100 cents (100 cents = 1 semitone).

These three controllers modify respectively the LFO rate, the frequency modulation depth (vibrato), and the filter cutoff modulation depth (growl).

This control modifies the filter cutoff frequency. Turn the knob clockwise for a brighter, sharper sound.


This control modifies the resonance of the filter. Turn the knob clockwise to enhance the harmonics in the neighbourhood of the cutoff frequency. A very high value can lead to auto-oscillation. Watch out!


These controls modify the slope (number of poles) of the low-pass and high-pass filters:

  • 0: no filter (and less CPU usage !)
  • 1: 6dB/octave filter
  • 2: 12 dB/octave filter
  • 3: 18 dB/octave filter
  • 4: 24 dB/octave filter

Since the Low-pass and High-pass stages are independent, you can use any combination of parameters, for example LP=4 & HP=0 for a typical low-pass filter ; LP=2 & HP=2 for a band-pass filter, LP=0 & HP=1 for a simple bass attenuation, etc.

This control modifies the modulation amount of the envelope on the filter cutoff.

These controls select the envelope attack time, decay time, sustain level and release time. Note that they have no effect if no modulation is applied to the filter cutoff and if the amplitude modulation is not enabled.

This control selects whether the envelope must affect or not the amplitude. When set to 0, the VCA is controlled by the GATE ; otherwise by the ENVelope generator. That's all for our analog moment.

Be careful, this is a binary switch, so you will need to drag the stylus by a few extra pixels to change the value! Also, some clicks might appear when it is set to zero.

This control modifies the volume of the instrument.

This control modifies the position of the instrument in the stereo field. In case you use a stereo sample, this control modifies the balance between its left and right channels.

Finally, the keyboard at the bottom of the screen has two functions:

Either it lets you select the relative pitch of the sample (the root note). For example, if you know that the sample is a Bb2 piano note, just select Bb2 on the keyboard, so that the sample will sound at its original pitch when you play Bb2. The relative pitch is represented by a red dot.

Or you can just use it to play the instrument... This should be used only to test the instrument - there is latency, and only one channel of synthesis available!

You can adjust the note octave by using the arrows on the left and right of the keyboard, or the left and right hard keys.

Bhajis Loops' sample player uses 4 times oversampling, linear interpolation, then 9 points FIR decimation to get back to the original sample rate (22.05 kHz or 44.1 kHz). Accordingly, the playback can be considered aliasing-free as long as you are not playing the sample 2 octaves higher/lower than its original pitch.

Envelopes are generated at SR/4. Thus, a slight distorsion can appear when using very fast envelopes.



Instrument menu

Default settings restores all the default setting for the current instrument. If your instrument sounds too weird, if resonance is out of control and if the purple tentacle feels like he could take over the world, this might be a useful command.

Open / Save opens / saves a separated instrument. Instruments are saved with their corresponding sample. The following dialog box is opened to select a location:

The popup list in the middle lets you select a location. It can be either an expansion card or the RAM. Saving in RAM can be much faster, but it might be tedious to organize your files. On the other hand, access time to some storage cards is slow, but they provide a convenient way to handle multiple directories. A tap on the Default Dir moves to the default directories used by Bhajis Loops. The default directory for instrument is /instruments.

Instruments are saved with the .bji extension on the card ; or with the bjif type / Loop creator in RAM. This must not be changed.


In the Advanced settings dialog, advanced synthesis parameters can be modified, such as the LFO waveform or the polarity of the filter modulation.


Voices / Polyphony lets you select advanced polyphony options, more precisely, how voices are created / removed when notes are played.

When Ignore Note Off is enabled, the instrument does not take into account the duration of notes. That is to say, even if the note ends, the voice will continue playing. This is useful for drum sounds, for example. Several voice modes are available :

Improper settings of these parameters may result in ghost voices. For example, if an instrument uses Ignore note Off and a looped sample without envelope, each new note will last for ever - or until the device cannot handle the polyphony!


Keyboard mapping allows you to restrict the instrument to a given note range, or to specify that an instrument is unpitched. This option is particularly useful when using layered instruments. When ignore pitch is checked, a C3 note will be played, no matter which note is actually triggered.


Layering allows different instruments to be layered and grouped together. More precisely, instruments are hierarchically grouped in a master/slave way. When a note is played on the master instrument, it will also be played by the slave instruments.

The list at the center of the dialog box displays the hierarchy. You can select an instrument in the list, and define its slave in the popup-list at the bottom of the screen. In this example, we can see that instr 2 is the slave of instr 1 ; instr 3 the slave of instr 2 ; instr 4 the slave of instr 3. It means that:
- Any note played by instr 3 will be also played by instr 4
- Any note played by instr 2 will be also played by instr 3, and thus by instr 4
- Any note played by instr 1 will be played by instr 2, 3 and 4

The special option inherit settings allows a slave to synchronize its volume and filter cutoff with its master. This is particularly useful when you are using automation on the master instrument.


Transpose opens the instrument transposition dialog:

The two lists allow you to select the instruments you want to transpose - the first list displaying all the instruments available ; the second one the instruments to transpose.

You need then to select a transposition method. You can either transpose all the note events of the selected instruments for all the patterns ; or just change the root note of the selected instruments. Finally, select the number of semitones you want to transpose the selected instruments by ; and tap on Transpose.


The edit menu

Copy copies the parameters of the edited instrument into the clipboard.

Paste replaces the parameters of the edited instrument by those contained in the clipboard.

Kill all notes deletes all the notes in the song played by the selected instrument.


Other menus

The other menu items are common to the other editors and will be detailed later.


Loop a small portion of any sample. Wow! You now have a complex oscillator ready for substractive synthesis! You will realize at this stage that you don't need very complex samples to create complex sounds. Just experiment with microloops and the instrument parameters...


All contents and code © Olivier Gillet 2003-2006 - ol dot gillet at gmail dot com

Index - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14