| Offset | Description |
| 00..03 | Sampler special word (e.g. "MSMP" for MIDI Sampler") |
| 03..1B | Sampler name, zero terminated (e.g. "MIDI/Sampler") |
| 1C..1F | Word to place into R10 on entry. |
| 20..22 | Maximum sample frequency (>100,000 is none) |
| 23 | Preserved flags, set to zero. |
| 24..27 | Branch to initialise, or MOV PC,R14 if none. |
| 28..2B | Branch to finish, or MOV PC,R14 if none. |
| 2C.. | Code to take a sample. |
Registers on entry to initialise, finish and sample to take:
R3 is pointer to IOC;
R4 is pointer to translation table (4096 bytes), or 0 for no translation;
R10 is word at offset &1C;
R14 is link register back to sampling code (return using MOV PC,R14)
R2 is return value.
R0,R1,R3,R4,R10 and R11 must be preserved on exit.
If R4 is 0 on entry, then R2 must be between 0 and 255 as unsigned byte. If R4 is non-zero on entry, then R4 points to a unsigned linear to logarithmic table of 4096 bytes long.
An example code (using AAsm), for the Vertical Twist MIDI/Sampler card:
GET %.Registers
ORG 0
econetdev
= MSMP ; Special word
= MIDI/Sampler (econet),0
ALIGN ; Name
DCD &33a0000 ; Pointer to A/D conv.
DCD 90000 ; 90KHz? tops
MOV pc,lr ; Has no initialisation
MOV pc,lr ; Nor any finalisation
LDRB r2,[r10] ; Read the byte
TEQ r4,#0 ; Is there a transtable?
LDRNEB r2,[r4,r2,LSL#4]
; Yep, so convert it
MOV pc,lr ; Return
END
There is no filetype for device drivers allocated. They are loaded either using the Sonor_LoadDevice SWI, or by using *Sonor_LoadDevice:
*Sonor_LoadDevice [-] <filename>
If the '-' is present, then Sonor will not load the device driver if it has already been installed. Otherwise, Sonor will remove the old device, and replace it with the new one.
You can modify the !Run of your Sonor to automatically install your device driver when you load Sonor. You should use the Drivers directory, and the line
Sonor_LoadDevice - <Obey$Dir>.Devices.<YourDevice>
is inserted after the SonorSound module is loaded. Only do this to a backup copy of Sonor.