Created
February 14, 2022 21:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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