def getchords(self):
if self.chords is None:
self.cs = self.s.chordify()
self.chords = []
for c in self.cs.flat.notesAndRests:
self.chords.append(
map(lambda k: (isinstance(c, chord.Chord) and \
k == chordtoid(c, self.key)) * float(c.quarterLength), range(Dout)))
self.chords = torch.FloatTensor(self.chords)
return self.chords
# for c in sc.cs.flat.notesAndRests:
# if isinstance(c, note.Note):
# c = chord.Chord(c)
# sc.notes.append(map(lambda n: (isinstance(c, chord.Chord) and \
# (n + lstm.pitchtoid(sc.key.tonic)) % 12 in c.normalOrder) * float(c.quarterLength), range(12)))
评论列表
文章目录