
; ***********************************************************
; *                                                         *
; *           W I Z A R D   O F   S O U N D   V 3.2         *
; *                                                         *
; *               W O S P L A Y E R  V 1.53                 *
; *                                                         *
; ***********************************************************
; *                                                         *
; *     Assembler-Source-Listing / Assembler: Profimat      *
; *                                                         *
; *                   (C)Februar 1990 by                    *
; *                                                         *
; *                   Dan Dark  Software                    *
; *                     Jörg Schließer                      *
; *                   Hasenbergsteige 15                    *
; *                    7000 Stuttgart 1                     *
; *                      West-Germany                       *
; *                                                         *
; ***********************************************************

; *** Amiga-Betriebsystemroutinen-Offsets ***

Disable = -120                 ;exec-library
Enable = -126
Forbid = -132
AddIntServer = -168
RemIntServer = -174
AllocMem = -198
FreeMem = -210
FindTask = -294
Wait = -318
Signal = -324
AllocSignal = -330
FreeSignal = -336
GetMsg = -372
ReplyMsg = -378
WaitPort = -384
OldOpenLibrary = -408
CloseLibrary = -414
Open = -30                     ;dos-library
Close = -36
Read = -42
Write = -48
DeleteFile = -72
Lock = -84
UnLock = -90
Examine = -102
CurrentDir = -126
Exit = -144

; *** Konstanten für CustomChip-Register ***

tasten = $bfec01       ; Register enthält Sondertastencode
dmacon = $dff096       ; Register für DMA ( direct memory access )
aud0lch = $dff0a0
aud1lch = $dff0b0      ; Soundregister, enthällt Zeiger ( für Paula )
aud2lch = $dff0c0      ; auf die zu spielenden Samples
aud3lch = $dff0d0
aud0len = $dff0a4
aud1len = $dff0b4      ; Soundregister, enthällt Länge ( für Paula )
aud2len = $dff0c4      ; des zu spielenden Samples
aud3len = $dff0d4
aud0vol = $dff0a8
aud1vol = $dff0b8      ; Soundregister, enthällt Lautstärke
aud2vol = $dff0c8      ; der Stimmen
aud3vol = $dff0d8
aud0per = $dff0a6
aud1per = $dff0b6      ; Soundregister, enthällt Sampleperiod
aud2per = $dff0c6      ; 'guasi Tonhöhe' für Paula
aud3per = $dff0d6

; *** Basisadressen ***

exbase = 4             ; Exec Basisadresse
song1base = 0
song2base = 2000       ; Basisadressen der Stimmen
song3base = 4000       ; in den Musikstücken
song4base = 6000

; *** Variblen/Konstanten Speicherstellen ***

; => am Ende des Listings


; *** Vorbereitungen/Filenamen ermitteln/Daten laden ***

