Skip to content

Commit

Permalink
Cleaned up music.py files.
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorbaca committed Feb 19, 2024
1 parent 7c70ec9 commit cbfaf47
Show file tree
Hide file tree
Showing 14 changed files with 177 additions and 253 deletions.
5 changes: 2 additions & 3 deletions faberge/sections/02/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,10 +935,9 @@ def vc(m):
staff_padding=5.5,
)
with baca.scope(m.get(71, 89)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.mgroups(o, [9, 10]),
"ff > pp < p",
glue=True,
"ff> pp<p",
)


Expand Down
30 changes: 12 additions & 18 deletions faberge/sections/03/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,9 @@ def fl(m):
with baca.scope(m[8]) as o:
baca.dynamic(o.phead(0), "p")
with baca.scope(m.get(9, 10)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 2]),
"o< mp >o !",
glue=True,
"o< mp>o!",
)
with baca.scope(m.get(11, 12)) as o:
library.swells(o, "mf")
Expand Down Expand Up @@ -358,10 +357,9 @@ def fl(m):
with baca.scope(m[52]) as o:
baca.dynamic(o.phead(0), "p")
with baca.scope(m.get(53, 54)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 2]),
"o< pp >o !",
glue=True,
"o< pp>o!",
)
with baca.scope(m.get(55, 60)) as o:
library.swells(o, "ppp")
Expand Down Expand Up @@ -707,10 +705,9 @@ def perc(cache):
abjad.select.get(baca.select.pheads(o), [0, -1]),
)
with baca.scope(m.get(53, 61)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.mgroups(o, [2, 7]),
"ppp < pp >o !",
glue=True,
"ppp< pp>o!",
)
with baca.scope(m.get(69, 72)) as o:
baca.staff_lines(o.leaf(0), 1)
Expand Down Expand Up @@ -780,10 +777,9 @@ def vn(m):
with baca.scope(m.get(1, 52)) as o:
baca.override.dls_staff_padding(o, 5)
with baca.scope(m.get(37, 52)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.mgroups(o, [8, 8]),
"(ppp) < f > ppp",
glue=True,
"(ppp)< f>ppp",
)
with baca.scope(m.get(53, 68)) as o:
baca.staff_lines(o.leaf(0), 1)
Expand Down Expand Up @@ -878,10 +874,9 @@ def va(m):
with baca.scope(m.get(1, 52)) as o:
baca.override.dls_staff_padding(o, 7)
with baca.scope(m.get(37, 52)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.mgroups(o, [8, 8]),
"(pp) < f > pp",
glue=True,
"(pp)< f>pp",
)
with baca.scope(m.get(23, 52)) as o:
baca.mspanners.scp(
Expand Down Expand Up @@ -960,10 +955,9 @@ def vc(m):
hide_middle_note_heads=True,
)
baca.interpolate_pitches(o, "Eb2", "C2")
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.mgroups(o, [12, 12]),
"(p) < ff >o !",
glue=True,
"(p)< ff>o!",
rleak=True,
)
baca.markup(
Expand Down
16 changes: 8 additions & 8 deletions faberge/sections/04/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,21 +435,21 @@ def vc(m, metadata):
)
baca.glissando(o.tleaves())
runs = abjad.select.runs(o)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[0], [1]),
"o< p >o ! o< p >o !",
"o< p>o !o< p>o !",
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(baca.select.rleak(runs[1]), [1]),
"o< mp >o ! o< mp >o ! o< mp >o ! o< mp >o !",
"o< mp>o !o< mp>o !o< mp>o !o< mp>o !",
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(baca.select.rleak(runs[2]), [1]),
"o< mf >o ! o< mf >o ! o< mf >o !",
"o< mf>o !o< mf>o !o< mf>o !",
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(baca.select.rleak(runs[3]), [1]),
"o< f >o ! o< f >o ! o< f >o !",
"o< f>o !o< f>o !o< f>o !",
)


