--
You received this message because you are subscribed to the Google Groups "abjad-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to abjad-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/abjad-user/654efc79-0a8c-4dc2-9f5f-41f58784456dn%40googlegroups.com.
Hi Luca,
Abjad ignores the “|” symbols in LilyPond input. You can include “|” symbols if you want visual clarity for yourself when you’re typing LilyPond input code, but Abjad ignores them creating notes.
To draw bar lines in LilyPond, ask LilyPond to create time signatures.
To hide time signatures in LilyPond, use \override TimeSignature.stencil = ##f
or \override TimeSignature.transparent = ##t
or an equivalent LilyPond command.
One way to implement your sublists-to-measures pattern in Abjad looks like this:
pitch_lists = [[12, 14], [16, 17, 19], [21]]
staff = abjad.Staff()
note_duration = abjad.Duration((1, 4))
for pitch_list in pitch_lists:
notes = [abjad.Note(pitch, note_duration) for pitch in pitch_list]
measure_duration = len(pitch_list) * note_duration
time_signature = abjad.TimeSignature(measure_duration)
abjad.attach(time_signature, notes[0])
staff.extend(notes)
abjad.override(staff).time_signature.stencil = "##f"
abjad.show(staff)
Do this to see the LilyPond code Abjad makes under the hood:
string = abjad.lilypond(staff)
print(string)
\new Staff
\with
{
\override TimeSignature.stencil = ##f
}
{
\time 1/2
c''4
d''4
\time 3/4
e''4
f''4
g''4
\time 1/4
a''4
}
Trevor.
--
You received this message because you are subscribed to the Google Groups "abjad-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to abjad-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/abjad-user/654efc79-0a8c-4dc2-9f5f-41f58784456dn%40googlegroups.com.
pitch_lists = [[12, 14], [16, 17, 19], [21]]staff = abjad.Staff()note_duration = abjad.Duration((1, 4))for pitch_list in pitch_lists:
notes = [abjad.Note(pitch, note_duration) for pitch in pitch_list]
measure_duration = len(pitch_list) * note_duration time_signature = abjad.TimeSignature(measure_duration) abjad.attach(time_signature, notes[0]) staff.extend(notes)
staff_ = abjad.Staff()for note in staff: if note.written_pitch.number in range(14, 20): staff_.append(note)
>>> staff_Staff("d''4 e''4 f''4 g''4")>>> staffStaff("c''4 a''4")
--You received this message because you are subscribed to the Google Groups "abjad-user" group.To unsubscribe from this group and stop receiving emails from it, send an email to abjad-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/abjad-user/8ba25d43-72ff-40a8-a4c6-70df8cd6e531n%40googlegroups.com.