xi2

a plain text language that compiles to MIDI
git clone https://git.ce9e.org/xi2.git

commit
39dd366b8777fb02fbdd17a5c78a22b2b812dbac
parent
1afa755b98c2e6bfff05ff00d60593d935f67762
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-09-18 14:51
wip

Diffstat

M xi2.py 8 ++++++--

1 files changed, 6 insertions, 2 deletions


diff --git a/xi2.py b/xi2.py

@@ -18,7 +18,7 @@ args = parser.parse_args()
   18    18 def length(data):
   19    19 	data = re.sub('{[^}]*}', '', data)
   20    20 	data = re.sub('\([^\)]*\)', '', data)
   21    -1 	return len(data.split(',')) - 1	
   -1    21 	return len(data.split(',')) - 1
   22    22 
   23    23 f = open(args.infile)
   24    24 lines = f.readlines()
@@ -87,7 +87,11 @@ for s in ll.split('\n\n'):
   87    87 	if len(tracks) == 0: l = 0
   88    88 	else: l = max([len(t) for t in tracks])
   89    89 	for track in s.split('\n'):
   90    -1 		(name, data) = track.split(':', 1)
   -1    90 		try:
   -1    91 			(name, data) = track.split(':', 1)
   -1    92 		except Exception, e:
   -1    93 			print track
   -1    94 			raise e
   91    95 		data = parse(data)
   92    96 		if not tracks.has_key(name):
   93    97 			tracks[name] = [''] * l