Package jazzparser :: Package taggers :: Package segmidi :: Package chordlabel :: Module tools
[hide private]
[frames] | no frames]

Source Code for Module jazzparser.taggers.segmidi.chordlabel.tools

 1  """Interactive shell tools for the chordlabel tagger. 
 2   
 3  """ 
 4  """ 
 5  ============================== License ======================================== 
 6   Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding 
 7    
 8   This file is part of The Jazz Parser. 
 9    
10   The Jazz Parser is free software: you can redistribute it and/or modify 
11   it under the terms of the GNU General Public License as published by 
12   the Free Software Foundation, either version 3 of the License, or 
13   (at your option) any later version. 
14    
15   The Jazz Parser is distributed in the hope that it will be useful, 
16   but WITHOUT ANY WARRANTY; without even the implied warranty of 
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
18   GNU General Public License for more details. 
19    
20   You should have received a copy of the GNU General Public License 
21   along with The Jazz Parser.  If not, see <http://www.gnu.org/licenses/>. 
22   
23  ============================ End license ====================================== 
24   
25  """ 
26  __author__ = "Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>"  
27   
28  from jazzparser.shell.tools import Tool 
29   
30 -class ChordLabelTool(Tool):
31 name = "Chord labeler output tool" 32 commands = [ "chords" ] 33 usage = ('chord', "Show the chords that were assigned to the MIDI input "\ 34 "by the chord labeler") 35 help = """\ 36 Show the chords that were assigned to the MIDI input by the chord labeler 37 module. These were used as input to the supertagger (and parser). 38 39 """ 40
41 - def run(self, args, state):
42 chords = state.tagger.chords 43 for chord in chords: 44 print "%s (%s)" % (chord, chord.duration)
45