Skip to content

Instantly share code, notes, and snippets.

@eodowd
Created February 14, 2022 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eodowd/1f27edf0752c55890f193b2665445ff0 to your computer and use it in GitHub Desktop.
Save eodowd/1f27edf0752c55890f193b2665445ff0 to your computer and use it in GitHub Desktop.
A simple python script to convert TX16wx configured maps to decent sampler format
import xml.etree.ElementTree as ET
tree = ET.parse('mk2_.xml')##the name of the document you want to convert
root = tree.getroot()
ns = {'tx': 'http://www.tx16wx.com/3.0/program'}
for i in range(1, 127):
for name in root.iterfind('tx:group['+str(i)+']', ns):
for i in range(1, 127):
for names in name.iterfind('tx:region['+str(i)+']',ns):
els = list(names[0].attrib.values())
sam = ET.Element('sample')
sam.set('loNote',str(els[1]))
sam.set('hiNote', str(els[1]))
sam.set('rootNote', str(els[1]))
sam.set('hiVel', str(els[0]))
sam.set('loVel', str(els[2]))
sam.set('path', "")
print(ET.dump(sam))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment