Commit 62168d20 authored by PoroCYon's avatar PoroCYon
Browse files

[clinkster] make converter portable

parent 718ba6f4
#!/usr/bin/env python #!/usr/bin/env python2
import sys import sys
import zipfile import zipfile
import XML import clinksterxml
import struct import struct
import ctypes import ctypes
import math import math
...@@ -325,8 +325,8 @@ class Music: ...@@ -325,8 +325,8 @@ class Music:
inst.__dict__[wave] = wmap[inst.__dict__[wave]] inst.__dict__[wave] = wmap[inst.__dict__[wave]]
# Instrument data # Instrument data
self.out += "\n\n\tsection instdata data align=1\n" self.out += "\n\n\tSECT_DATA(instdata) align=1\n"
self.out += "\n_InstrumentData:\n" self.out += "\nInstrumentData:\n"
for ti,track in enumerate(self.tracks): for ti,track in enumerate(self.tracks):
track_volume = track.volume * self.master_volume * makeVolume(32.0) track_volume = track.volume * self.master_volume * makeVolume(32.0)
if self.n_delay_tracks > 0 and ti == self.n_delay_tracks: if self.n_delay_tracks > 0 and ti == self.n_delay_tracks:
...@@ -369,13 +369,13 @@ class Music: ...@@ -369,13 +369,13 @@ class Music:
self.dataline([-1]) self.dataline([-1])
# Positions of notes # Positions of notes
self.out += "\n\tsection notepos data align=1\n" self.out += "\n\tSECT_DATA(notepos) align=1\n"
self.out += "\n_NotePositions:\n" self.out += "\nNotePositions:\n"
self.notelist(self.posdata, []) self.notelist(self.posdata, [])
# Samples for notes # Samples for notes
self.out += "\n\tsection notesamp data align=1\n" self.out += "\n\tSECT_DATA(notesamp) align=1\n"
self.out += "\n_NoteSamples:\n" self.out += "\nNoteSamples:\n"
self.notelist(self.samdata, [-1]) self.notelist(self.samdata, [-1])
return self.out return self.out
...@@ -491,7 +491,7 @@ def makeTracks(version, xsong, ticklength): ...@@ -491,7 +491,7 @@ def makeTracks(version, xsong, ticklength):
instrument = Instrument(ii, str(xinst.Name), params) instrument = Instrument(ii, str(xinst.Name), params)
instrument.volume = makeVolume(instplugins(xinst).Volume) instrument.volume = makeVolume(instplugins(xinst).Volume)
instruments.append(instrument) instruments.append(instrument)
else: else:
instruments.append(None) instruments.append(None)
...@@ -532,14 +532,14 @@ def makeTracks(version, xsong, ticklength): ...@@ -532,14 +532,14 @@ def makeTracks(version, xsong, ticklength):
raise InputException("Track '%s' uses undefined instrument (%d)" % (tname, note.instr)); raise InputException("Track '%s' uses undefined instrument (%d)" % (tname, note.instr));
if note.instr not in track_instrs: if note.instr not in track_instrs:
track_instrs.append(note.instr) track_instrs.append(note.instr)
for instr in track_instrs: for instr in track_instrs:
track = Track(tr, tname, notes, volume, instr, instruments) track = Track(tr, tname, notes, volume, instr, instruments)
if isactive(xdevices.DelayDevice): if isactive(xdevices.DelayDevice):
delay_tracks.append(track) delay_tracks.append(track)
else: else:
non_delay_tracks.append(track) non_delay_tracks.append(track)
delay_lengths,delay_strength = pickupDelay(xdevices, delay_lengths, delay_strength, tname, ticklength) delay_lengths,delay_strength = pickupDelay(xdevices, delay_lengths, delay_strength, tname, ticklength)
for xtrack in xsong.Tracks.SequencerSendTrack: for xtrack in xsong.Tracks.SequencerSendTrack:
...@@ -638,7 +638,7 @@ if len(sys.argv) < 3: ...@@ -638,7 +638,7 @@ if len(sys.argv) < 3:
infile = sys.argv[1] infile = sys.argv[1]
outfile = sys.argv[2] outfile = sys.argv[2]
x = XML.makeXML(zipfile.ZipFile(infile).read("Song.xml")) x = clinksterxml.makeXML(zipfile.ZipFile(infile).read("Song.xml"))
try: try:
music = makeMusic(x.RenoiseSong) music = makeMusic(x.RenoiseSong)
print print
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment