E-mail
Mike Dawson

·reMID home page· Instrument config ·

reMID instrument.conf parameters

See the instruments.conf file for example instruments and to add your own.

Register initialisation

The SID registers starting from $d400 provide control over the SID's audio output. There's a nice summary of the registers here.

Generally each register or register pair is mapped to one configuration option and these parameters are loaded into the chip when a MIDI note-on is received. This table lists the options.

As polyphony is achieved through using multiple chips, each instrument may use all three SID voices.

Voice 1 parameters:

v1_control$d404 Voice 1 control register. The gate bit is ignored as this is normally controlled by MIDI note-on/note-off. You can modify the gate bit from the instrument script though.
v1_ad$d405 Voice 1 attack/decay
v1_sr$d406 Voice 1 sustain/release
v1_pulse$d402-$d403 Voice 1 pulse width
v1_freqVoice 1 frequency - you can usually ignore this parameter as the frequency is determined by the MIDI note played, but you may want to override it, eg. for percussion instruments. This is actual frequency, not the converted value that you would write to the register.

Voice 2 parameters: as above but prefixed with v2_

Voice 3 parameters: as above but prefixed with v3_

Other SID register parameters:

filter_cutoff$d415, $d416 Filter cutoff frequency
fr_vic$d417 Filter resonance control/voice input control
filter_mode$d418 Filter mode - the value here is shifted up and placed in the high nybble of the register at $d418 - it doesn't affect the volume in the low nybble of $d418 as this is determined by the MIDI note velocity.

Other parameters

descriptionA description of the instrument
typeFor MIDI percussion channels - see the instruments with type=percussion in the examples
program_speedNumber of program cycles per second executed for the instrument's script. The default is 50.
vol_leftVolume of instrument in left speaker - 0.0 to 1.0.
vol_rightVolume of instrument in right speaker - 0.0 to 1.0.
panning1=panning enabled - low notes are louder in the left speaker, high notes in the right

Instrument script parameters

Scripts are executed at 50 instructions per second unless otherwise specified with the program_speed option. The script program counter starts at 0 and increments by 1 each cycle unless the wait, stop or goto commands are encountered. Commands are prefixed by '.' and their cycle number. Multiple commands may run during a cycle by separating each command by a comma. For example:

.0=wait 10
.1=v1_pulse 0x800, v2_pulse 0x800
.2=stop

This waits one fifth of a second before altering the pulse width in voices 1 and 2, then stops script execution.

Commands available are:

nopDo nothing.
stopThis stops execution of the script. It doesn't stop the note playing - this is determined by the instrument's decay or MIDI note-off.
waitPauses execution of the script for the specified number of cycles.
gotoJump to the given script line number.
printPrints a message to the console for debugging purposes.
v1_freqChange the note frequency to an absolute value.
v1_freq_pctChange the note frequency by the given percentage.
v1_freq_hsChange the note frequency by the given number of half-steps
v1_pulsePulse register value.
v1_pulsemodValue to be added to the pulse register on every cycle
v1_controlControl register value.
v1_gate0 or 1. Takes over gate control from MIDI.
v1_adAttack/decay register value.
v1_srSustrain/release register value.
v2_...As for voice 1 above but for voice 2
v3_...As for voice 1 above but for voice 3
filter_cutoffFilter cutoff frequency.
fr_vicFilter resonance control/voice input control.
filter_modeFilter mode - shifted and place in high nybble of $d418.