Commit 50214728 authored by PoroCYon's avatar PoroCYon
Browse files

make converter code portable

parent a51a2497
#!/usr/bin/env python
#!/usr/bin/env python2
import sys
import zipfile
import XML
import oidosxml
import struct
import ctypes
import math
......@@ -483,8 +483,8 @@ class Music:
self.out += "\n%define USES_PANNING\n"
# Instrument parameters
self.out += "\n\n\tsection iparam data align=4\n"
self.out += "\n_InstrumentParams:\n"
self.out += "\n\n\tSECT_DATA(iparam) align=4\n"
self.out += "\nInstrumentParams:\n"
for instr in self.instruments:
self.label(".i%02d" % instr.number)
self.comment(instr.title)
......@@ -502,8 +502,8 @@ class Music:
self.out += "\n"
# Instrument tones
self.out += "\n\n\tsection itones data align=1\n"
self.out += "\n_InstrumentTones:\n"
self.out += "\n\n\tSECT_DATA(itones) align=1\n"
self.out += "\nInstrumentTones:\n"
for instr in self.instruments:
self.label(".i%02d" % instr.number)
self.comment(instr.title)
......@@ -516,8 +516,8 @@ class Music:
self.out += "%d\n" % (-129 + instr.columns)
# Track data
self.out += "\n\n\tsection trdata data align=1\n"
self.out += "\n_TrackData:\n"
self.out += "\n\n\tSECT_DATA(trdata) align=1\n"
self.out += "\nTrackData:\n"
for ti in self.track_order:
track = self.tracks[ti]
instr = self.instrument_map[track.instr]
......@@ -537,13 +537,13 @@ class Music:
self.dataline(tavdata)
# Lengths of notes
self.out += "\n\tsection notelen data align=1\n"
self.out += "\n_NoteLengths:\n"
self.out += "\n\tSECT_DATA(notelen) align=1\n"
self.out += "\nNoteLengths:\n"
self.notelist(self.lendata, [0], "L_")
# 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, [], "S_")
return self.out
......@@ -912,7 +912,7 @@ if len(files) != 2:
infile = files[0]
outfile = files[1]
x = XML.makeXML(zipfile.ZipFile(infile).read("Song.xml"))
x = oidosxml.makeXML(zipfile.ZipFile(infile).read("Song.xml"))
try:
music = makeMusic(x.RenoiseSong)
print
......
#!/usr/bin/env python
#!/usr/bin/env python2
import sys
import zipfile
import XML
import oidosxml
import re
import math
import base64
......@@ -85,13 +85,13 @@ outfile = sys.argv[2]
zfile = zipfile.ZipFile(infile)
if infile.endswith(".xrns"):
info = zfile.getinfo("Song.xml")
x = XML.makeXML(zfile.read(info))
x = oidosxml.makeXML(zfile.read(info))
upgradeInstruments(x.RenoiseSong.Instruments.Instrument, None)
upgradeReverbs(x.RenoiseSong.Tracks.SequencerTrack)
upgradeReverbs(x.RenoiseSong.Tracks.SequencerSendTrack)
elif infile.endswith(".xrni"):
info = zfile.getinfo("Instrument.xml")
x = XML.makeXML(zfile.read(info))
x = oidosxml.makeXML(zfile.read(info))
upgradeInstruments(x.RenoiseInstrument, infile[infile.rfind('/')+1:-5])
else:
print "Unknown file extension: " + infile
......
#!/usr/bin/env python
import xml.dom
import xml.dom.minidom
......@@ -89,3 +88,4 @@ def readXML(filename):
def makeXML(xstring):
return XML([xml.dom.minidom.parseString(xstring)])
#!/usr/bin/env python
#!/usr/bin/env python2
from distutils.core import setup
import py2exe, sys, os
......
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