Forum |  |  |   |   |    RGH | Es war zwar nicht ganz einfach, die benötigten Informationen zu finden, aber jetzt klappt es: Das Programm schreibt eine Midi-Datei mit zwei Kanälen: Orgel links und Schlagzeug rechts. Ich habe es versucht ein wenig zu kommentieren, damit eigene Experimente möglich sind.
  Gruß Roland KompilierenMarkierenSeparieren// Globale Variablen
Declare Integer Kanal, Anschlag, Oktave, String Musik
// Noten-Konstanten
Def %C- -1
Def %C 0
Def %C# 1
Def %D- 1
Def %D 2
Def %D# 3
Def %E- 3
Def %E 4
Def %E# 5
Def %F- 4
Def %F 5
Def %F# 6
Def %G- 6
Def %G 7
Def %G# 8
Def %A- 8
Def %A 9
Def %A# 10
Def %B- 10
Def %B 11
Def %B# 12
// Deutsche Schreibweise
Def %H- 10
Def %H 11
Def %H# 12
// Pause
Def %P $FF
Proc writeHex
    Parameters String sHex
    Declare Integer iLen, iByte
    iLen = len(sHex)/2
    WhileLoop 1, iLen
        iByte = val("$" + left$(sHex,2))
        PutByte #1, iByte
        sHex = Del$(sHex,1,2)
    EndWhile
EndProc
Proc writeByte
    Parameters Integer iByte
    PutByte #1, iByte
EndProc
Proc writeWord
    Parameters Integer iWord
    PutByte #1, iWord \ 256
    PutByte #1, iWord mod 256
EndProc
Proc writeLong
    Parameters Integer iLong
    writeWord(HiWord(iLong))
    writeWord(LoWord(iLong))
EndProc
Proc writeChars
    Parameters String sChars
    PutChar #1, sChars
EndProc
Proc Header
    Parameters Integer iTracks, iTempo
    writeChars("MThd")
    writeLong(6)
    writeWord(1)
    writeWord(iTracks)
    writeWord(iTempo)
