·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_freq | Voice 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
description | A description of the instrument |
type | For MIDI percussion channels - see the instruments with type=percussion in the examples |
program_speed | Number of program cycles per second executed for the instrument's script. The default is 50. |
vol_left | Volume of instrument in left speaker - 0.0 to 1.0. |
vol_right | Volume of instrument in right speaker - 0.0 to 1.0. |
panning | 1=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:
nop | Do nothing. |
stop | This stops execution of the script. It doesn't stop the note playing - this is determined by the instrument's decay or MIDI note-off. |
wait | Pauses execution of the script for the specified number of cycles. |
goto | Jump to the given script line number. |
Prints a message to the console for debugging purposes. | |
v1_freq | Change the note frequency to an absolute value. |
v1_freq_pct | Change the note frequency by the given percentage. |
v1_freq_hs | Change the note frequency by the given number of half-steps |
v1_pulse | Pulse register value. |
v1_pulsemod | Value to be added to the pulse register on every cycle |
v1_control | Control register value. |
v1_gate | 0 or 1. Takes over gate control from MIDI. |
v1_ad | Attack/decay register value. |
v1_sr | Sustrain/release register value. |
v2_... | As for voice 1 above but for voice 2 |
v3_... | As for voice 1 above but for voice 3 |
filter_cutoff | Filter cutoff frequency. |
fr_vic | Filter resonance control/voice input control. |
filter_mode | Filter mode - shifted and place in high nybble of $d418. |