Parser/Dispatcher for first implementation on Prototype Lineout

4 Microcontrollers first breadboards with PIC18F877, later 7 algo_pic controllers with PIC18F877A driving 88 keys, gets an realtime firmware written in PIC assembler and needs a parse logic to be driven by the host computer. Here the first layout is documented for historic reasons.

ASM Programm for each controller with ID nummer:

A) parser:

! Statusbit ->  "notendata  lesen"

Adresse vergleichen -> nein, ende


notenr & NOTENNRMASK

notenr <= 11 -> nein, ende  

notenr (0..11) * 2 als index fuer puls0,note0 ...

notennr (0,2,4,..,22) speichern. (DATAVALID = 1)

ende

"notendata  lesen": -> w

w = 0   -> note_off:

w+min_vel

w-> velo

velo -> pulsX

neubit=1

ende

note_off:

noteX = 000000000

notennr (0..22)

notenr * 2 (0,4,8,.. 44)
notenr -> w

Clearport2  ; haltemoment
addlw 2
ClearPort2  ; sicher auch spielmoment

ende


B) Dispatcher:

playnote   note puls  index


note ... addr noteX
puls ... addr pulsX
index ... 0,4,8,12,..,44 (relaisbasis)

index-> w


noteonbit ->  nein, "neue note"

puls--
puls == 0 -> nein, ende

noteonbit = 0
Clearport2  -> Attack buz

w-> relaisnr
relaisnr-2
relaisnr -> w

SetPort2 -> Haltebuz

-> ende

neue note:
neubit ? -> nein, ende

set noteonbit
clear neubit

SetPort2 (AttackBuz)

ende