aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-19 23:16:47 +0000
committerDavid Robillard <d@drobilla.net>2007-03-19 23:16:47 +0000
commit9de593d8780ec6fec43703df7a532e65baa44510 (patch)
tree8aea0a26a3ee201ef1bdf3a11995976c4ad4ea0a /util
parent47f59aaad7a5ab8c189905544a761940ae9f8509 (diff)
downloadmachina-9de593d8780ec6fec43703df7a532e65baa44510.tar.gz
machina-9de593d8780ec6fec43703df7a532e65baa44510.tar.bz2
machina-9de593d8780ec6fec43703df7a532e65baa44510.zip
Learn quantization.
RDF serialziation to a C FILE*. Machina graph drawing improvements. git-svn-id: http://svn.drobilla.net/lad/machina@364 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'util')
-rwxr-xr-xutil/machina2dot13
1 files changed, 10 insertions, 3 deletions
diff --git a/util/machina2dot b/util/machina2dot
index e3e420c..726f98a 100755
--- a/util/machina2dot
+++ b/util/machina2dot
@@ -39,7 +39,12 @@ for result in initial_nodes_query.execute(model):
node_durations[node_id] = duration
print "\t{ node [ style = invis ] ",
print "invis%d" % invis_id, " }"
- print '\t', node_id, "[ label = \"d =", duration, "\"];"
+
+ label = "d=%.1f" % duration
+ if result['note']:
+ label += "\\nn=%s" % result['note'].literal_value['string']
+
+ print '\t', node_id, "[ label=\"%s\" ]" % label
print '\t', "invis%d" % invis_id, " -> ", node_id
invis_id += 1
@@ -59,9 +64,11 @@ for result in nodes_query.execute(model):
node_id = result['n'].blank_identifier
duration = float(result['dur'].literal_value['string'])
node_durations[node_id] = duration
- label = "d=%.2f" % duration
+
+ label = "d=%.1f" % duration
if result['note']:
label += "\\nn=%s" % result['note'].literal_value['string']
+
print '\t', node_id, "[ label=\"%s\" ]" % label
@@ -79,6 +86,6 @@ for edge in edge_query.execute(model):
print '\t', edge['tail'].blank_identifier, ' -> ',
print edge['head'].blank_identifier, ' ',
print "[ label = \"%1.2f\"" % float(edge['prob'].literal_value['string']),
- print "minlen = ", node_durations[edge['tail'].blank_identifier] * 2, " ];"
+ print "minlen = ", node_durations[edge['tail'].blank_identifier], " ];"
print "}"