diff options
author | Grissess <grissess@nexusg.org> | 2016-04-20 04:13:13 -0400 |
---|---|---|
committer | Grissess <grissess@nexusg.org> | 2016-04-20 04:13:13 -0400 |
commit | b6ab9fcbec899e345d81554d60111e95cf9ce466 (patch) | |
tree | 4ac78652f854100f2203b80279a6fdee897b3d35 /shiv.py | |
parent | 5192480ed1022f8365fe25245933fd6b553970c4 (diff) |
Bugfixes, graphics, and new generators
Diffstat (limited to 'shiv.py')
-rw-r--r-- | shiv.py | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -42,3 +42,39 @@ for fname in args: print 'File :', fname print '\t<computing...>' + if options.meta: + print 'Metatrack:', + meta = iv.find('./meta') + if meta: + print 'exists' + print '\tBPM track:', + bpms = meta.find('./bpms') + if bpms: + print 'exists' + for elem in bpms.iterfind('./bpm'): + print '\t\tAt ticks {}, time {}: {} bpm'.format(elem.get('ticks'), elem.get('time'), elem.get('bpm')) + + if not (options.number or options.groups or options.notes or options.histogram or options.histogram_tracks or options.duration or options.duty_cycle): + continue + + streams = iv.findall('./streams/stream') + notestreams = [s for s in streams if s.get('type') == 'ns'] + if options.number: + print 'Stream count:' + print '\tNotestreams:', len(notestreams) + print '\tTotal:', len(streams) + + if not (options.groups or options.notes or options.histogram or options.histogram_tracks or options.duration or options.duty_cycle): + continue + + if options.groups: + groups = {} + for s in notestreams: + group = s.get('group', '<anonymous') + groups[group] = groups.get(group, 0) + 1 + print 'Groups:' + for name, cnt in groups.iteritems(): + print '\t{} ({} streams)'.format(name, cnt) + + if not (options.notes or options.histogram or options.histogram_tracks or options.duration or options.duty_cycle): + continue |