import abjad hymn = [ [[5,2],3], [[2,7],1], [[5,2],3], [[7,5],1], [[3,5],10], [[3,5],2], [[4,6],1], [[7,5],2], [[1,6],2], [[2,7],2], [[3,7],1], [[1,6],2], [[2,7],1], [[4,1],1], [[2,4],1], [[3,5],4], [[4,6],1], [[7,5],2], [[1,6],4], [[2,7],1], [[4,1],1], [[7,5],1], [[1,6],4], [[7,5],1], [[1,6],2], [[7,5],1], [[1,6],2], [[2,7],2], [[6,3],2], [[5,2],3], [[6,3],1], [[5,2],4], [[6,3],1], [[5,2],2], ] pitches = {1:"e''",2:"d''",3:"c''",4:"b'",5:"a'",6:"g'",7:"f'",8:"e'",9:"d'"} staff = abjad.Staff() for (interval, duration) in hymn: chord = abjad.Chord([], abjad.Duration(min(duration,8), 4)) staff.append(chord) first_note = abjad.NoteHead(pitches[interval[0]]) chord.note_heads.append(first_note) second_note = abjad.NoteHead(pitches[interval[1]]) chord.note_heads.append(second_note) if interval[0] in (1,2): low_note = abjad.NoteHead(pitches[interval[0]+7]) abjad.tweak(low_note).font_size = -3 chord.note_heads.append(low_note) if interval[1] in (1,2): low_note = abjad.NoteHead(pitches[interval[1]+7]) abjad.tweak(low_note).font_size = -3 chord.note_heads.append(low_note) if duration == 10: abjad.attach(abjad.Tie(), staff[-1]) staff.append(abjad.Chord("2")) abjad.attach(abjad.TimeSignature((33,4)), staff[0]) abjad.attach(abjad.BarLine('|.'), staff[-1]) abjad.show(staff)