Mercurial > hg > syncopation-dataset
comparison Syncopation models/music_objects.py @ 24:08c298f47917
updated music objects to have a few more "to_string()" methods on the
objects
finished making the iitial version of the midi reading functions
author | christopherh <christopher.harte@eecs.qmul.ac.uk> |
---|---|
date | Sun, 12 Apr 2015 15:40:06 +0100 |
parents | df1e7c378ee0 |
children | 7a1730bbf15a |
comparison
equal
deleted
inserted
replaced
23:df1e7c378ee0 | 24:08c298f47917 |
---|---|
134 self.velocitySequence = rhythmSequence | 134 self.velocitySequence = rhythmSequence |
135 self.noteSequence = None | 135 self.noteSequence = None |
136 | 136 |
137 self.tpq = ticksPerQuarter | 137 self.tpq = ticksPerQuarter |
138 self.qpm = qpmTempo | 138 self.qpm = qpmTempo |
139 self.timeSignature = TimeSignature(timeSignature) | 139 self.timeSignature = timeSignature |
140 self.nextBar = nextBar | 140 self.nextBar = nextBar |
141 self.prevBar = prevBar | 141 self.prevBar = prevBar |
142 | 142 |
143 def get_note_sequence(self): | 143 def get_note_sequence(self): |
144 if self.noteSequence == None: | 144 if self.noteSequence == None: |
200 return int(self.tsString.split('/')[0]) | 200 return int(self.tsString.split('/')[0]) |
201 | 201 |
202 def get_denominator(self): | 202 def get_denominator(self): |
203 return int(self.tsString.split('/')[1]) | 203 return int(self.tsString.split('/')[1]) |
204 | 204 |
205 | 205 def to_string(self): |
206 | 206 return self.tsString |
207 | |
208 |