Expand Down
35 changes: 14 additions & 21 deletions faberge/sections/05/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,9 @@ def fl_cl(cache):
baca.override.dynamic_text_self_alignment_x(o.pleaf(2), -1)
baca.override.dynamic_text_self_alignment_x(o.pleaf(-1), -0.75)
baca.glissando(o.pleaves()[2:], allow_repeats=True)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 2]),
"o< mp >o p > pp",
glue=True,
"o< mp>o p>pp",
)
baca.rspanners.trill(
o.leaves()[:2],
Expand Down Expand Up @@ -375,40 +374,34 @@ def vc(m, metadata):
)
baca.glissando(o.tleaves())
runs = abjad.select.runs(o)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[0], [1]),
"o< mf >o !",
glue=True,
"o< mf>o!",
rleak=True,
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[1], [1]),
"o< mp >o ! o< mp >o !",
glue=True,
"o< mp>o !o< mp>o!",
rleak=True,
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[2], [1]),
"o< p >o !",
glue=True,
"o< p>o!",
rleak=True,
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[3], [1]),
"o< p >o ! o< p >o !",
glue=True,
"o< p>o !o< p>o!",
rleak=True,
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[4], [1]),
"o< pp >o !",
glue=True,
"o< pp>o!",
rleak=True,
)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(runs[5], [1]),
"o< pp >o ! o< pp >o !",
glue=True,
"o< pp>o !o< pp>o!",
rleak=True,
)
with baca.scope(m.leaves()) as o:
Expand Down
20 changes: 8 additions & 12 deletions faberge/sections/06/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ def VC(voice, time_signatures):

def fl(m):
with baca.scope(m.get(1, 2)) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.clparts(o, [1]),
"o< mf >o ! o< mf >o !",
"o< mf>o !o< mf>o!",
(abjad.Tweak(r"- \tweak to-barline ##t"), -1),
glue=True,
rleak=True,
)
baca.pitch(o, "F5")
Expand Down Expand Up @@ -297,10 +296,9 @@ def fl_cl(cache):
baca.override.dynamic_text_self_alignment_x(o.pleaf(2), -1)
baca.override.dynamic_text_self_alignment_x(o.pleaf(-1), -0.75)
baca.glissando(o.pleaves()[2:], allow_repeats=True)
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, len(o) - 2]),
"o< mp >o p > pp",
glue=True,
"o< mp>o p>pp",
)
baca.rspanners.trill(
o.leaves()[:2],
Expand Down Expand Up @@ -427,10 +425,9 @@ def perc(m):

def vn(m):
with baca.scope(m[2]) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 2]),
"p - o< p > pp",
glue=True,
"p o< p>pp",
rleak=True,
)
baca.pitches(
Expand Down Expand Up @@ -464,10 +461,9 @@ def vn(m):

def va(m):
with baca.scope(m[2]) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 2]),
"o< p > pp p",
glue=True,
"o< p> pp+p",
rleak=True,
)
baca.pitches(
Expand Down
15 changes: 6 additions & 9 deletions faberge/sections/07/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,9 @@ def fl_cl(cache):
for name in ["fl", "cl"]:
m = cache[name]
with baca.scope(m[2]) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 2]),
"o< p >o pp > ppp",
glue=True,
"o< p>o pp>ppp",
)
for n in [2, 4]:
with baca.scope(m[n]) as o:
Expand All @@ -326,22 +325,20 @@ def fl_cl(cache):
abjad.Tweak(r"- \tweak bound-details.right.padding 2"),
)
with baca.scope(m[4]) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 2]),
"o< pp >o ppp > pppp",
glue=True,
"o< pp>o ppp>pppp",
)
with baca.scope(m[5]) as o:
baca.espressivo(
o.pheads(),
abjad.Tweak(r"- \tweak X-extent #'(0 . 0)", tag=baca.tags.NOT_PARTS),
)
baca.hairpins.hairpin(
baca.hairpins.exact(
abjad.select.partition_by_counts(
abjad.select.leaves(o.rleaves()), [2], overhang=True
),
"o< mp >o !",
glue=True,
"o< mp>o!",
)


Expand Down
9 changes: 4 additions & 5 deletions faberge/sections/08/music.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,9 @@ def vn(m):
)
for n in [6, 8, 9, 10]:
with baca.scope(m[n]) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 2]),
"p - o< p > pp",
glue=True,
"p o< p>pp",
)
baca.mspanners.scp(
baca.select.lparts(o[-3:], [1, 2]),
Expand Down Expand Up @@ -470,9 +469,9 @@ def va(m):
)
for n in [8, 9, 10]:
with baca.scope(m[n]) as o:
baca.hairpins.hairpin(
baca.hairpins.exact(
baca.select.lparts(o, [1, 1, 1, 1]),
"o< p > pp p",
"o< p> pp p",
)
baca.mspanners.scp(
baca.select.lparts(o[:3], [1, 2]),
Expand Down
Loading

0 comments on commit cbfaf47

Please sign in to comment.