EndProc
Proc TrackHeader
    Declare Pointer pAnzahl
    writeChars("MTrk")
    pAnzahl = FilePos(#1)
    writeLong(0)
    writeByte(0)
    Return pAnzahl
EndProc
Proc writeDauer
    Parameters Integer D
    // Deltatime in variable Bitlänge (1 oder 2) umwandeln
    // in dieser Fassung bis max. 0 .. 16383
    if D > 127' Deltatime = 2 Bytes
        writeByte(128 + D \ 128)
        writeByte(D mod 128)
    else' Deltatime = 1 Byte
        writeByte(D)
    endif
EndProc
Proc Note
    Parameters Integer Note, Dauer
    Declare Integer Ton, TonDauer, StummDauer
    Ton = 12 * Oktave + Note
    Select Musik
        CaseOf "N" : TonDauer = Dauer * 7 \ 8
        CaseOf "S" : TonDauer = Dauer * 4 \ 8
        CaseOf "L" : TonDauer = Dauer
    EndSelect
    Case Note = %P : TonDauer = 0
    StummDauer = Dauer - TonDauer
    If TonDauer > 0
        writeByte($90 + Kanal)' Note an auf Kanal
        writeByte(Ton)
        writeByte(Anschlag)' Anschlag
        writeDauer(TonDauer)
    EndIf
    writeByte($80 + Kanal)' Note aus auf Kanal
    writeByte(Ton)
    writeByte(0)' Anschlag 0 = stumm
    writeDauer(Stummdauer)' Zeit bis zur nächsten Note
EndProc
Proc Volume
    Parameters Integer Vol
    writeByte($B0 + Kanal)
    writeByte(7)
    writeByte(Vol)
    writeByte(0)
EndProc
Proc Stereo
    Parameters Integer Pos
    writeByte($B0 + Kanal)
    writeByte(10)
    writeByte(Pos)
    writeByte(0)
EndProc
Proc Instrument
    Parameters Integer Instrument
    writeByte($C0 + Kanal)
    writeByte(Instrument)
    writeByte(0)
EndProc
Proc TrackEnd
    Declare Longint TrackEndPos
    WriteHex("FF2F00")
    TrackEndPos = FilePos(#1)
    Return TrackEndPos
EndProc
// Hauptprogramm
// =============
Declare Longint pAnz, lAnzahl, lTrackStart, lTrackEnd
// Globale Einstellungen, die immer für alle folgenden Noten (Note, Pause)
// bis zur nächsten Änderung gelten
Kanal = 0
Anschlag = 127
Oktave = 4
Musik = "N"' Möglich sind "L"egato, "N"ormal, "S"taccato
// Datei anlegen bzw. öffnen, ggf. vorher löschen
Assign #1, "test.mid"
Erase #1
OpenRW #1
// Header schreiben; Parameter Tracks, Tempo (Viertelnoten/Minute)
Header(2,120)
// Track 1
// Trackheader schreiben; Rückgabe Position für Tracklänge in Bytes
pAnz = TrackHeader()
lTrackStart = FilePos(#1)
// Einstellungen
Volume(127)' Lautstärke 127
Stereo(0)' links
Instrument(16)' Orgel
// Hier kommt die Musik
// Parameter Note, Dauer (in Ticks: 120 = Viertel, 60 = Achtel, etc.)
Musik = "L"
Oktave = 5
Note(%A,120)
Note(%B,120)
Oktave = 6
Note(%C#,60)
Note(%D,60)
Note(%P,120)
Note(%E,120)
Note(%F#,120)
Note(%G#,120)
Note(%A,120)
TrackEnd
lTrackEnd = FilePos(#1)
lAnzahl = lTrackEnd - lTrackStart + 1
Print lAnzahl
Seek #1, pAnz
writeLong(lAnzahl)
// Track 2
// Schreibposition wieder ans Ende setzen
Seek #1, getFileSize(#1)
// Trackheader schreiben; Rückgabe Position für Tracklänge in Bytes
pAnz = TrackHeader()
lTrackStart = FilePos(#1)
// Einstellungen
Kanal = 9' Schlagzeug
Volume(127)' Lautstärke 127
Stereo(127)' rechts
Instrument(25)
Oktave = 3
WhileLoop 4
    Note(%C,30)
    Note(%F#,30)
    Note(%A#,30)
    Note(%F#,30)
    Note(%D,30)
    Note(%F#,30)
    Note(%A#,30)
    Note(%F#,30)
EndWhile
TrackEnd
lTrackEnd = FilePos(#1)
lAnzahl = lTrackEnd - lTrackStart + 1
Print lAnzahl
Seek #1, pAnz
writeLong(lAnzahl)
Close #1
MCISend$("OPEN test.mid TYPE SEQUENCER ALIAS MIDI")
MCISend$("PLAY MIDI WAIT")
MCISend$("CLOSE MIDI")
Print "Fertig!"
WaitInput
End
 |  
  |  |   |   | XProfan X2Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4   | 15.03.2013  ▲ |  
  |  |   |  
 
 
  |   |    |  
  Auf jeden Fall sehr cool,
  auch die Operatoren-Zeichen in den Konstantenbezeichnung toppen gleich nochmal alles um den Faktor infinite!  
  Müsste ich fast gleich mal meinen älteren Computer an das Midikeyb anschließen und ein bisschen XProfan-Quelltext einspielen -
  mal Jörgs Midi-IN raussuchen. |  
  |  |   |   |  |  |   |  
 
 
  |   |    | Nu hob i ka Lust mehr,
  sollte ein Fur Elise werden -
  zur freien Verwendung! ^^ KompilierenMarkierenSeparieren
proc note2
    Parameters Integer Note, Okt,Dauer
    Oktave=okt
    Note(Note,Dauer)
endproc
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%B,5,40)
Note2(%D,6,40)
Note2(%C,6,40)
Note2(%A,3,5)
Note2(%A,5,45)
Note2(%E,4,35)
Note2(%A,4,50)
Note2(%C,5,25)
Note2(%E,5,45)
Note2(%A,5,35)
Note2(%E,3,5)
Note2(%B,5,45)
Note2(%E,4,35)
Note2(%G#,4,50)
Note2(%E,5,25)
Note2(%G#,5,45)
Note2(%B,5,35)
Note2(%A,3,5)
Note2(%C,6,45)
Note2(%E,4,35)
Note2(%A,4,50)
Note2(%E,5,25)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%B,5,40)
Note2(%D,6,40)
Note2(%C,6,45)
Note2(%A,3,5)
Note2(%A,5,45)
Note2(%E,4,35)
Note2(%A,4,50)
Note2(%C,5,25)
Note2(%E,5,45)
Note2(%A,5,35)
Note2(%E,3,5)
Note2(%B,5,45)
Note2(%E,4,35)
Note2(%G#,4,50)
Note2(%E,5,25)
Note2(%C,6,45)
Note2(%B,5,35)
Note2(%A,5,5)
Note2(%A,3,45)
Note2(%E,4,45)
Note2(%A,4,65)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%B,5,40)
Note2(%D,6,40)
Note2(%C,6,40)
Note2(%A,3,5)
Note2(%A,5,45)
Note2(%E,4,35)
Note2(%A,4,50)
Note2(%C,5,40)
Note2(%E,5,25)
Note2(%A,5,40)
Note2(%E,3,5)
Note2(%B,5,45)
Note2(%E,4,40)
Note2(%G#,4,50)
Note2(%E,5,40)
Note2(%G#,5,25)
Note2(%B,5,40)
Note2(%A,3,5)
Note2(%C,6,45)
Note2(%E,4,35)
Note2(%A,4,50)
Note2(%E,5,25)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%D#,6,40)
Note2(%E,6,40)
Note2(%B,5,40)
Note2(%D,6,40)
Note2(%C,6,40)
Note2(%A,3,15)
Note2(%A,5,30)
Note2(%E,4,50)
Note2(%A,4,35)
Note2(%C,5,40)
Note2(%E,5,45)
Note2(%A,5,25)
Note2(%E,3,5)
Note2(%B,5,45)
Note2(%E,4,35)
Note2(%G#,4,50)
Note2(%E,5,35)
Note2(%C,6,45)
Note2(%B,5,25)
Note2(%A,3,5)
Note2(%A,5,45)
Note2(%E,4,45)
Note2(%A,4,25)
Note2(%B,5,45)
Note2(%C,6,40)
Note2(%D,6,40)
Note2(%C,4,10)
Note2(%E,6,45)
Note2(%G,4,30)
Note2(%C,5,45)
Note2(%G,5,35)
Note2(%F,6,45)
Note2(%E,6,30)
Note2(%G,3,5)
Note2(%D,6,50)
Note2(%G,4,35)
Note2(%B,4,35)
Note2(%F,5,40)
Note2(%E,6,45)
Note2(%D,6,30)
Note2(%A,3,5)
Note2(%C,6,50)
Note2(%E,4,35)
Note2(%A,4,35)
Note2(%E,5,40)
Note2(%D,6,45)
Note2(%C,6,30)
Note2(%E,3,5)
Note2(%B,5,50)
Note2(%E,4,30)
Note2(%E,5,40)
Note2(%E,5,45)
Note2(%E,6,30)
Note2(%E,5,45)
Note2(%E,6,35)
Note2(%E,6,40)
Note2(%E,7,40)
Note2(%D#,6,40)
Note2(%E,6,40)
 Viel Spaß! |  
  |  |   |   |  |  |   |  
 
 
  |   |    RGH | Ooooch .... gerade wenn's spannend wird, ist Schluß!  
  Gruß Roland |  
  |  |   |   | XProfan X2Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4   | 16.03.2013  ▲ |  
  |  |   |  
 
 
  |   |    | Ok, tippe morgen noch ein paar mehr Noten dazu ein.   |  
  |  |   |   |  |  |   |  
 
 
  |   |    Jörg Sellmeyer |  |  |   |   | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ...    | 16.03.2013  ▲ |  
  |  |   |  
 
 
  |   |    | Wie versprochen: KompilierenMarkierenSeparieren'{$cleq}
// Globale Variablen
Declare Integer Kanal, Anschlag, Oktave, String Musik
// Noten-Konstanten
Def %C- -1
Def %C 0
Def %C# 1
Def %D- 1
Def %D 2
Def %D# 3
Def %E- 3
Def %E 4
Def %E# 5
Def %F- 4
Def %F 5
Def %F# 6
Def %G- 6
Def %G 7
Def %G# 8
Def %A- 8
Def %A 9
Def %A# 10
Def %B- 10
Def %B 11
Def %B# 12
// Deutsche Schreibweise
Def %H- 10
Def %H 11
Def %H# 12
// Pause
Def %P $FF
Proc writeHex
    Parameters String sHex
    Declare Integer iLen, iByte
    iLen = len(sHex)/2
    WhileLoop 1, iLen
        iByte = val("$" + left$(sHex,2))
        PutByte #1, iByte
        sHex = Del$(sHex,1,2)
    EndWhile
EndProc
Proc writeByte
    Parameters Integer iByte
    PutByte #1, iByte
EndProc
Proc writeWord
    Parameters Integer iWord
    PutByte #1, iWord \ 256
    PutByte #1, iWord mod 256
EndProc
Proc writeLong
    Parameters Integer iLong
    writeWord(HiWord(iLong))
    writeWord(LoWord(iLong))
EndProc
Proc writeChars
    Parameters String sChars
    PutChar #1, sChars
EndProc
Proc Header
    Parameters Integer iTracks, iTempo
    writeChars("MThd")
    writeLong(6)
    writeWord(1)
    writeWord(iTracks)
    writeWord(iTempo)
EndProc
Proc TrackHeader
    Declare Pointer pAnzahl
    writeChars("MTrk")
    pAnzahl = FilePos(#1)
    writeLong(0)
    writeByte(0)
    Return pAnzahl
EndProc
Proc writeDauer
    Parameters Integer D
    // Deltatime in variable Bitlänge (1 oder 2) umwandeln
    // in dieser Fassung bis max. 0 .. 16383
    if D > 127' Deltatime = 2 Bytes
        writeByte(128 + D \ 128)
        writeByte(D mod 128)
    else' Deltatime = 1 Byte
        writeByte(D)
    endif
EndProc
proc note2
    Parameters Integer Note, Okt,Dauer
    Oktave=okt
    Note(Note,Dauer)
endproc
Proc Note
    Parameters Integer Note, Dauer
    Declare Integer Ton, TonDauer, StummDauer
    Ton = 12 * Oktave + Note
    Select Musik
        CaseOf "N" : TonDauer = Dauer * 7 \ 8
        CaseOf "S" : TonDauer = Dauer * 4 \ 8
        CaseOf "L" : TonDauer = Dauer
    EndSelect
    Case Note = %P : TonDauer = 0
    StummDauer = Dauer - TonDauer
    If TonDauer > 0
        writeByte($90 + Kanal)' Note an auf Kanal
        writeByte(Ton)
        writeByte(Anschlag)' Anschlag
        writeDauer(TonDauer)
    EndIf
    writeByte($80 + Kanal)' Note aus auf Kanal
    writeByte(Ton)
    writeByte(0)' Anschlag 0 = stumm
    writeDauer(Stummdauer)' Zeit bis zur nächsten Note
EndProc
Proc Volume
    Parameters Integer Vol
    writeByte($B0 + Kanal)
    writeByte(7)
    writeByte(Vol)
    writeByte(0)
EndProc
Proc Stereo
    Parameters Integer Pos
    writeByte($B0 + Kanal)
    writeByte(10)
    writeByte(Pos)
    writeByte(0)
EndProc
Proc Instrument
    Parameters Integer Instrument
    writeByte($C0 + Kanal)
    writeByte(Instrument)
    writeByte(0)
EndProc
Proc TrackEnd
    Declare Longint TrackEndPos
    WriteHex("FF2F00")
    TrackEndPos = FilePos(#1)
    Return TrackEndPos
EndProc
// Hauptprogramm
// =============
Declare Longint pAnz, lAnzahl, lTrackStart, lTrackEnd
// Globale Einstellungen, die immer für alle folgenden Noten (Note, Pause)
// bis zur nächsten Änderung gelten
Kanal = 0
Anschlag = 127
Oktave = 4
Musik = "N"' Möglich sind "L"egato, "N"ormal, "S"taccato
// Datei anlegen bzw. öffnen, ggf. vorher löschen
Assign #1, "test.mid"
Erase #1
OpenRW #1
// Header schreiben; Parameter Tracks, Tempo (Viertelnoten/Minute)
Header(2,100)
// Track 1
// Trackheader schreiben; Rückgabe Position für Tracklänge in Bytes
pAnz = TrackHeader()
lTrackStart = FilePos(#1)
// Einstellungen
Volume(127)' Lautstärke 127
Stereo(0)' links
Instrument(0)' Piano
// Hier kommt die Musik
// Parameter Note, Dauer (in Ticks: 120 = Viertel, 60 = Achtel, etc.)
Musik = "N"
whileloop 4
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%B,5,40)
    Note2(%D,6,40)
    Note2(%C,6,40)
    Note2(%A,3,10)
    Note2(%A,5,45)
    Note2(%E,4,35)
    Note2(%A,4,35)
    Note2(%C,5,40)
    Note2(%E,5,45)
    Note2(%A,5,30)
    Note2(%E,3,5)
    Note2(%B,5,50)
    Note2(%E,4,30)
    Note2(%G#,4,45)
    Note2(%E,5,35)
    Note2(%G#,5,45)
    Note2(%B,5,30)
    Note2(%A,3,5)
    Note2(%C,6,50)
    Note2(%E,4,30)
    Note2(%A,4,35)
    Note2(%E,5,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,45)
    Note2(%E,6,40)
    Note2(%B,5,40)
    Note2(%D,6,40)
    Note2(%C,6,40)
    Note2(%A,3,5)
    Note2(%A,5,45)
    Note2(%E,4,35)
    Note2(%A,4,50)
    Note2(%C,5,40)
    Note2(%E,5,25)
    Note2(%A,5,40)
    Note2(%E,3,5)
    Note2(%B,5,45)
    Note2(%E,4,35)
    Note2(%G#,4,50)
    Note2(%E,5,40)
    Note2(%C,6,25)
    Note2(%B,5,40)
    Note2(%A,3,5)
    Note2(%A,5,45)
    Note2(%E,4,35)
    Note2(%A,4,35)
    Note2(%B,5,40)
    Note2(%C,6,40)
    Note2(%D,6,40)
    Note2(%C,4,10)
    Note2(%E,6,45)
    Note2(%G,4,30)
    Note2(%C,5,45)
    Note2(%G,5,35)
    Note2(%F,6,45)
    Note2(%E,6,30)
    Note2(%G,3,5)
    Note2(%D,6,50)
    Note2(%G,4,35)
    Note2(%B,4,35)
    Note2(%F,5,45)
    Note2(%E,6,45)
    Note2(%D,6,30)
    Note2(%A,3,5)
    Note2(%C,6,50)
    Note2(%E,4,30)
    Note2(%A,4,45)
    Note2(%E,5,35)
    Note2(%D,6,45)
    Note2(%C,6,30)
    Note2(%E,3,5)
    Note2(%B,5,50)
    Note2(%E,4,25)
    Note2(%E,5,40)
    Note2(%E,5,45)
    Note2(%E,6,35)
    Note2(%E,5,45)
    Note2(%E,6,35)
    Note2(%E,6,40)
    Note2(%E,7,50)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,45)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%B,5,40)
    Note2(%D,6,40)
    Note2(%C,6,30)
    Note2(%A,5,15)
    Note2(%A,3,30)
    Note2(%E,4,35)
    Note2(%A,4,50)
    Note2(%C,5,45)
    Note2(%E,5,25)
    Note2(%A,5,40)
    Note2(%E,3,5)
    Note2(%B,5,45)
    Note2(%E,4,35)
    Note2(%G#,4,50)
    Note2(%E,5,40)
    Note2(%G#,5,25)
    Note2(%B,5,40)
    Note2(%A,3,5)
    Note2(%C,6,45)
    Note2(%E,4,35)
    Note2(%A,4,35)
    Note2(%E,5,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,40)
    Note2(%B,5,40)
    Note2(%D,6,40)
    Note2(%C,6,40)
    Note2(%A,3,10)
    Note2(%A,5,45)
    Note2(%E,4,35)
    Note2(%A,4,35)
    Note2(%C,5,40)
    Note2(%E,5,45)
    Note2(%A,5,30)
    Note2(%E,3,5)
    Note2(%B,5,50)
    Note2(%E,4,35)
    Note2(%G#,4,45)
    Note2(%E,5,35)
    Note2(%C,6,45)
    Note2(%B,5,30)
    Note2(%A,3,5)
    Note2(%A,5,50)
    Note2(%E,4,30)
    Note2(%A,4,40)
    Note2(%C,5,5)
    Note2(%A#,4,5)
    Note2(%C,6,35)
    Note2(%F,5,5)
    Note2(%C,6,25)
    Note2(%G,4,5)
    Note2(%F,5,5)
    Note2(%C,6,5)
    Note2(%G,5,10)
    Note2(%A,5,15)
    Note2(%F,4,5)
    Note2(%C,6,45)
    Note2(%A,4,45)
    Note2(%C,5,70)
    Note2(%F,6,60)
    Note2(%E,6,15)
    Note2(%F,4,5)
    Note2(%E,6,45)
    Note2(%A#,4,35)
    Note2(%D,6,10)
    Note2(%D,5,70)
    Note2(%D,5,5)
    Note2(%A#,6,60)
    Note2(%A,6,10)
    Note2(%F,4,5)
    Note2(%A,6,45)
    Note2(%E,5,5)
    Note2(%G,6,25)
    Note2(%F,6,5)
    Note2(%F,4,5)
    Note2(%G,4,5)
    Note2(%A#,4,25)
    Note2(%E,6,5)
    Note2(%E,5,35)
    Note2(%A#,4,5)
    Note2(%F,4,5)
    Note2(%G,4,5)
    Note2(%D,6,35)
    Note2(%C,6,5)
    Note2(%E,5,35)
    Note2(%A#,5,30)
    Note2(%A,4,40)
    Note2(%A,5,5)
    Note2(%C,5,40)
    Note2(%A,4,30)
    Note2(%A#,5,10)
    Note2(%C,5,5)
    Note2(%A,5,20)
    Note2(%G,5,15)
    Note2(%A,4,5)
    Note2(%A,5,20)
    Note2(%A#,5,15)
    Note2(%F,4,5)
    Note2(%C,6,50)
    Note2(%A,4,40)
    Note2(%C,5,70)
    Note2(%D,6,40)
    Note2(%D#,6,35)
    Note2(%E,4,5)
    Note2(%E,6,50)
    Note2(%A,4,30)
    Note2(%C,5,75)
    Note2(%D,5,5)
    Note2(%D,4,10)
    Note2(%F,6,35)
    Note2(%A,5,5)
    Note2(%F,4,25)
    Note2(%G,4,5)
    Note2(%C,6,50)
    Note2(%E,5,65)
    Note2(%D,6,20)
    Note2(%B,5,5)
    Note2(%C,6,15)
    Note2(%G,4,5)
    Note2(%D,6,10)
    Note2(%C,6,35)
    Note2(%F,5,15)
    Note2(%B,5,15)
    Note2(%C,6,5)
    Note2(%C,5,5)
    Note2(%E,5,25)
    Note2(%G,6,20)
    Note2(%G,5,25)
    Note2(%A,5,20)
    Note2(%G,6,20)
    Note2(%F,5,5)
    Note2(%G,5,5)
    Note2(%B,5,20)
    Note2(%G,6,10)
    Note2(%E,5,5)
    Note2(%G,5,5)
    Note2(%C,6,20)
    Note2(%G,6,10)
    Note2(%D,5,5)
    Note2(%F,5,5)
    Note2(%G,5,5)
    Note2(%D,6,20)
    Note2(%G,6,5)
    Note2(%E,6,35)
    Note2(%G,6,10)
    Note2(%C,7,25)
    Note2(%B,6,10)
    Note2(%F,4,5)
    Note2(%A,4,5)
    Note2(%A,6,20)
    Note2(%G,6,20)
    Note2(%F,6,20)
    Note2(%E,6,10)
    Note2(%G,4,5)
    Note2(%B,4,5)
    Note2(%D,6,20)
    Note2(%G,6,20)
    Note2(%F,6,20)
    Note2(%D,6,15)
    Note2(%C,6,5)
    Note2(%C,5,25)
    Note2(%G,6,20)
    Note2(%G,5,25)
    Note2(%G,6,10)
    Note2(%A,5,30)
    Note2(%G,6,10)
    Note2(%F,5,10)
    Note2(%B,5,15)
    Note2(%G,6,15)
    Note2(%E,5,25)
    Note2(%G,6,10)
    Note2(%D,5,5)
    Note2(%D,6,5)
    Note2(%F,5,15)
    Note2(%G,6,15)
    Note2(%E,6,5)
    Note2(%C,5,5)
    Note2(%E,5,5)
    Note2(%G,5,15)
    Note2(%G,6,25)
    Note2(%C,7,5)
    Note2(%B,6,20)
    Note2(%F,4,5)
    Note2(%A,4,5)
    Note2(%A,6,20)
    Note2(%G,6,20)
    Note2(%F,6,20)
    Note2(%E,6,10)
    Note2(%G,4,5)
    Note2(%B,4,5)
    Note2(%D,6,20)
    Note2(%G,6,20)
    Note2(%F,6,20)
    Note2(%D,6,10)
    Note2(%E,6,5)
    Note2(%B,4,5)
    Note2(%G#,4,25)
    Note2(%F,6,35)
    Note2(%D#,6,35)
    Note2(%B,5,130)
    Note2(%D#,6,20)
    Note2(%E,6,120)
    Note2(%B,5,40)
    Note2(%E,6,40)
    Note2(%D#,6,40)
    Note2(%E,6,120)
    Note2(%B,5,25)
    Note2(%E,6,45)
    Note2(%D#,6,75)
wend
/*
Oktave = 5
Note(%A,120)
Note(%B,120)
Oktave = 6
Note(%C#,60)
Note(%D,60)
Note(%P,120)
Note(%E,120)
Note(%F#,120)
Note(%G#,120)
Note(%A,120)
*/
TrackEnd
lTrackEnd = FilePos(#1)
lAnzahl = lTrackEnd - lTrackStart + 1
Print lAnzahl
Seek #1, pAnz
writeLong(lAnzahl)
// Track 2
// Schreibposition wieder ans Ende setzen
Seek #1, getFileSize(#1)
// Trackheader schreiben; Rückgabe Position für Tracklänge in Bytes
pAnz = TrackHeader()
lTrackStart = FilePos(#1)
// Einstellungen
Kanal = 9' Schlagzeug
Volume(127)' Lautstärke 127
Stereo(127)' rechts
Instrument(25)
Oktave = 3
/*
WhileLoop 4
Note2(%C,3,30)
Note2(%F#,4,30)
Note2(%A#,3,30)
Note2(%F#,4,30)
Note2(%D,3,30)
Note2(%F#,4,30)
Note2(%A#,3,30)
Note2(%F#,4,30)
EndWhile
*/
TrackEnd
lTrackEnd = FilePos(#1)
lAnzahl = lTrackEnd - lTrackStart + 1
Print lAnzahl
Seek #1, pAnz
writeLong(lAnzahl)
Close #1
MCISend$("OPEN test.mid TYPE SEQUENCER ALIAS MIDI")
MCISend$("PLAY MIDI WAIT")
MCISend$("CLOSE MIDI")
Print "Fertig!"
WaitInput
End
 |  
  |  |   |   |  |  |   |  
 
 
  |  
 AntwortenThemenoptionen | 4.604 Betrachtungen |  
 ThemeninformationenDieses Thema hat 3 Teilnehmer:  |