start:
       move.l  sp,startsp              ;Startzeiger retten
       move.l  a0,zwi1                 ;Zeiger auf Text bei CLI-Start
       move.l  d0,zwi2                 ;Länge des Texts bei CLI-Start
       move.l  exbase,a6
       suba.l  a1,a1
       jsr     FindTask(a6)            ;Addresse des WOSPlayer_Tasks
       move.l  d0,thistask
       lea     dosname,a1
       jsr     OldOpenLibrary(a6)      ;Dos_Library öffnen
       move.l  d0,dosbase
       move.l  thistask,a4
       tst.l   $ac(a4)                 ;Start vom CLI aus ?
       bne     clistart                ;JA ! also Sprung
       clr.b   cliflag                 ;Nein: Kennflag auf WB_Start
       lea     $5c(a4),a0
       jsr     Waitport(a6)            ;StartMessage abwarten
       lea     $5c(a4),a0
       jsr     GetMsg(a6)              ;Message holen
       move.l  d0,startmsg
       beq     ende1                   ;keine Message => Error !
       move.l  d0,a0                   ;Message_Zeiger nach a0
       move.l  $24(a0),a0              ;Noch ein Icon angeklickt ?
       beq     ende1                   ;Nein ! also nix zu spielen !

       move.l  12(a0),filepoint        ;Zeiger auf Filenamen
       beq     ende1                   ;... kein Filename
       move.l  filepoint,a1            ;und ersten Buchstaben testen
       tst.b   (a1)
       beq     ende1                   ;... kein Filename

       move.l  8(a0),d1                ;und auf Directory
       move.l  dosbase,a6
       jsr     CurrentDir(a6)          ;Directory wird aktuelles
       bra     dofile                  ;und los geht`s
clistart:
       move.l  exbase,a6
       lea     testtask,a1
       jsr     FindTask(a6)            ;Testen auf Tastkname
       tst.l   d0
       bne     norunmode               ;(nur von Bedeutung beim Einbinden
       move.l  dosbase,a6
       move.l  #taskfile,d1            ;von Songs in andere Programme )
       move.l  #1006,d2
       jsr     Open(a6)                ;Genaueres siehe Source_Listings
       move.l  d0,tfilehandle
       beq     norunmode               ;zu 'Startsound' und 'Stopsound'
       exg     d0,d1
       move.l  #thistask,d2            ;ADR-File in Ram-Disk
       move.l  #4,d3
       jsr     Write(a6)               ;erzeugen
       move.l  tfilehandle,d1
       jsr     Close(a6)
norunmode:
       move.b  #255,cliflag            ;Kennflag auf CLI setzten
       move.l  zwi1,a0                 ;Zeiger auf Text holen
       move.l  zwi2,d0                 ;Länge des Texts holen
       subq.l  #1,d0                   ;kein Text  ?
       beq     endeprog                ;also Error !
lforname:
       cmpi.b  #$20,(a0)+              ;auf 'Space' prüfen für
       bne     foundname               ;Textanfang des Liedtitels
       dbra    d0,lforname
       bra     endeprog                ;kein Space => kein Liedtitel
foundname:
       suba.l  #1,a0                   ;gefunden
       lea     filename,a1             ;Addresse von Filenamespeicher
copyname:
       move.b  (a0)+,d1                ;Text als Filenamen inter-
       cmpi.b  #10,d1
       beq     eofname                 ;pretieren und in den
       move.b  d1,(a1)+
       bra     copyname                ;Filenamenspeicher retten
eofname:
       clr.b   (a1)                    ;null_Byte am Ende des Namen
       lea     filename,a1
       move.l  a1,filepoint            ;Zeiger auf Filenamen

dofile:
       move.l  exbase,a6
       move.l  #11000,d0
       move.l  #$10003,d1              ;Speicher für Lieddaten
       jsr     AllocMem(a6)
       move.l  d0,membase              ;reservieren
       beq     ende1
       move.l  dosbase,a6
       move.l  filepoint,d1            ;Lieddatenfile öffnen
       move.l  #1005,d2
       jsr     Open(a6)
       move.l  d0,filehandle
       beq     ende
       move.l  d0,d1
       move.l  membase,d2
       move.l  #9000,d3                ;Lieddatenfile lesen
       jsr     Read(a6)
       move.l  filehandle,d1
       jsr     Close(a6)               ;und File schließen
       clr.b   versionflag
       move.l  membase,a3
       adda.l  #8996,a3                ;Prüfen ob Song-Version
       move.l  (a3),d1
       cmp.l   #"WOS2",d1              ;größer als V1.0
       beq     lookforinsts
       move.b  #1,versionflag          ;Version =< 1.0

; *** Lieddaten durchsuchen, welche Instrumente benutzt werden ***

lookforinsts:
       moveq   #0,d4                   ;Zeiger für Instr.-Kennung
       moveq   #0,d5
       moveq   #15,d6                  ;16 mal durchsuchen
       lea     long1mem,a5             ;longxmem_Zeiger als Flag für
       lea     instwerttab,a4          ;benutzt oder unbenutzt
testloop:
       move.b  0(a4,d4),d5             ;Instrumentenkennwert lesen
       moveq   #0,d7                   ;Flag auf unbenutzt setzen
       move.l  membase,a1              ;Leiddaten von Hinten her
       move.l  #7999,d1                ;durchsuchen
suchinst:
       cmp.b   0(a1,d1),d5             ;Suchen nach Instrument
       beq     instfound               ;... gefunden
       dbra    d1,suchinst
       bra     noinstfound             ;Instrument nicht gefunden
instfound:
       move.l  #255,d7                 ;Instrument gefunden > merken
noinstfound:
       move.l  d7,(a5)                 ;Merkflag in longxmem Zeiger
       adda.l  #4,a5                   ;longxmem Zeiger erhöhen
       addq.b  #1,d4                   ;Zeiger in Instwerttabelle erhöhen
       dbra    d6,testloop             ;nächstes Instrument suchen

; *** Instrument_Directory im Aktuellen Directory suchen ***

       move.l  dosbase,a6
       tst.b   cliflag                 ;bei Start von CLI kein
       bne     noclidir1               ;actual_dir ermitteln
       move.l  startmsg,a0
       move.l  $24(a0),a0              ;bei Start von WB
       move.l  (a0),d1                 ;Start_Dir zum
       jsr     CurrentDir(a6)          ;actual_dir machen
noclidir1:
       move.l  #instdir,d1             ;Instdir-Lock ermitteln
       move.l  #-2,d2
       jsr     Lock(a6)
       move.l  d0,instlock
       beq     endeprog                ;kein Instdir => Error
       move.l  d0,d1
       jsr     CurrentDir(a6)          ;Instdir wird actual_dir
       move.l  d0,oldlock

; *** Abspielgeschwindigkeit lesen ***

       move.l  membase,a1
       adda.l  #8992,a1
       move.b  (a1)+,speedwert

; *** Benötigte Instrumente laden ***

       tst.b   versionflag             ;Überprüfen, ob Song von alter
       bne     oldwosfile              ;W.O.S.-Version

; Song von neuer Programm-Version
       move.l  membase,zwischen1
       addi.l  #8100,zwischen1         ;Basisadresse für Inst-Namen
       move.l  #0,zwischen2
       moveq   #15,d6                  ;16 mal laden
newfileinstl:
       move.l  zwischen1,a5            ;Zeiger auf Namen und
       move.l  zwischen2,d5            ;Nummer angeben
       bsr     getinstrument           ;Instrument laden
       addi.l  #50,zwischen1           ;Zeiger auf nächsten Namen setzen
       addq.l  #1,zwischen2            ;Nummer um eins erhöhen
       dbra    d6,newfileinstl         ;weiter geht's mit'm nächsten
       bra     loaded                  ;und fertig

; Song von alter W.O.S.-Version
oldwosfile:
       move.l  membase,a5
       adda.l  #8100,a5                ;Zeiger auf Namen des Insts
       moveq   #0,d5                   ;Nummer des Insts
       bsr     getinstrument           ;und laden
       move.l  membase,a5
       adda.l  #8200,a5                ;siehe oben
       moveq   #1,d5
       bsr     getinstrument
       move.l  membase,a5
       adda.l  #8300,a5                ;siehe oben
       moveq   #2,d5
       bsr     getinstrument
       move.l  membase,a5
       adda.l  #8400,a5                ;siehe oben
       moveq   #3,d5
       bsr     getinstrument
       move.l  membase,a5              ;siehe oben
       adda.l  #8150,a5
       moveq   #4,d5
       bsr     getinstrument
       move.l  membase,a5
       adda.l  #8250,a5                ;siehe oben
       moveq   #5,d5
       bsr     getinstrument
       move.l  membase,a5
       adda.l  #8350,a5                ;siehe oben
       moveq   #6,d5
       bsr     getinstrument
       move.l  membase,a5
       adda.l  #8450,a5                ;siehe oben
       moveq   #7,d5
       bsr     getinstrument
       bra     loaded                  ;Fertig !

; Routine zum Reservieren des Speichers und Laden der Insts
getinstrument:
       move.l  dosbase,a6
       move.l  d5,d4                   ;Instrumentennummer mal 4
       mulu    #4,d4                   ; => Zeiger auf Speicherstelle
       lea     long1mem,a1
       tst.l   0(a1,d4)                ;Prüfen ob Instrument gebraucht wird
       beq     cannotgetinst           ;wird nicht gebraucht
       move.l  a5,d1
       move.l  #-2,d2                  ;Lock für Instrument ermitteln
       jsr     Lock(a6)
       move.l  d0,d1                   ;gibt's kein Lock ...
       beq     cannotgetinst           ;gibt's kein Instrument !
       move.l  d0,d7
       move.l  membase,d2
       addi.l  #10000,d2               ;Filelock examinieren
       move.l  d2,a2
       jsr     Examine(a6)
       tst.l   d0                      ;hat nicht geklappt ?
       beq     cannotgetinst           ;gibt's kein Instrument !
       move.l  d7,d1
       jsr     UnLock(a6)              ;Lock wieder freigeben
       move.l  exbase,a6
       lea     long1mem,a1
       move.l  124(a2),0(a1,d4)        ;Länge des Files lesen
       move.l  124(a2),d0
       move.l  #$3,d1                  ;Flag für AllocMem: ChipMem
       jsr     AllocMem(a6)            ;und enstsprechend Speicher reserv.
       tst.l   d0                      ;gibt's kein Speicher ?
       beq     cannotgetinst           ;gibt's halt kein Instrument !
       lea     inst1mem,a1
       move.l  d0,0(a1,d4)             ;Zeiger auf Speicher sichern
       move.l  d0,a4
       move.l  dosbase,a6
       move.l  a5,d1                   ;Instrumentenfile öffnen
       move.l  #1005,d2
       jsr     Open(a6)
       move.l  d0,filehandle           ;Filehandle sichern
       beq     cannotgetinst           ;kein Filehandle ? ... Pech !
       move.l  d0,d1                   ;Filehandle in d1
       move.l  a4,d2                   ;Zeiger auf Speicher in d2
       lea     long1mem,a1
       move.l  0(a1,d4),d3             ;Länge des Files in d3
       jsr     Read(a6)                ;Instrumentenfile lesen
       move.l  filehandle,d1
       jsr     Close(a6)               ;File schließen
       moveq   #0,d3

; Anfang vom Body-Chunk im IFF-File suchen
erminstbody:
       addq.l  #2,d3                   ;Zähler plus 2
       cmpi.l  #140000,d3              ;nach 1400000 Byte noch kein BODY ?
       beq     cannotgetinst           ;... war wohl kein IFF-File
       adda.l  #2,a4                   ;Adresse plus 2
       cmpi.l  #"BODY",(a4)            ;steht das 'BODY' ?
       bne     erminstbody             ;nein ... also weitersuchen
       adda.l  #4,a4                   ;Zeiger auf eigentliche Daten
       lea     body1mem,a1
       move.l  a4,0(a1,d4)             ;sichern
       rts                             ;Fertig !

; Irgendwie ham'wer kein Instrument gekriegt !
cannotgetinst:
       lea     long1mem,a1             ;Längenzeiger des Instruments
       mulu    #4,d5
       clr.l   0(a1,d5)                ;als Flag löschen
       rts                             ;Fertig !

; *** Alles ist geladen ... also los geht's

loaded:
       move.l  dosbase,a6
       tst.b   cliflag                 ;Start von CLI ?
       bne     noclidir2               ;ja, also weiter unten
       move.l  startmsg,a0
       move.l  $24(a0),a0              ;Sonst wieder Start
       move.l  (a0),d1                 ;Directory zum
       jsr     CurrentDir(a6)          ;actual_dir machen
       bra     doclidir
noclidir2:
       move.l  oldlock,d1              ;hier altes (CLI-)Dir
       jsr     CurrentDir(a6)          ;zum actual_dir machen
doclidir:
       move.l  instlock,d1             ;Inst-Dir-Lock freigeben
       jsr     UnLock(a6)

; Instrument für den Start suchen, falls keins gesetzt ist
       moveq   #2,d0                   ;Zeiger auf erste Position
       moveq   #0,d1
       move.l  membase,a0
       cmp.b   #220,1(a0,d0)           ;Prüfen, ob an der ersten
       bls     no1instfound
       cmp.b   #229,1(a0,d0)
       beq     no1instfound            ;Position ein Instrumenten-
       cmp.b   #230,1(a0,d0)
       beq     no1instfound
       cmp.b   #238,1(a0,d0)           ;Aufruf steht.
       bls     secur2
       bra     no1instfound            ;kein Aufruf gefunden ...
secur2:
       move.b  1(a0,d0),d1             ;Instrument gefunden
weli1got:
       bsr     dowhatinst              ;Werte für das Instrument ermitteln
       move.l  d2,instvoice1
       move.l  d3,bodyvoice1           ;und setzen
       moveq   #2,d0
       moveq   #0,d1
       move.l  membase,a0              ;selbiges für 2. Stimme
       adda.l  #2000,a0
       cmp.b   #220,1(a0,d0)
       bls     no2instfound
       cmp.b   #229,1(a0,d0)
       beq     no2instfound
       cmp.b   #230,1(a0,d0)
       beq     no2instfound
       cmp.b   #238,1(a0,d0)
       bls     secur3
       bra     no2instfound
secur3:
       move.b  1(a0,d0),d1
weli2got:
       bsr     dowhatinst
       move.l  d2,instvoice2
       move.l  d3,bodyvoice2
       moveq   #2,d0
       moveq   #0,d1
       move.l  membase,a0
       adda.l  #4000,a0                ;nochmal für die 3. Stimme
       cmp.b   #220,1(a0,d0)
       bls     no3instfound
       cmp.b   #229,1(a0,d0)
       beq     no3instfound
       cmp.b   #230,1(a0,d0)
       beq     no3instfound
       cmp.b   #238,1(a0,d0)
       bls     secur4
       bra     no3instfound
secur4:
       move.b  1(a0,d0),d1
weli3got:
       bsr     dowhatinst
       move.l  d2,instvoice3
       move.l  d3,bodyvoice3
       moveq   #2,d0
       moveq   #0,d1
       move.l  membase,a0
       adda.l  #6000,a0                ;und für die 4 Stimme
       cmp.b   #220,1(a0,d0)
       bls     no4instfound
       cmp.b   #229,1(a0,d0)
       beq     no4instfound
       cmp.b   #230,1(a0,d0)
       beq     no4instfound
       cmp.b   #238,1(a0,d0)
       bls     endisecur
       bra     no4instfound
endisecur:
       move.b  1(a0,d0),d1
weli4got:
       bsr     dowhatinst
       move.l  d2,instvoice4
       move.l  d3,bodyvoice4
       bra     goforplay

no1instfound:
       bsr     nowwelinst              ;Default-Instrument für Stimme 1
       bra     weli1got
no2instfound:
       bsr     nowwelinst              ;für Stimme 2
       bra     weli2got
no3instfound:
       bsr     nowwelinst              ;für Stimme 3
       bra     weli3got
no4instfound:
       bsr     nowwelinst              ;für Stimme 4
       bra     weli4got
nowwelinst:
       lea     long1mem,a5             ;Zeiger auf Instrument 1
       moveq   #15,d4                  ;maximal 16 mal suchen
       moveq   #0,d5
weliloop:
       move.l  0(a5,d5),d0             ;Prüfen ob das Instrument
       bne     gotweli                 ;besetzt ist ...
       addq.l  #4,d5                   ;wenn nicht, dann nächstes
       dbra    d4,weliloop             ;prüfen
gotweli:
       tst.l   d5
       beq     nullweli
       lsr.l   #2,d5                   ;Instrumentennummer ermitteln
nullweli:
       moveq   #0,d1
       lea     instwerttab,a5          ;und Instrumentenkennung lesen
       move.b  0(a5,d5),d1
       rts                             ;zurück zum Setzen des Instr.

; *** Weiter geht's mit dem Start des Abspiels ***

goforplay:
       clr.w   point1
       clr.w   point2                  ;Zeiger auf Noten für Start
       clr.w   point3
       clr.w   point4
       move.b  speedwert,speedplay     ;Geschwindigkeit
       clr.l   cres1
       clr.l   decr1                   ;alle übrigen Zeiger löschen
       clr.l   repc1
       clr.l   triolecount1
       clr.l   duolecount1
       clr.l   bogenflag1
       clr.w   triolerest1
       clr.w   triolerest2
       clr.w   triolerest3
       clr.w   triolerest4
       move.w  #5,long1
       move.w  #5,long2                ;noch 1/10 Sekunge, dann
       move.w  #5,long3
       move.w  #5,long4                ;geht's los
       move.w  #40,vol1
       move.w  #40,vol2                ;Anfangslautstärke
       move.w  #40,vol3
       move.w  #40,vol4                ;Mezzoforte

       move.w  #15,dmacon              ;DMA erst noch aus !

; *** Abspielroutinen in den Vertical_Blanking_Interrupt ***

       move.l  exbase,a6
       move.l  #31,d0                  ;SignalbitNr. 31 anfordern
       jsr     AllocSignal(a6)         ;da Signalbit 31 beendet Abspiel
       cmp.l   #-1,d0                  ;Signal frei ?
       beq     ende                    ;is eigentlich immer frei !
       move.l  membase,a1
       adda.l  #9000,a1                ;Speicher für Interrupt-Server
       move.l  a1,d0
       add.l   #32,d0                  ;Werte für Interrupt-Server
       move.l  d0,14(a1)
       move.b  #-60,9(a1)              ;initialisieren
       move.b  #2,8(a1)
       lea     voice1,a2               ;näheres siehe z.Bsp.
       move.l  a2,18(a1)               ;Amiga Intern von DB
       move.l  #5,d0
       jsr     AddIntServer(a6)        ;Interrupt-Server einhängen

; *** Der Rest läuft im Interrupt also warten !!! ***

       moveq   #0,d0
       bset    #31,d0                  ;Task in Waiting-State versetzen
       jsr     Wait(a6)

       move.w  #15,dmacon              ;Rückkehr aus Waiting-State
       move.l  membase,a1
       adda.l  #9000,a1                ;(CTRL-Taste gedrückt)
       move.l  #5,d0
       move.l  exbase,a6               ;Interrupt abschalten
       jsr     RemIntServer(a6)
       move.l  #31,d0
       jsr     FreeSignal(a6)          ;Signal wieder freigeben
       tst.l   tfilehandle
       beq     ende
       move.l  dosbase,a6
       move.l  #taskfile,d1            ;ADR-File löschen
       jsr     DeleteFile(a6)          ;(siehe Begleittexte)

; *** Programmende ***

ende:
       move.l  exbase,a6               ;Lied-Speicher freigen
       move.l  #11000,d0
       move.l  membase,a1
       jsr     FreeMem(a6)
       bsr     cliralli                ;Instrumentenspeicher freigeben
       move.l  dosbase,a1
       jsr     CloseLibrary(a6)        ;Dos-Lib schließen
ende1:
       tst.l   startmsg
       beq     endeprog
       tst.b   cliflag
       bne     endeprog
       move.l  exbase,a6               ;bei Start von Workbench
       jsr     Forbid(a6)
       move.l  startmsg,a1             ;Message beantworten
       jsr     ReplyMsg(a6)
endeprog:
       moveq   #0,d0
       moveq   #0,d1
       move.l  startsp,sp
       rts                             ;und Ende

; *** Speicher für Instrumente freigeben ***

cliralli:
       move.l  exbase,a6
       lea     long1mem,a5             ;Zeiger auf Länge des Instr.
       lea     inst1mem,a4             ;Zeiger auf Speicher
       moveq   #15,d4                  ;max. 16 Instrumente löschen
       moveq   #0,d5
clraliloop:
       move.l  0(a5,d5),d0             ;Länge lesen, wenn = 0 ?
       beq     nextcliralli            ;kein Instrument ... also nächstes
       move.l  0(a4,d5),a1             ;Zeiger auf Adresse
       jsr     FreeMem(a6)             ;Speicher freigeben
       clr.l   0(a5,d5)                ;und Zeiger für Länge löschen
nextcliralli:
       addq.l  #4,d5                   ;Zeiger auf nächstes Instrument
       dbra    d4,clraliloop           ;und weiter geht's
       rts

; *** Eingentliche Abspielroutinen / Interrupt-Routinen ***

voice1:                                ;Routinen für Stimme 1
       move.l  a3,-(sp)
       move.l  d4,-(sp)                ;zur Sicherheit: benutzte
       move.l  d3,-(sp)
       move.l  d2,-(sp)
       move.l  d7,-(sp)                ;Register sichern
       move.l  a0,-(sp)
       move.l  a4,-(sp)
       move.l  a5,-(sp)
       move.l  exbase,a6
       jsr     Disable(a6)             ;zur Sicherheit IRQs verbieten

       tst.w   stlong1                 ;Prüfen, ob Staccatozähler
       beq     nosslo1                 ;ungleich 0
       subq.w  #1,stlong1              ;ja ... runterzählen
nosslo1:
       subq.w  #1,long1                ;Längenzähler um 1 vermindern
       beq     dovoice1                ;wenn null, dann nächste Note
       cmp.w   #1,long1                ;Längenzähler = 1 ?
       bne     voice2                  ;nein ... also weiter mit Stimme 2
       moveq   #0,d0
       move.w  point1,d0               ;Aktuelle Positionsnummer in d0
       asl.w   #1,d0                   ;ergibt Zeiger auf Position
       move.l  membase,a0
       cmp.b   #219,3(a0,d0)           ;Prüfen auf Haltebögen ( oben
       beq     voice2                  ;und unten, wenn ja dann weiter
       cmp.b   #218,3(a0,d0)           ;weiter mit Stimme 2
       beq     voice2
       move.w  #0,aud0vol              ;sonst Stimme 1 ausschalten
       move.w  #1,dmacon
       bra     voice2                  ;und weiter mit Stimme 2
dovoice1:
       cmp.b   #1,triolecount1         ;Prüfen, ob Restwartezeit
       bne     norestwart1             ;von Triole zu spielen ist
       move.w  triolerest1,long1       ;wenn ja, Rest in Triolenzähler
       beq     norestwart1             ;Rest = 0 ? ... weiter unten
       clr.w   triolerest1
       clr.b   triolecount1            ;sonst Restzeiger löschen und
       bra     voice2                  ;weiter mit Stimme 2
norestwart1:
       addq.w  #1,point1               ;Notenzeiger um 1 erhöhen
       moveq   #0,d0
       moveq   #0,d1
       move.w  point1,d0               ;Notenzeiger nach d0
       asl.w   #1,d0                   ;und Zeiger auf Position ermitteln
       move.l  membase,a0
       move.b  1(a0,d0),d1             ;Notenlänge lesen, wenn Länge <> 0
       bne     noendsong1              ;dann Ende der Stimme nicht erreicht
       clr.b   repc1
       clr.w   point1                  ;sonst Zeiger auf Anfang setzen
       addq.w  #1,point1
       move.w  point1,d0               ;und erste Notenlänge lesen
       asl.w   #1,d0
       move.b  1(a0,d0),d1
       beq     voice2                  ;wieder 0 ? ... Leere Stimme
noendsong1:
       cmp.b   #255,d1                 ;Notenzeichen = Taktstrich ?
       beq     dovoice1
       cmp.b   #254,d1                 ;wenn ja, nächstes Zeichen lesen
       beq     dovoice1
       bsr     dowhatinst              ;Prüfen auf Instrumentenaufruf
       tst.l   d2
       beq     noinstsetv1             ;kein Aufruf ... unten weiter
       move.l  d2,instvoice1
       move.l  d3,bodyvoice1           ;sonst Werte für neues Inst setzen
       bra     dovoice1                ;und nächstes Zeichen lesen
noinstsetv1:
       cmp.b   #217,d1                 ;Zeichen = Staccatostart ?
       bne     nostonpl1               ;wenn nein ... unten weiter
       move.b  #1,stackato1            ;Staccato für Stimme 1 ein
       bra     dovoice1                ;und nächstes Zeichen
nostonpl1:
       cmp.b   #216,d1                 ;Zeichen = Staccatostop ?
       bne     nostoffpl1              ;wenn nein ... unten weiter
       clr.b   stackato1               ;Staccato für Stimme 1 aus
       bra     dovoice1                ;nächstes Zeichen
nostoffpl1:
       cmp.b   #230,d1                 ;Notenzeichen = Wiederholungsanfang ?
       bne     norepstapl1             ;wenn nein ... unten weiter
       cmp.b   #19,repc1               ;Schachteltiefe der Wiederholungen
       beq     dovoice1                ;schon 19 ? ... nichts geht mehr !
       addq.b  #1,repc1                ;Tiefenzähler um 1 erhöhen
       move.b  repc1,d1
       asl.b   #1,d1                   ;und aktuelle Notenposition in der
       lea     reps1,a0
       move.w  point1,0(a0,d1)         ;Wiederholungstabelle ablegen
       bra     dovoice1
norepstapl1:
       cmp.b   #229,d1                 ;Notenzeichen = Wiederholungsende ?
       bne     norependpl1             ;wenn nein ... unten weiter
       move.b  repc1,d1
       asl.b   #1,d1                   ;Notenposition aus der Tabelle lesen
       lea     reps1,a0
       move.w  point1,d0               ;und mit aktueller Position vergl.
       cmp.w   (a0,d1),d0
       bne     wieder1                 ;wenn ungleich, dann Wiederholung
       clr.w   0(a0,d1)
       cmp.b   #0,repc1                ;sonst: Widerholung beendet
       beq     dovoice1                ;Zähler schon 0 ? ... nächste Note
       sub.b   #1,repc1                ;sonst Zähler vermindern
       bra     dovoice1                ;und nächste Note
wieder1:
       move.w  (a0,d1),point1          ;Aktuelle Position als Wieder-
       move.w  d0,(a0,d1)              ;holungsende in der Tabelle sichern
       bra     dovoice1                ;und nächste Note
norependpl1:
       cmp.b   #240,d1                 ;Notenzeichen = Fermate ?
       bne     nofermate1              ;nein ... unten weiter
       move.b  #255,fermateflag        ;Flag für Fermate setzen
       bra     dovoice1                ;nächste Note
nofermate1:
       cmp.b   #253,d1                 ;Notenzeichen = Ritardando ?
       bne     noritar1                ;nein ... unten weiter
       cmp.b   #7,speedplay            ;Geschwindigkeit schon minimal ?
       beq     dovoice1                ;wenn ja: nächste Note
       addq.b  #1,speedplay            ;sonst Geschwindigkeit vermindern
       bra     dovoice1                ;und weiter mit nächster Note
noritar1:
       cmp.b   #252,d1                 ;Notenzeichen = Accelerando ?
       bne     noaccel1                ;nein ... unten weiter
       tst.b   speedplay               ;Geschwindigkeit schon maximal ?
       beq     dovoice1                ;wenn ja: nächste Note
       subq.b  #1,speedplay            ;sonst Geschwindigkeit erhöhen
       bra     dovoice1                ;und nächste Note
noaccel1:
       bsr     dowhatlaut              ;Prüfen ob neue Lautstärke
       tst.w   d2                      ;gefragt ist
       beq     nonewlaut1              ;nein ! also weiter
       move.w  d2,vol1                 ;ja ! also neue Lautstärke
       bra     dovoice1                ;nächste Note
nonewlaut1:
       cmp.b   #247,d1                 ;Notenzeichen = Crescendo ?
       bne     nocrescendo1            ;nein ... unten weiter
       clr.b   decr1                   ;sonst Decrescendo löschen
       move.b  #4,cres1                ;und Crescendozähler setzen
       bra     dovoice1                ;nächste Note
nocrescendo1:
       cmp.b   #248,d1                 ;Notenzeichen = Decrescendo ?
       bne     nodecrescendo1          ;nein ... unten weiter
       clr.b   cres1                   ;sonst Crescendo löschen
       move.b  #4,decr1                ;und Decrescendozähler setzen
       bra     dovoice1                ;nächste Note
nodecrescendo1:
       cmp.b   #239,d1                 ;Notenzeichen = Triole ?
       bne     notriolst1              ;nein ... unten weiter
       move.b  #4,triolecount1         ;Triolenzähler setzen
       bra     dovoice1                ;und weiter
notriolst1:
       cmp.b   #220,d1                 ;Notenzeichen = Duole ?
       bne     noduolst1               ;nein ...
       move.b  #2,duolecount1          ;Duolenzähler setzen
       bra     dovoice1                ;...
noduolst1:
       cmp.b   #219,d1                 ;Notenzeichen = Bogen oben ?
       bne     nobho1                  ;nein...
       move.b  #255,bogenflag1         ;Flag für Haltebogen setzen
       move.b  high1,d1                ;Prüfen, ob gleiche Notenhöhe
       cmp.b   2(a0,d0),d1             ;bei der nächsten Note
       beq     dovoice1                ;ja ... also gleich weiter
       move.w  #1,dmacon               ;nein ... Stimme kurz ausschalten
       bra     dovoice1                ;weiter ...
nobho1:
       cmp.b   #218,d1                 ;Notenzeichen = Bogen unten ?
       bne     nobti1                  ;nein ...
       move.b  #255,bogenflag1         ;Flag für Haltebogen setzen
       move.b  high1,d1                ;Prüfen, ob gleiche Notenhöhe
       cmp.b   2(a0,d0),d1             ;bei der nächsten Note
       beq     dovoice1                ;ja ... gleich weiter
       move.w  #1,dmacon               ;nein ... Stimme kurz ausschalten
       bra     dovoice1                ;weiter...
nobti1:
       tst.b   cres1                   ;Crescendo aktiv ?
       beq     nodocres1               ;nein... unten weiter
       subq.b  #1,cres1                ;sonst Zähler vermindern
       cmp.w   #64,vol1                ;Lautstärke schon maximal ?
       bge     nodocres1               ;ja ... weiter
       addq.w  #4,vol1                 ;nein ... Lautstärke erhöhen
nodocres1:
       tst.b   decr1                   ;Decrescendo aktiv ?
       beq     nododecr1               ;nein ... weiter
       subq.b  #1,decr1                ;Zähler verminder
       cmp.w   #0,vol1                 ;Lautstärke schon minimal ?
       bls     nododecr1               ;ja ... unten weiter
       subq.w  #4,vol1                 ;Lautstärke vermindern
nododecr1:
       asl.w   #1,d1                   ;kein Sonderzeichen, also Notenlänge
       lea     longtab,a1
       move.w  0(a1,d1),d2             ;aus der Längentabelle lesen
       moveq   #0,d7
       move.b  speedplay,d7            ;und mit Geschwindigkeitswert
       addq.b  #1,d7
       mulu    d7,d2                   ;multiplizieren
       tst.b   fermateflag             ;prüfen, ob Fermate zu spielen
       beq     nodoferm1               ;nein ... unten weiter
       mulu    #2,d2                   ;sonst Länge mal 2
       clr.b   fermateflag             ;und Flag löschen
nodoferm1:
       tst.b   duolecount1             ;prüfen, ob Duole zu spielen
       beq     noduopl1                ;nein ... unten weiter
       subq.b  #1,duolecount1          ;sonst Zähler vermindern
       mulu    #3,d2                   ;und Notenlänge mit 1,5
       divu    #2,d2                   ;multiplizieren
noduopl1:
       cmp.b   #1,triolecount1         ;prüfen, ob Triole zu spielen
       bls     nodotriole1             ;nein ... unten weiter
       subq.b  #1,triolecount1         ;sonst Zähler vermindern
       mulu    #2,d2                   ;und Notenlänge mit 2/3
       divu    #3,d2                   ;multiplizieren
       swap    d2
       move.w  d2,triolerest1          ;und den Rest sichern
       swap    d2
nodotriole1:
       move.w  d2,long1                ;Notenlänge sichern
       lsr.w   #1,d2                   ;durch 2 Teilen und in
       move.w  d2,stlong1              ;Staccatozähler schreiben
       moveq   #0,d1
       move.b  0(a0,d0),d1             ;Notenhöe lesen und wenn Länge = 0
       beq     voice2                  ;Pause spielen&weiter mit Stimme 2
       bclr    #7,d1                   ;Bits für Sonderzeichen zur
       bclr    #6,d1                   ;Sicherheit löschen
       move.b  d1,high1                ;Notenhöhe sichern
       moveq   #0,d4
       move.l  d1,d3                   ;Oktave der zu spielenden
       divu    #12,d3                  ;Note ermiteln
       add.w   d3,d4
       addq.b  #1,d4
       move.l  d4,okt1                 ;und sichern
       move.l  d4,allokt
       move.l  bodyvoice1,d4           ;Zeiger auf Bodychunk
       move.l  instvoice1,a3           ;und auf Speicher der Stimme
       bsr     ermnotes                ;Werte für Chip ermitteln
       move.l  d4,aud0lch              ;Adresse der Sounddaten
       move.w  d7,aud0len              ;Samplelänge in Chipregister
       move.w  d0,aud0per              ;und Sampleperiod und
       move.l  20(a3),d3               ;prüfen ob OneShotPart vorhanden
       bne     oneshot1                ;ja ... weiter unten
       bsr     longpart1               ;nein... Daten für Longpart ermitteln
oneshot1:
       tst.b   bogenflag1              ;Prüfen, ob Haltebogen zu spielen
       beq     goshot1                 ;nein ... also Oneshotpart spieln
       clr.b   bogenflag1              ;sonst Flag löschen und
       bsr     longpart1
       tst.l   24(a3)
       beq     dropshot1               ;Oneshotpart überspringen
goshot1:
       move.w  #$8201,dmacon           ;Audio DMA einschalten
       move.w  vol1,aud0vol            ;Lautstärke setzen
dropshot1:
       move.l  24(a3),d3               ;Prüfen, ob Longpart vorhanden
       bne     voice2                  ;ja ... also weiter mit Stimme 2
       move.l  #10,okt1                ;nein ... entsprechendes Flag

voice2:
       tst.b   stackato1               ;Prüfen ob Staccato in Stimme 1
       beq     vvoice2                 ;aktiv ? nein ... weiter unten
       tst.w   stlong1                 ;Prüfen ob Staccatozähler = 0
       bne     vvoice2                 ;nein ... weiter unten
       move.w  #0,aud0vol              ;ja ... Stimme ausschalten
vvoice2:
       tst.w   stlong2                 ;alles wie bei Stimme 1 .....
       beq     nosslo2
       subq.w  #1,stlong2
nosslo2:                               ;siehe oben
       subq.w  #1,long2
       beq     dovoice2
       cmp.w   #1,long2
       bne     voice3
       moveq   #0,d0
       move.w  point2,d0
       asl.w   #1,d0
       move.l  membase,a0
       adda.l  #song2base,a0
       cmp.b   #219,3(a0,d0)
       beq     voice3
       cmp.b   #218,3(a0,d0)
       beq     voice3
       move.w  #0,aud1vol
       move.w  #2,dmacon
       bra     voice3
dovoice2:
       cmp.b   #1,triolecount2
       bne     norestwart2
       move.w  triolerest2,long2
       beq     norestwart2
       clr.w   triolerest2
       clr.b   triolecount2
       bra     voice3
norestwart2:
       moveq   #0,d0
       moveq   #0,d1
       addq.w  #1,point2
       move.w  point2,d0
       asl.w   #1,d0
       move.l  membase,a0
       adda.l  #song2base,a0
       move.b  1(a0,d0),d1
       bne     noendsong2
       clr.b   repc2
       clr.w   point2
       addq.w  #1,point2
       move.w  point2,d0
       asl.w   #1,d0
       move.b  1(a0,d0),d1
       beq     voice3
noendsong2:
       cmp.b   #255,d1
       beq     dovoice2
       cmp.b   #254,d1
       beq     dovoice2
       bsr     dowhatinst
       tst.l   d2
       beq     noinstsetv2
       move.l  d2,instvoice2
       move.l  d3,bodyvoice2
       bra     dovoice2
noinstsetv2:
       cmp.b   #217,d1
       bne     nostonpl2
       move.b  #1,stackato2
       bra     dovoice2
nostonpl2:
       cmp.b   #216,d1
       bne     nostoffpl2
       clr.b   stackato2
       bra     dovoice2
nostoffpl2:
       cmp.b   #230,d1
       bne     norepstapl2
       cmp.b   #19,repc2
       beq     dovoice2
       addq.b  #1,repc2
       move.b  repc2,d1
       asl.b   #1,d1
       lea     reps2,a0
       move.w  point2,0(a0,d1)
       bra     dovoice2
norepstapl2:
       cmp.b   #229,d1
       bne     norependpl2
       move.b  repc2,d1
       asl.b   #1,d1
       lea     reps2,a0
       move.w  point2,d0
       cmp.w   (a0,d1),d0
       bne     wieder2
       clr.w   0(a0,d1)
       cmp.b   #0,repc2
       beq     dovoice2
       sub.b   #1,repc2
       bra     dovoice2
wieder2:
       move.w  (a0,d1),point2
       move.w  d0,(a0,d1)
       bra     dovoice2
norependpl2:
       cmp.b   #240,d1
       bne     nofermate2
       move.b  #255,fermateflag
       bra     dovoice2
nofermate2:
       cmp.b   #253,d1
       bne     noritar2
       cmp.b   #7,speedplay
       beq     dovoice2
       addq.b  #1,speedplay
       bra     dovoice2
noritar2:
       cmp.b   #252,d1
       bne     noaccel2
       tst.b   speedplay
       beq     dovoice2
       subq.b  #1,speedplay
       bra     dovoice2
noaccel2:
       bsr     dowhatlaut
       tst.w   d2
       beq     nonewlaut2
       move.w  d2,vol2
       bra     dovoice2
nonewlaut2:
       cmp.b   #247,d1
       bne     nocrescendo2
       clr.b   decr2
       move.b  #4,cres2
       bra     dovoice2
nocrescendo2:
       cmp.b   #248,d1
       bne     nodecrescendo2
       clr.b   cres2
       move.b  #4,decr2
       bra     dovoice2
nodecrescendo2:
       cmp.b   #239,d1
       bne     notriolst2
       move.b  #4,triolecount2
       bra     dovoice2
notriolst2:
       cmp.b   #220,d1
       bne     noduolst2
       move.b  #2,duolecount2
       bra     dovoice2
noduolst2:
       cmp.b   #219,d1
       bne     nobho2
       move.b  #255,bogenflag2
       move.b  high2,d1
       cmp.b   2(a0,d0),d1
       beq     dovoice2
       move.w  #2,dmacon
       bra     dovoice2
nobho2:
       cmp.b   #218,d1
       bne     nobti2
       move.b  #255,bogenflag2
       move.b  high2,d1
       cmp.b   2(a0,d0),d1
       beq     dovoice2
       move.w  #2,dmacon 
       bra     dovoice2
nobti2:
       tst.b   cres2
       beq     nodocres2
       subq.b  #1,cres2
       cmp.w   #64,vol2
       bge     nodocres2
       addq.w  #4,vol2
nodocres2:
       tst.b   decr2
       beq     nododecr2
       subq.b  #1,decr2
       cmp.w   #0,vol2
       bls     nododecr2
       subq.w  #4,vol2
nododecr2:
       asl.w   #1,d1
       lea     longtab,a1
       move.w  0(a1,d1),d2
       moveq   #0,d7
       move.b  speedplay,d7
       addq.b  #1,d7
       mulu    d7,d2
       tst.b   fermateflag
       beq     nodoferm2
       mulu    #2,d2
       clr.b   fermateflag
nodoferm2:
       tst.b   duolecount2
       beq     noduopl2
       subq.b  #1,duolecount2
       mulu    #3,d2
       divu    #2,d2
noduopl2:
       cmp.b   #1,triolecount2
       bls     nodotriole2
       subq.b  #1,triolecount2
       mulu    #2,d2
       divu    #3,d2
       swap    d2
       move.w  d2,triolerest2
       swap    d2
nodotriole2:
       move.w  d2,long2
       lsr.w   #1,d2
       move.w  d2,stlong2
       moveq   #0,d1
       move.b  0(a0,d0),d1
       beq     voice3
       bclr    #7,d1
       bclr    #6,d1
       move.b  d1,high2
       moveq   #0,d4
       move.l  d1,d3
       divu    #12,d3
       add.w   d3,d4
       addq.b  #1,d4
       move.l  d4,okt2
       move.l  d4,allokt
       move.l  bodyvoice2,d4
       move.l  instvoice2,a3
       bsr     ermnotes
       move.l  d4,aud1lch
       move.w  d7,aud1len
       move.w  d0,aud1per
       move.l  20(a3),d3
       bne     oneshot2
       bsr     longpart2
oneshot2:
       tst.b   bogenflag2
       beq     goshot2
       clr.b   bogenflag2
       bsr     longpart2
       tst.l   24(a3)
       beq     dropshot2
goshot2:
       move.w  #$8202,dmacon
       move.w  vol2,aud1vol
dropshot2:
       move.l  24(a3),d3
       bne     voice3
       move.l  #10,okt2

voice3:
       tst.b   stackato2               ;siehe Stimme 1
       beq     vvoice3
       tst.w   stlong2
       bne     vvoice3
       move.w  #0,aud1vol
vvoice3:
       tst.w   stlong3
       beq     nosslo3
       subq.w  #1,stlong3
nosslo3:
       subq.w  #1,long3
       beq     dovoice3
       cmp.w   #1,long3
       bne     voice4
       moveq   #0,d0
       move.w  point3,d0
       asl.w   #1,d0
       move.l  membase,a0
       adda.l  #song3base,a0
       cmp.b   #219,3(a0,d0)
       beq     voice4
       cmp.b   #218,3(a0,d0)
       beq     voice4
       move.w  #0,aud2vol
       move.w  #4,dmacon
       bra     voice4
dovoice3:
       cmp.b   #1,triolecount3
       bne     norestwart3
       move.w  triolerest3,long3
       beq     norestwart3
       clr.w   triolerest3
       clr.b   triolecount3
       bra     voice4
norestwart3:
       moveq   #0,d0
       moveq   #0,d1
       addq.w  #1,point3
       move.w  point3,d0
       asl.w   #1,d0
       move.l  membase,a0
       adda.l  #song3base,a0
       move.b  1(a0,d0),d1
       bne     noendsong3
       clr.b   repc3
       clr.w   point3
       addq.w  #1,point3
       move.w  point3,d0
       asl.w   #1,d0
       move.b  1(a0,d0),d1
       beq     voice4
noendsong3:
       cmp.b   #255,d1
       beq     dovoice3
       cmp.b   #254,d1
       beq     dovoice3
       bsr     dowhatinst
       tst.l   d2
       beq     noinstsetv3
       move.l  d2,instvoice3
       move.l  d3,bodyvoice3
       bra     dovoice3
noinstsetv3:
       cmp.b   #217,d1
       bne     nostonpl3
       move.b  #1,stackato3
       bra     dovoice3
nostonpl3:
       cmp.b   #216,d1
       bne     nostoffpl3
       clr.b   stackato3
       bra     dovoice3
nostoffpl3:
       cmp.b   #230,d1
       bne     norepstapl3
       cmp.b   #19,repc3
       beq     dovoice3
       addq.b  #1,repc3
       move.b  repc3,d1
       asl.b   #1,d1
       lea     reps3,a0
       move.w  point3,0(a0,d1)
       bra     dovoice3
norepstapl3:
       cmp.b   #229,d1
       bne     norependpl3
       move.b  repc3,d1
       asl.b   #1,d1
       lea     reps3,a0
       move.w  point3,d0
       cmp.w   (a0,d1),d0
       bne     wieder3
       clr.w   0(a0,d1)
       cmp.b   #0,repc3
       beq     dovoice3
       sub.b   #1,repc3
       bra     dovoice3
wieder3:
       move.w  (a0,d1),point3
       move.w  d0,(a0,d1)
       bra     dovoice3
norependpl3:
       cmp.b   #240,d1
       bne     nofermate3
       move.b  #255,fermateflag
       bra     dovoice3
nofermate3:
       cmp.b   #253,d1
       bne     noritar3
       cmp.b   #7,speedplay
       beq     dovoice3
       addq.b  #1,speedplay
       bra     dovoice3
noritar3:
       cmp.b   #252,d1
       bne     noaccel3
       tst.b   speedplay
       beq     dovoice3
       subq.b  #1,speedplay
       bra     dovoice3
noaccel3:
       bsr     dowhatlaut
       tst.w   d2
       beq     nonewlaut3
       move.w  d2,vol3
       bra     dovoice3
nonewlaut3:
       cmp.b   #247,d1
       bne     nocrescendo3
       clr.b   decr3
       move.b  #4,cres3
       bra     dovoice3
nocrescendo3:
       cmp.b   #248,d1
       bne     nodecrescendo3
       clr.b   cres3
       move.b  #4,decr3
       bra     dovoice3
nodecrescendo3:
       cmp.b   #239,d1
       bne     notriolst3
       move.b  #4,triolecount3
       bra     dovoice3
notriolst3:
       cmp.b   #220,d1
       bne     noduolst3
       move.b  #2,duolecount3
       bra     dovoice3
noduolst3:
       cmp.b   #219,d1
       bne     nobho3
       move.b  #255,bogenflag3
       move.b  high3,d1
       cmp.b   2(a0,d0),d1
       beq     dovoice3
       move.w  #4,dmacon
       bra     dovoice3
nobho3:
       cmp.b   #218,d1
       bne     nobti3
       move.b  #255,bogenflag3
       move.b  high3,d1
       cmp.b   2(a0,d0),d1
       beq     dovoice3
       move.w  #4,dmacon
       bra     dovoice3
nobti3:
       tst.b   cres3
       beq     nodocres3
       subq.b  #1,cres3
       cmp.w   #64,vol3
       bge     nodocres3
       addq.w  #4,vol3
nodocres3:
       tst.b   decr3
       beq     nododecr3
       subq.b  #1,decr3
       cmp.w   #0,vol3
       bls     nododecr3
       subq.w  #4,vol3
nododecr3:
       asl.w   #1,d1
       lea     longtab,a1
       move.w  0(a1,d1),d2
       moveq   #0,d7
       move.b  speedplay,d7
       addq.b  #1,d7
       mulu    d7,d2
       tst.b   fermateflag
       beq     nodoferm3
       mulu    #2,d2
       clr.b   fermateflag
nodoferm3:
       tst.b   duolecount3
       beq     noduopl3
       subq.b  #1,duolecount3
       mulu    #3,d2
       divu    #2,d2
noduopl3:
       cmp.b   #1,triolecount3
       bls     nodotriole3
       subq.b  #1,triolecount3
       mulu    #2,d2
       divu    #3,d2
       swap    d2
       move.w  d2,triolerest3
       swap    d2
nodotriole3:
       move.w  d2,long3
       lsr.w   #1,d2
       move.w  d2,stlong3
       move    #0,d1
       move.b  0(a0,d0),d1
       beq     voice4
       bclr    #7,d1
       bclr    #6,d1
       move.b  d1,high3
       moveq   #0,d4
       move.l  d1,d3
       divu    #12,d3
       add.w   d3,d4
       addq.b  #1,d4
       move.l  d4,okt3
       move.l  d4,allokt
       move.l  bodyvoice3,d4
       move.l  instvoice3,a3
       bsr     ermnotes
       move.l  d4,aud2lch
       move.w  d7,aud2len
       move.w  d0,aud2per
       move.l  20(a3),d3
       bne     oneshot3
       bsr     longpart3
oneshot3:
       tst.b   bogenflag3
       beq     goshot3
       clr.b   bogenflag3
       bsr     longpart3
       tst.l   24(a3)
       beq     dropshot3
goshot3:
       move.w  #$8204,dmacon
       move.w  vol3,aud2vol
dropshot3:
       move.l  24(a3),d3
       bne     voice4
       move.l  #10,okt3

voice4:
       tst.b   stackato3               ;siehe wieder Stimme 1
       beq     vvoice4
       tst.w   stlong3
       bne     vvoice4
       move.w  #0,aud2vol
vvoice4:
       tst.w   stlong4
       beq     nosslo4
       subq.w  #1,stlong4
nosslo4:
       subq.w  #1,long4
       beq     dovoice4
       cmp.w   #1,long4
       bne     novoice
       moveq   #0,d0
       move.w  point4,d0
       asl.w   #1,d0
       move.l  membase,a0
       adda.l  #song4base,a0
       cmp.b   #219,3(a0,d0)
       beq     novoice
       cmp.b   #218,3(a0,d0)
       beq     novoice
       move.w  #0,aud3vol
       move.w  #8,dmacon
       bra     novoice
dovoice4:
       cmp.b   #1,triolecount4
       bne     norestwart4
       move.w  triolerest4,long4
       beq     norestwart4
       clr.w   triolerest4
       clr.b   triolecount4
       bra     novoice
norestwart4:
       moveq   #0,d0
       moveq   #0,d1
       addq.w  #1,point4
       move.w  point4,d0
       asl.w   #1,d0
       move.l  membase,a0
       adda.l  #song4base,a0
       move.b  1(a0,d0),d1
       bne     noendsong4
       clr.b   repc4
       clr.w   point4
       addq.w  #1,point4
       move.w  point4,d0
       asl.w   #1,d0
       move.b  1(a0,d0),d1
       beq     novoice
noendsong4:
       cmp.b   #255,d1
       beq     dovoice4
       cmp.b   #254,d1
       beq     dovoice4
       bsr     dowhatinst
       tst.l   d2
       beq     noinstsetv4
       move.l  d2,instvoice4
       move.l  d3,bodyvoice4
       bra     dovoice4
noinstsetv4:
       cmp.b   #217,d1
       bne     nostonpl4
       move.b  #1,stackato4
       bra     dovoice4
nostonpl4:
       cmp.b   #216,d1
       bne     nostoffpl4
       clr.b   stackato4
       bra     dovoice4
nostoffpl4:
       cmp.b   #230,d1
       bne     norepstapl4
       cmp.b   #19,repc4
       beq     dovoice4
       addq.b  #1,repc4
       move.b  repc4,d1
       asl.b   #1,d1
       lea     reps4,a0
       move.w  point4,0(a0,d1)
       bra     dovoice4
norepstapl4:
       cmp.b   #229,d1
       bne     norependpl4
       move.b  repc4,d1
       asl.b   #1,d1
       lea     reps4,a0
       move.w  point4,d0
       cmp.w   (a0,d1),d0
       bne     wieder4
       clr.w   0(a0,d1)
       cmp.b   #0,repc4
       beq     dovoice4
       sub.b   #1,repc4
       bra     dovoice4
wieder4:
       move.w  (a0,d1),point4
       move.w  d0,(a0,d1)
       bra     dovoice4
norependpl4:
       cmp.b   #240,d1
       bne     nofermate4
       move.b  #255,fermateflag
       bra     dovoice4
nofermate4:
       cmp.b   #253,d1
       bne     noritar4
       cmp.b   #7,speedplay
       beq     dovoice4
       addq.b  #1,speedplay
       bra     dovoice4
noritar4:
       cmp.b   #252,d1
       bne     noaccel4
       tst.b   speedplay
       beq     dovoice4
       subq.b  #1,speedplay
       bra     dovoice4
noaccel4:
       bsr     dowhatlaut
       tst.w   d2
       beq     nonewlaut4
       move.w  d2,vol4
       bra     dovoice4
nonewlaut4:
       cmp.b   #247,d1
       bne     nocrescendo4
       clr.b   decr4
       move.b  #4,cres4
       bra     dovoice4
nocrescendo4:
       cmp.b   #248,d1
       bne     nodecrescendo4
       clr.b   cres4
       move.b  #4,decr4
       bra     dovoice4
nodecrescendo4:
       cmp.b   #239,d1
       bne     notriolst4
       move.b  #4,triolecount4
       bra     dovoice4
notriolst4:
       cmp.b   #220,d1
       bne     noduolst4
       move.b  #2,duolecount4
       bra     dovoice4
noduolst4:
       cmp.b   #219,d1
       bne     nobho4
       move.b  #255,bogenflag4
       move.b  high4,d1
       cmp.b   2(a0,d0),d1
       beq     dovoice4
       move.w  #8,dmacon
       bra     dovoice4
nobho4:
       cmp.b   #218,d1
       bne     nobti4
       move.b  #255,bogenflag4
       move.b  high4,d1
       cmp.b   2(a0,d0),d1
       beq     dovoice4
       move.w  #8,dmacon
       bra     dovoice4
nobti4:
       tst.b   cres4
       beq     nodocres4
       subq.b  #1,cres4
       cmp.w   #64,vol4
       bge     nodocres4
       addq.w  #4,vol4
nodocres4:
       tst.b   decr4
       beq     nododecr4
       subq.b  #1,decr4
       cmp.w   #0,vol4
       bls     nododecr4
       subq.w  #4,vol4
nododecr4:
       asl.w   #1,d1
       lea     longtab,a1
       move.w  0(a1,d1),d2
       moveq   #0,d7
       move.b  speedplay,d7
       addq.b  #1,d7
       mulu    d7,d2
       tst.b   fermateflag
       beq     nodoferm4
       mulu    #2,d2
       clr.b   fermateflag
nodoferm4:
       tst.b   duolecount4
       beq     noduopl4
       subq.b  #1,duolecount4
       mulu    #3,d2
       divu    #2,d2
noduopl4:
       cmp.b   #1,triolecount4
       bls     nodotriole4
       subq.b  #1,triolecount4
       mulu    #2,d2
       divu    #3,d2
       swap    d2
       move.w  d2,triolerest4
       swap    d2
nodotriole4:
       move.w  d2,long4
       lsr.w   #1,d2
       move.w  d2,stlong4
       moveq   #0,d1
       move.b  0(a0,d0),d1
       beq     novoice
       bclr    #7,d1
       bclr    #6,d1
       move.b  d1,high4
       moveq   #0,d4
       move.l  d1,d3
       divu    #12,d3
       add.w   d3,d4
       addq.b  #1,d4
       move.l  d4,okt4
       move.l  d4,allokt
       move.l  bodyvoice4,d4
       move.l  instvoice4,a3
       bsr     ermnotes
       move.l  d4,aud3lch
       move.w  d7,aud3len
       move.w  d0,aud3per
       move.l  20(a3),d3
       bne     oneshot4
       bsr     longpart4
oneshot4:
       tst.b   bogenflag4
       beq     goshot4
       clr.b   bogenflag4
       bsr     longpart4
       tst.l   24(a3)
       beq     dropshot4
goshot4:
       move.w  #$8208,dmacon
       move.w  vol4,aud3vol
dropshot4:
       move.l  24(a3),d3
       bne     novoice
       move.l  #10,okt4
novoice:
       tst.b   stackato4
       beq     novvoice
       tst.w   stlong4
       bne     novvoice
       move.w  #0,aud3vol
novvoice:
       bsr     longpart1               ;Daten für Longparts
       bsr     longpart2               ;der Instrumente ermitteln
       bsr     longpart3
       bsr     longpart4
       cmp.b   #$39,tasten             ;Sondertaste CTRL abfragen
       bne     endirq
       move.l  exbase,a6
       move.l  thistask,a1             ;CTRL-Taste gedrückt
       moveq   #0,d0
       bset    #31,d0                  ;=> Signalbit 31 setzen
       jsr     Signal(a6)
endirq:
       move.l  exbase,a6
       jsr     Enable(a6)              ;IRQs freigeben
       move.l  (sp)+,a5
       move.l  (sp)+,a4                ;Registerinhalte
       move.l  (sp)+,a0
       move.l  (sp)+,d7                ;zurückschreiben
       move.l  (sp)+,d2
       move.l  (sp)+,d3
       move.l  (sp)+,d4
       move.l  (sp)+,a3
       rts

; *** Daten für LongPart_Teil des Instruments vorbereiten ***

longpart1:
       move.l  okt1,allokt             ;Oktave zur Bearbeitung
       beq     nohalt1                 ;wenn 0 dann nix los
       clr.l   okt1
       move.l  instvoice1,a3           ;Zeiger auf InstSpeicher
       move.l  bodyvoice1,d4           ;Zeiger auf BodyChunk
       bsr     ermlong                 ;Daten für LongPart_Teil holen
       move.l  d4,aud0lch              ;Rückgabewert: Sample_Addresse
       move.w  d1,aud0len              ;Rückgabewert: Sample_Länge
nohalt1:
       rts                             ;zurück

longpart2:                             ;Siehe oben
       move.l  okt2,allokt
       beq     nohalt2
       clr.l   okt2
       move.l  instvoice2,a3
       move.l  bodyvoice2,d4
       bsr     ermlong
       move.l  d4,aud1lch
       move.w  d1,aud1len
nohalt2:
       rts

longpart3:                             ;Siehe oben
       move.l  okt3,allokt
       beq     nohalt3
       clr.l   okt3
       move.l  instvoice3,a3
       move.l  bodyvoice3,d4
       bsr     ermlong
       move.l  d4,aud2lch
       move.w  d1,aud2len
nohalt3:
       rts

longpart4:                             ;Siehe oben
       move.l  okt4,allokt
       beq     nohalt4
       clr.l   okt4
       move.l  instvoice4,a3
       move.l  bodyvoice4,d4
       bsr     ermlong
       move.l  d4,aud3lch
       move.w  d1,aud3len
nohalt4:
       rts

; *** Sample_Länge, _Period und _Addresse für OneShotPart ***
; ***                 eines Tons ermitteln                ***
; für genauere Informationen bitte Begleittexte lesen

ermnotes:
       move.l  20(a3),d3               ;oneshot_Länge plus
       add.l   24(a3),d3               ;repeatpart_Länge => Gesamtlänge
       move.l  20(a3),d7               ;nochmal oneshot_Länge
       move.l  #3579546,d0             ;Konstante für Period_Berechnung
       asl.w   #1,d1
       lea     periodtab,a1            ;Period_Wert für Ton aus
       move.w  0(a1,d1),d1             ;Tabelle lesen und mal
       mulu    30(a3),d1               ;samples_per_hicycle des Inst
       cmp.l   #4,allokt               ;Prüfen auf Oktave 1
       bls     no1oc1                  ;nein ! also weiter
do1oc1:                                ;Oktave 1 : Period * sam_per_hi
       divu    d1,d0                   ; / Konstante gibt Sample_Period
       divu    #2,d7                   ;neue Länge des Sample_Teils
       rts                             ;fertig
no1oc1:
       cmp.l   #3,allokt               ;Prüfen auf Oktave 2
       bls     no1oc2                  ;nein also weiter
do1oc2:                                ;Oktave 2 :
       move.b  34(a3),d2               ;Prüfen ob's überhaupt 2
       cmp.b   #1,d2                   ;Oktaven im Inst_Sample gibt
       bls     do1oc1
       add.l   d3,d4                   ;Sample_Teil für Okt1 überspringen
       mulu    #2,d1                   ;Oktave 2 => Period mal 2
       divu    d1,d0                   ;Sample_Period berechnen
       rts                             ;fertig
no1oc2:
       cmp.l   #2,allokt               ;Prüfen auf Oktave 3
       bls     no1oc3                  ;nein also weiter
do1oc3:                                ;Oktave 3 :
       move.b  34(a3),d2               ;Prüfen ob's überhaupt 3
       cmp.b   #2,d2                   ;Oktaven im Inst_Sample gibt
       bls     do1oc2
       mulu    #3,d3                   ;Sample_Teil für Okt1 und
       add.l   d3,d4                   ;Okt2 überspringen
       mulu    #4,d1
       divu    d1,d0                   ;Sample_Period berechnen
       mulu    #2,d7                   ;neue Länge des Sample_Teils
       rts
no1oc3:
       cmp.l   #1,allokt               ;Siehe oben
       bls     no1oc4
do1oc4:
       move.b  34(a3),d2
       cmp.b   #3,d2
       bls     do1oc3
       mulu    #7,d3
       add.l   d3,d4
       mulu    #8,d1
       divu    d1,d0
       mulu    #4,d7
       rts
no1oc4:                                ;Siehe oben
       move.b  34(a3),d2
       cmp.b   #4,d2
       bls     do1oc4
       mulu    #15,d3
       add.l   d3,d4
       mulu    #16,d1
       divu    d1,d0
       mulu    #8,d7
       rts

; *** Sample_Länge, _Period und _Addresse des LongPart_Teils ***
; ***               eines Tons ermitteln                     ***
; für genauere Informationen bitte Begleittexte lesen

ermlong:
       move.l  20(a3),d3               ;Länge des OneShot_Part
       move.l  24(a3),d1               ;Länge des Long_Part
       move.l  24(a3),d7               ;Lämge des Long_Part
       cmp.l   #10,allokt              ;Prüfen, ob gar kein
       bne     no1nono                 ;LongPart gewünscht war
       lea     notone,a1               ;Kein LongPart =>
       move.l  #notone,d4              ;Blindwerte setzen
       move.w  #5,d1
       clr.l   allokt                  ;und zurück
       rts
no1nono:
       cmp.l   #4,allokt               ;Für die Berechnung der Werte
       bls     no1loc1
do1loc1:                               ;für den Long_Part-Teil eines
       add.l   d3,d4
       divu    #2,d1                   ;Samples gilt dasselbe
       rts                             ;programmtechnische Prinzip
no1loc1:
       cmp.l   #3,allokt               ;wie für die Berechnung der
       bls     no1loc2
do1loc2:                               ;Werte für den OneShot_Part,
       move.b  34(a3),d2
       cmp.b   #1,d2                   ;( siehe Routinen bei ermnotes )
       bls     do1loc1
       mulu    #3,d3                   ;nur daß bei Berechnung
       add.l   d3,d4
       add.l   d7,d4                   ;der Addresse des Samples
       clr.l   allokt
       rts                             ;jeweils noch der OneShot_Part
no1loc2:
       cmp.l   #2,allokt               ;mit dazu gerechnet werden muß
       bls     no1loc3
do1loc3:                               ;und eben die Länge des
       move.b  34(a3),d2
       cmp.b   #2,d2                   ;Long_Parts als Sample_Länge
       bls     do1loc2
       mulu    #7,d3                   ;übergeben wird
       add.l   d3,d4
       mulu    #3,d7
       add.l   d7,d4
       mulu    #2,d1
       clr.l   allokt
       rts
no1loc3:
       cmp.l   #1,allokt               ;siehe oben
       bls     no1loc4
do1loc4:
       move.b  34(a3),d2
       cmp.b   #3,d2
       bls     do1loc3
       mulu    #15,d3
       add.l   d3,d4
       mulu    #7,d7
       add.l   d7,d4
       mulu    #4,d1
       clr.l   allokt
       rts
no1loc4:                               ;siehe oben
       move.b  34(a3),d2
       cmp.b   #4,d2
       bls     do1loc4
       mulu    #31,d3
       add.l   d3,d4
       mulu    #15,d7
       add.l   d7,d4
       mulu    #8,d1
       clr.l   allokt
       rts

; *** Prüfen, ob neuer Lautstärkeaufruf gefragt ist ***

dowhatinst:
       moveq   #0,d2
       moveq   #0,d3
       lea     inst1mem,a4             ;Zeiger auf Instr-Adressen
       lea     body1mem,a5             ;Zeiger auf Instr-Body-Chunks
       cmp.b   #231,d1                 ;Prüfen, ob Instrument gefragt
       bne     noin1v1                 ;nein .... also weiter
       move.l  0(a4),d2                ;ja ... entsprechende Werte lesen
       move.l  0(a5),d3
       rts
noin1v1:
       cmp.b   #232,d1                 ;siehe oben
       bne     noin2v1
       move.l  4(a4),d2
       move.l  4(a5),d3
       rts
noin2v1:
       cmp.b   #233,d1                 ;siehe oben
       bne     noin3v1
       move.l  8(a4),d2
       move.l  8(a5),d3
       rts
noin3v1:
       cmp.b   #234,d1                 ;siehe oben
       bne     noin4v1
       move.l  12(a4),d2
       move.l  12(a5),d3
       rts
noin4v1:
       cmp.b   #235,d1
       bne     noin5v1
       move.l  16(a4),d2
       move.l  16(a5),d3
       rts
noin5v1:
       cmp.b   #236,d1
       bne     noin6v1
       move.l  20(a4),d2
       move.l  20(a5),d3
       rts
noin6v1:
       cmp.b   #237,d1
       bne     noin7v1
       move.l  24(a4),d2
       move.l  24(a5),d3
       rts
noin7v1:
       cmp.b   #238,d1
       bne     noin8v1
       move.l  28(a4),d2
       move.l  28(a5),d3
       rts
noin8v1:
       cmp.b   #221,d1
       bne     noin9v1
       move.l  32(a4),d2
       move.l  32(a5),d3
       rts
noin9v1:
       cmp.b   #222,d1
       bne     noin10v1
       move.l  36(a4),d2
       move.l  36(a5),d3
       rts
noin10v1:
       cmp.b   #223,d1
       bne     noin11v1
       move.l  40(a4),d2
       move.l  40(a5),d3
       rts
noin11v1:
       cmp.b   #224,d1
       bne     noin12v1
       move.l  44(a4),d2
       move.l  44(a5),d3
       rts
noin12v1:
       cmp.b   #225,d1
       bne     noin13v1
       move.l  48(a4),d2
       move.l  48(a5),d3
       rts
noin13v1:
       cmp.b   #226,d1
       bne     noin14v1
       move.l  52(a4),d2
       move.l  52(a5),d3
       rts
noin14v1:
       cmp.b   #227,d1
       bne     noin15v1
       move.l  56(a4),d2
       move.l  56(a5),d3
       rts
noin15v1:
       cmp.b   #228,d1
       bne     noin16v1
       move.l  60(a4),d2
       move.l  60(a5),d3
noin16v1:
       rts

; *** Prüfen, ob und wenn ja, welche neue Lautstärke ***

dowhatlaut:
       moveq   #0,d2
       cmp.b   #241,d1                 ;Prüfen auf Pianissimo
       bne     nopianissimo1           ;nein, also weiter
       move.w  #4,d2                   ;Lautstärkewert setzen
nopianissimo1:
       cmp.b   #242,d1                 ;siehe oben
       bne     nopiano1
       move.w  #16,d2
nopiano1:
       cmp.b   #243,d1                 ;siehe oben
       bne     nomezzopiano1
       move.w  #28,d2
nomezzopiano1:
       cmp.b   #244,d1                 ;siehe oben
       bne     nomezzoforte1
       move.w  #40,d2
nomezzoforte1:
       cmp.b   #245,d1                 ;siehe oben
       bne     noforte1
       move.w  #52,d2
noforte1:
       cmp.b   #246,d1                 ;siehe oben
       bne     nofortissimo1
       move.w  #64,d2
nofortissimo1:
       rts

; *** Sampleperiod-Tabelle zur Berechnung der Frequenz ***

periodtab:     dc.w    0,65,69,73,78,82,87,92,98,104
               dc.w    110,117,123,131,139,147,156,165,175,185
               dc.w    196,208,220,233,247,262,277,294,311,330,349,370
               dc.w    392,415,440,466,494,523,554,587,622,659,698,740
               dc.w    784,831,880,932,988,1047,1109,1175,1245,1319

; *** Variablen/Konstanten/Zwischenspeicher usw. ***

dosname:       dc.b    "dos.library",0
               align
filename:      ds.b    70,0
               align
testtask:      dc.b    "WOSPlayer",0
               align
taskfile:      dc.b    "ram:ADR",0
               align
filepoint:     dc.l    0
thistask:      dc.l    0       ; Zeiger auf den Task
startsp:       dc.l    0       ; Stapelzeiger beim Programmstart
startmsg:      dc.l    0       ; Startmessage beim Start von WB
dosbase:       dc.l    0       ; Dos-Lib Basisadresse
membase:       dc.l    0       ; Basisadresse des Musikstücks
filehandle:    dc.l    0       ; Filehandle für Lieddatenfile
tfilehandle:   dc.l    0       ; Filehandle für CLI-Start
instlock:      dc.l    0       ; Filelock für Instrumente
oldlock:       dc.l    0       ; Zwischenspeicher für altes Filelock
zwi1:          dc.l    0       ; Zwischenspeicher für Anfangswerte
zwi2:          dc.l    0

; *** Variablen/Konstanten für Stimmen ... ***

longtab:       dc.w    0,1,2,3,4,6,8,12,16,24,32,48
instwerttab:   dc.b    231,232,233,234,235,236,237,238
               dc.b    221,222,223,224,225,226,227,228
speedwert:     dc.w    0       ; Geschwindigkeit
vol1:          dc.w    0
vol2:          dc.w    0       ; Lautstärken
vol3:          dc.w    0
vol4:          dc.w    0
cres1:         dc.b    0
cres2:         dc.b    0       ; Zähler für Crescendo
cres3:         dc.b    0
cres4:         dc.b    0
decr1:         dc.b    0
decr2:         dc.b    0       ; Zähler für Decrescendo
decr3:         dc.b    0
decr4:         dc.b    0
triolecount1:  dc.b    0
triolecount2:  dc.b    0       ; Zähler für Triolen
triolecount3:  dc.b    0
triolecount4:  dc.b    0
stlong1:       dc.w    0
stlong2:       dc.w    0
stlong3:       dc.w    0
stlong4:       dc.w    0
triolerest1:   dc.w    0       
triolerest2:   dc.w    0       ; Restzähler für Triolen
triolerest3:   dc.w    0
triolerest4:   dc.w    0
duolecount1:   dc.b    0
duolecount2:   dc.b    0       ;Zähler für Duolenspiel
duolecount3:   dc.b    0
duolecount4:   dc.b    0
bogenflag1:    dc.b    0
bogenflag2:    dc.b    0       ;Flags für Haltebögen
bogenflag3:    dc.b    0
bogenflag4:    dc.b    0
stackato1:     dc.b    0
stackato2:     dc.b    0
stackato3:     dc.b    0
stackato4:     dc.b    0
               align
point1:        dc.w    0
point2:        dc.w    0       ; Notenzeiger
point3:        dc.w    0
point4:        dc.w    0
long1:         dc.w    0
long2:         dc.w    0       ; Zähler für Notenlänger
long3:         dc.w    0
long4:         dc.w    0
zwischen1:     dc.l    0       ;Zwischenspeicher für Verschiedenes
zwischen2:     dc.l    0
inst1mem:      ds.l    16,0    ; Zeiger auf Speicher der Instrumente
body1mem:      ds.l    16,0    ; Zeiger auf 'BodyChnuks'
long1mem:      ds.l    16,0    ; Zeiger für Längen der Instrumente
bodyvoice1:    dc.l    0
bodyvoice2:    dc.l    0       ; Zeiger auf 'BodyChunk'
bodyvoice3:    dc.l    0       ; für die 4 Stimmen
bodyvoice4:    dc.l    0       ; ( betr. IFF-Format )
instvoice1:    dc.l    0
instvoice2:    dc.l    0       ; Zeiger auf Speicher
instvoice3:    dc.l    0       ; der Instrumente
instvoice4:    dc.l    0       ; für die 4 Stimmen
allokt:        dc.l    0       ; Zeiger für Oktavenermittlung
okt1:          dc.l    0
okt2:          dc.l    0       ; Zeiger für Oktavenermittlung
okt3:          dc.l    0       ; für die 4 Stimmen
okt4:          dc.l    0
repc1:         dc.b    0
repc2:         dc.b    0       ; Wiederholungszähler
repc3:         dc.b    0
repc4:         dc.b    0
speedplay:     dc.b    0       ; Geschwindigkeitszeiger
fermateflag:   dc.b    0       ; Flag für Fermaten
cliflag:       dc.b    0       ; Flag für Start von CLI
versionflag:   dc.b    0       ; Flag für W.O.S. 1.0 oder später
high1:         dc.b    0
high2:         dc.b    0
high3:         dc.b    0       ;Zwischenspeicher für Notenhöhe
high4:         dc.b    0
               align
notone:        ds.w    10,0    ; Nix-Mem für Pausen
reps1:         ds.w    20,0
reps2:         ds.w    20,0    ; Speicher für Positionen
reps3:         ds.w    20,0    ; bei Wiederholungen
reps4:         ds.w    20,0
instdir:       dc.b    "Instruments",0
               align

 END


