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 zipfile
import XML
import clinksterxml
import struct
import ctypes
import math
......@@ -325,8 +325,8 @@ class Music:
inst.__dict__[wave] = wmap[inst.__dict__[wave]]
# Instrument data
self.out += "\n\n\tsection instdata data align=1\n"
self.out += "\n_InstrumentData:\n"
self.out += "\n\n\tSECT_DATA(instdata) align=1\n"
self.out += "\nInstrumentData:\n"
for ti,track in enumerate(self.tracks):
track_volume = track.volume * self.master_volume * makeVolume(32.0)
if self.n_delay_tracks > 0 and ti == self.n_delay_tracks:
......@@ -369,13 +369,13 @@ class Music:
self.dataline([-1])
# Positions of notes
self.out += "\n\tsection notepos data align=1\n"
self.out += "\n_NotePositions:\n"
self.out += "\n\tSECT_DATA(notepos) align=1\n"
self.out += "\nNotePositions:\n"
self.notelist(self.posdata, [])
# Samples for notes
self.out += "\n\tsection notesamp data align=1\n"
self.out += "\n_NoteSamples:\n"
self.out += "\n\tSECT_DATA(notesamp) align=1\n"
self.out += "\nNoteSamples:\n"
self.notelist(self.samdata, [-1])
return self.out
......@@ -491,7 +491,7 @@ def makeTracks(version, xsong, ticklength):
instrument = Instrument(ii, str(xinst.Name), params)
instrument.volume = makeVolume(instplugins(xinst).Volume)
instruments.append(instrument)
else:
instruments.append(None)
......@@ -532,14 +532,14 @@ def makeTracks(version, xsong, ticklength):
raise InputException("Track '%s' uses undefined instrument (%d)" % (tname, note.instr));
if note.instr not in track_instrs:
track_instrs.append(note.instr)
for instr in track_instrs:
track = Track(tr, tname, notes, volume, instr, instruments)
if isactive(xdevices.DelayDevice):
delay_tracks.append(track)
else:
non_delay_tracks.append(track)
delay_lengths,delay_strength = pickupDelay(xdevices, delay_lengths, delay_strength, tname, ticklength)
for xtrack in xsong.Tracks.SequencerSendTrack:
......@@ -638,7 +638,7 @@ if len(sys.argv) < 3:
infile = sys.argv[1]
outfile = sys.argv[2]
x = XML.makeXML(zipfile.ZipFile(infile).read("Song.xml"))
x = clinksterxml.makeXML(zipfile.ZipFile(infile).read("Song.xml"))
try:
music = makeMusic(x.RenoiseSong)
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