mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-08-09 01:25:00 +00:00
Merge pull request #17 from dschmenk/master
Merge latest upstream changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
#from mido import MidiFile
|
#from mido import MidiFile
|
||||||
@@ -8,7 +8,7 @@ optarg = 1
|
|||||||
timescale = 16.0 # Scale time to 16th of a second
|
timescale = 16.0 # Scale time to 16th of a second
|
||||||
extperchan = 9 # Default to standard MIDI channel 10 for extra percussion
|
extperchan = 9 # Default to standard MIDI channel 10 for extra percussion
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
print 'Usage:', sys.argv[0], '[-p extra_percussion_channel] [-t timescale] MIDI_file'
|
print('Usage:', sys.argv[0], '[-p extra_percussion_channel] [-t timescale] MIDI_file')
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
# Parse optional arguments
|
# Parse optional arguments
|
||||||
while optarg < (len(sys.argv) - 1):
|
while optarg < (len(sys.argv) - 1):
|
||||||
@@ -45,15 +45,15 @@ for msg in mid:
|
|||||||
# Percussion
|
# Percussion
|
||||||
#
|
#
|
||||||
if vol > 0:
|
if vol > 0:
|
||||||
print '\t!BYTE\t${0:02X}, ${1:02X}, ${2:02X}\t; Percussion {3:d} Chan {4:d} Dur {5:d}'.format(deltatime, msg.note ^ 0x40, (lrchan << 7) | vol, msg.note, msg.channel + 1, vol)
|
print('\t!BYTE\t${0:02X}, ${1:02X}, ${2:02X}\t; Percussion {3:d} Chan {4:d} Dur {5:d}'.format(deltatime, msg.note ^ 0x40, (lrchan << 7) | vol, msg.note, msg.channel + 1, vol))
|
||||||
if extperchan == 9: # Play percussion on both channels if no extended percussion
|
if extperchan == 9: # Play percussion on both channels if no extended percussion
|
||||||
print '\t!BYTE\t${0:02X}, ${1:02X}, ${2:02X}\t; Percussion {3:d} Chan {4:d} Dur {5:d}'.format(0, msg.note ^ 0x40, vol, msg.note, msg.channel + 1, vol)
|
print('\t!BYTE\t${0:02X}, ${1:02X}, ${2:02X}\t; Percussion {3:d} Chan {4:d} Dur {5:d}'.format(0, msg.note ^ 0x40, vol, msg.note, msg.channel + 1, vol))
|
||||||
eventtime = 0.0
|
eventtime = 0.0
|
||||||
else:
|
else:
|
||||||
#
|
#
|
||||||
# Note
|
# Note
|
||||||
#
|
#
|
||||||
print '\t!BYTE\t${0:02X}, ${1:02X}, ${2:02X}\t; Note {3:d} Chan {4:d} Vol {5:d}'.format(deltatime, 0x80 | (octave << 4) | onote, (lrchan << 7) | vol, msg.note, msg.channel + 1, vol)
|
print('\t!BYTE\t${0:02X}, ${1:02X}, ${2:02X}\t; Note {3:d} Chan {4:d} Vol {5:d}'.format(deltatime, 0x80 | (octave << 4) | onote, (lrchan << 7) | vol, msg.note, msg.channel + 1, vol))
|
||||||
eventtime = 0.0
|
eventtime = 0.0
|
||||||
elif msg.type == 'set_tempo':
|
elif msg.type == 'set_tempo':
|
||||||
pass
|
pass
|
||||||
@@ -65,4 +65,4 @@ for msg in mid:
|
|||||||
pass
|
pass
|
||||||
elif msg.type == 'program_change':
|
elif msg.type == 'program_change':
|
||||||
pass
|
pass
|
||||||
print '\t!BYTE\t${0:02X}, $00, $00'.format(int(eventtime + 0.5))
|
print('\t!BYTE\t${0:02X}, $00, $00'.format(int(eventtime + 0.5)))
|
||||||
|
@@ -1615,7 +1615,7 @@ def cmdmode#0
|
|||||||
word cmdptr, line
|
word cmdptr, line
|
||||||
|
|
||||||
clrscrn
|
clrscrn
|
||||||
puts("PLASMA Editor, Version 2.0 DALPHA1\n")
|
puts("PLASMA Editor, Version 2.0 ALPHA2\n")
|
||||||
while not exit
|
while not exit
|
||||||
puts(@filename)
|
puts(@filename)
|
||||||
cmdptr = gets($BA)
|
cmdptr = gets($BA)
|
||||||
|
Reference in New Issue
Block a user