Skip to content

Commit

Permalink
Added support for descending pes oriscus (renamed from virga strata).
Browse files Browse the repository at this point in the history
  • Loading branch information
henryso committed Jan 6, 2017
1 parent 6c46cbd commit d0e5f47
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 92 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
- Translation text in a syllable with a trailing (forced) hyphen is no longer truncated to its first character (see [#1254](https://github.com/gregorio-project/gregorio/issues/1254)).
- A trailing (forced) hyphen in a syllable no longer generates a forced hyphen in the previous syllable (see [#1255](https://github.com/gregorio-project/gregorio/issues/1255)).
- A trailing space on a header line is now ignored (see [#1269](https://github.com/gregorio-project/gregorio/issues/1269)).
- A pes whose second note is an oriscus now obeys the oriscus orientation rules (see [#1272](https://github.com/gregorio-project/gregorio/issues/1272))

## Changed
- Notes are now left-aligned as if all clefs had the same width as the largest clef in the score. You can get previous behavior back with `\grebolshiftcleftype{current}`, or temporary force alignment until the end of a score with `\grelocalbolshiftcleftype`. See Documentation of these functions and [#1189](https://github.com/gregorio-project/gregorio/issues/1189).
Expand Down
11 changes: 6 additions & 5 deletions doc/GregorioRef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,14 @@ local GABC = {
OblatusPesQuassusInusitatusLongqueue = [[h&&&o0j]],
Oriscus = [[g&&&o]], -- for Deminutus
Pes = [[g&&&i]],
PesAscendensOriscus = [[g&&&iO\excluded{/j}]],
PesDescendensOriscus = [[g&&&iO\excluded{/h}]],
PesQuadratum = [[g&&&qi]],
PesQuadratumLongqueue = [[h&&&qj]],
PesQuassus = [[g&&&oi]],
PesQuassusInusitatus = [[g&&&o0i]],
PesQuassusInusitatusLongqueue = [[h&&&o0j]],
PesQuassusLongqueue = [[h&&&oj]],
PesQuilisma = [[g&&&wi]],
PesQuilismaQuadratum = [[g&&&Wi]],
PesQuilismaQuadratumLongqueue = [[h&&&Wj]],
PorrectusFlexus = [[g&&&ege]],
PorrectusFlexusNobar = [[\excluded{e}g&&&ege]],
Porrectus = [[g&&&eg]],
Expand All @@ -227,6 +226,9 @@ local GABC = {
PunctumLineBL = [[\excluded{e}@g&&&]],
PunctumLineTL = [[\excluded{i}@g&&&]],
Quilisma = [[g&&&w]],
QuilismaPes = [[g&&&wi]],
QuilismaPesQuadratum = [[g&&&Wi]],
QuilismaPesQuadratumLongqueue = [[h&&&Wj]],
RoundBraceDown = '[ub:1;6mm]',
RoundBrace = '[ob:1;6mm]',
SalicusFlexus = [[g&&&iOki]],
Expand All @@ -253,7 +255,6 @@ local GABC = {
VirgaReversa = [[g&&&V]],
VirgaReversaLongqueue = [[h&&&V]],
VirgaReversaOpenqueue = [[a&&&V]],
VirgaStrata = [[g&&&iO]],
Virgula = [[^^^^0060]],
}

Expand All @@ -264,7 +265,7 @@ local GABC_AMBITUS_ONE = {
FlexusOriscusScapusOpenqueue = [[b&&&Oa]],
PesQuadratumOpenqueue = [[a&&&qb]],
PesQuassusOpenqueue = [[a&&&ob]],
PesQuilismaQuadratumOpenqueue = [[a&&&Wb]],
QuilismaPesQuadratumOpenqueue = [[a&&&Wb]],
OblatusPesQuassusInusitatusOpenqueue = [[a&&&o0b]],
OblatusPesQuassusOpenqueue = [[b&&&oc]],
}
Expand Down
4 changes: 2 additions & 2 deletions fonts/granapadano-base.sfd
Original file line number Diff line number Diff line change
Expand Up @@ -2304,7 +2304,7 @@ SplineSet
EndSplineSet
EndChar

StartChar: PesQuilismaOneNothing
StartChar: QuilismaPesOneNothing
Encoding: 100 -1 100
Width: 161
Flags: HW
Expand Down Expand Up @@ -2346,7 +2346,7 @@ EndSplineSet
Validated: 1
EndChar

StartChar: PesQuilismaOneNothing#Cavum
StartChar: QuilismaPesOneNothing#Cavum
Encoding: 101 -1 101
Width: 161
Flags: HW
Expand Down
4 changes: 2 additions & 2 deletions fonts/greciliae-base.sfd
Original file line number Diff line number Diff line change
Expand Up @@ -3014,7 +3014,7 @@ SplineSet
EndSplineSet
EndChar

StartChar: PesQuilismaOneNothing
StartChar: QuilismaPesOneNothing
Encoding: 130 -1 130
Width: 166
VWidth: 2496
Expand Down Expand Up @@ -3047,7 +3047,7 @@ SplineSet
EndSplineSet
EndChar

StartChar: PesQuilismaOneNothing#Cavum
StartChar: QuilismaPesOneNothing#Cavum
Encoding: 131 -1 131
Width: 166
VWidth: 2496
Expand Down
4 changes: 2 additions & 2 deletions fonts/gregorio-base.sfd
Original file line number Diff line number Diff line change
Expand Up @@ -2417,7 +2417,7 @@ SplineSet
EndSplineSet
EndChar

StartChar: PesQuilismaOneNothing
StartChar: QuilismaPesOneNothing
Encoding: 107 -1 107
Width: 164
VWidth: 2048
Expand Down Expand Up @@ -2450,7 +2450,7 @@ SplineSet
EndSplineSet
EndChar

StartChar: PesQuilismaOneNothing#Cavum
StartChar: QuilismaPesOneNothing#Cavum
Encoding: 108 -1 108
Width: 164
VWidth: 2048
Expand Down
56 changes: 31 additions & 25 deletions fonts/squarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def main():
virga()
pes()
pes_quadratum()
virga_strata()
pes_oriscus()
flexus()
scandicus()
ancus()
Expand Down Expand Up @@ -559,7 +559,7 @@ def get_width(glyphName):
S_PES_QUADRATUM_OPENQUEUE = 'PesQuadratumOpenqueue'
S_UPPER_PES_QUADRATUM_OPENQUEUE = 'UpperPesQuadratumOpenqueue'
S_LOWER_PES_QUADRATUM_OPENQUEUE = 'LowerPesQuadratumOpenqueue'
S_PES_QUILISMA = 'PesQuilisma'
S_QUILISMA_PES = 'QuilismaPes'
S_PES_QUASSUS = 'PesQuassus'
S_UPPER_PES_QUASSUS = 'UpperPesQuassus'
S_LOWER_PES_QUASSUS = 'LowerPesQuassus'
Expand All @@ -584,9 +584,9 @@ def get_width(glyphName):
S_UPPER_PES_QUASSUS_INUSITATUS_OPENQUEUE = 'UpperPesQuassusInusitatusOpenqueue'
S_LOWER_PES_QUASSUS_INUSITATUS_OPENQUEUE = 'LowerPesQuassusInusitatusOpenqueue'
S_LOWER_OBLATUS_PES_QUASSUS_INUSITATUS_OPENQUEUE = 'LowerOblatusPesQuassusInusitatusOpenqueue'
S_PES_QUILISMA_QUADRATUM = 'PesQuilismaQuadratum'
S_PES_QUILISMA_QUADRATUM_LONGQUEUE = 'PesQuilismaQuadratumLongqueue'
S_PES_QUILISMA_QUADRATUM_OPENQUEUE = 'PesQuilismaQuadratumOpenqueue'
S_QUILISMA_PES_QUADRATUM = 'QuilismaPesQuadratum'
S_QUILISMA_PES_QUADRATUM_LONGQUEUE = 'QuilismaPesQuadratumLongqueue'
S_QUILISMA_PES_QUADRATUM_OPENQUEUE = 'QuilismaPesQuadratumOpenqueue'
S_FLEXUS = 'Flexus'
S_UPPER_FLEXUS = 'UpperFlexus'
S_LOWER_FLEXUS = 'LowerFlexus'
Expand Down Expand Up @@ -617,7 +617,8 @@ def get_width(glyphName):
S_ANCUS = 'Ancus'
S_ANCUS_LONGQUEUE = 'AncusLongqueue'
S_ANCUS_OPENQUEUE = 'AncusOpenqueue'
S_VIRGA_STRATA = 'VirgaStrata'
S_PES_ASCENDENS_ORISCUS = 'PesAscendensOriscus'
S_PES_DESCENDENS_ORISCUS = 'PesDescendensOriscus'
S_SALICUS = 'Salicus'
S_SALICUS_LONGQUEUE = 'SalicusLongqueue'
S_SALICUS_OPENQUEUE = 'SalicusOpenqueue'
Expand Down Expand Up @@ -801,7 +802,7 @@ def draw_line(i, length, height):
S_FLEXUS_ORISCUS_SCAPUS: S_FLEXUS,
S_PES_QUADRATUM: S_FLEXUS,
S_PES_QUASSUS: S_PES_QUADRATUM,
S_PES_QUILISMA_QUADRATUM: S_PES_QUADRATUM,
S_QUILISMA_PES_QUADRATUM: S_PES_QUADRATUM,
S_UPPER_PES_QUADRATUM: S_PES_QUADRATUM,
S_LOWER_PES_QUADRATUM: S_PES_QUADRATUM,
S_UPPER_PES_QUASSUS: S_PES_QUASSUS,
Expand Down Expand Up @@ -1103,9 +1104,9 @@ def pes():
precise_message("pes deminutus")
write_all_pes_deminutus("pesdeminutus", S_PES, L_DEMINUTUS)
precise_message("pes quilisma")
write_all_pes("QuilismaLineTR", S_PES_QUILISMA)
write_all_pes("QuilismaLineTR", S_QUILISMA_PES)
precise_message("pes quilisma deminutus")
write_all_pes_deminutus("QuilismaLineTR", S_PES_QUILISMA, L_DEMINUTUS)
write_all_pes_deminutus("QuilismaLineTR", S_QUILISMA_PES, L_DEMINUTUS)
precise_message("pes quassus deminutus")
write_all_pes_deminutus("AscendensOriscusLineTR", S_PES_QUASSUS, L_DEMINUTUS)
write_all_pes_deminutus("DescendensOriscusLineTR", S_PES_QUASSUS_INUSITATUS,
Expand Down Expand Up @@ -1252,14 +1253,14 @@ def pes_quadratum():
qtype='open')
precise_message("pes quilisma quadratum")
write_all_pes_quadratum("QuilismaLineTR", "VirgaBaseLineBL",
S_PES_QUILISMA_QUADRATUM, stemshape=S_PES_QUILISMA_QUADRATUM,
S_QUILISMA_PES_QUADRATUM, stemshape=S_QUILISMA_PES_QUADRATUM,
qtype='short')
write_all_pes_quadratum("QuilismaLineTR", "VirgaBaseLineBL",
S_PES_QUILISMA_QUADRATUM_LONGQUEUE, stemshape=S_PES_QUILISMA_QUADRATUM,
S_QUILISMA_PES_QUADRATUM_LONGQUEUE, stemshape=S_QUILISMA_PES_QUADRATUM,
qtype='long')
write_pes_quadratum(1, "QuilismaLineTR", "VirgaBaseLineBL",
S_PES_QUILISMA_QUADRATUM_OPENQUEUE,
stemshape=S_PES_QUILISMA_QUADRATUM, qtype='open')
S_QUILISMA_PES_QUADRATUM_OPENQUEUE,
stemshape=S_QUILISMA_PES_QUADRATUM, qtype='open')
precise_message("pes auctus ascendens")
write_all_pes_quadratum("PunctumLineTR", "auctusa2", S_PES_QUADRATUM,
L_ASCENDENS)
Expand All @@ -1273,7 +1274,7 @@ def pes_quadratum():
S_PES_QUASSUS_INUSITATUS, L_ASCENDENS)
precise_message("pes quilisma auctus ascendens")
write_all_pes_quadratum("QuilismaLineTR", "auctusa2",
S_PES_QUILISMA_QUADRATUM, L_ASCENDENS)
S_QUILISMA_PES_QUADRATUM, L_ASCENDENS)
precise_message("pes auctus descendens")
write_all_pes_quadratum("PunctumLineTR", "PunctumAuctusLineBL",
S_PES_QUADRATUM, L_DESCENDENS)
Expand All @@ -1287,7 +1288,7 @@ def pes_quadratum():
S_PES_QUASSUS_INUSITATUS, L_DESCENDENS)
precise_message("pes quilisma auctus descendens")
write_all_pes_quadratum("QuilismaLineTR", "PunctumAuctusLineBL",
S_PES_QUILISMA_QUADRATUM, L_DESCENDENS)
S_QUILISMA_PES_QUADRATUM, L_DESCENDENS)

def fusion_pes_quadratum():
"Makes the fusion pes quadratum."
Expand Down Expand Up @@ -1454,27 +1455,32 @@ def write_pes_quadratum(i, first_glyph, last_glyph, shape, lique=L_NOTHING,
set_width(width)
end_glyph(glyph_name)

def virga_strata():
"Creates the virga strata."
precise_message("virga strata")
write_all_virga_strata("PunctumLineTR", "AscendensOriscusLineBL",
S_VIRGA_STRATA)
def pes_oriscus():
"Creates the pes oriscus."
precise_message("pes oriscus")
write_all_pes_oriscus("PunctumLineTR", "AscendensOriscusLineBL",
S_PES_ASCENDENS_ORISCUS)
write_all_pes_oriscus("PunctumLineTR", "DescendensOriscusLineBL",
S_PES_DESCENDENS_ORISCUS)

def write_all_virga_strata(first_glyph, last_glyph, shape, lique=L_NOTHING,
def write_all_pes_oriscus(first_glyph, last_glyph, shape, lique=L_NOTHING,
i_range=ALL_AMBITUS):
for i in i_range:
write_virga_strata(i, first_glyph, last_glyph, shape, lique)
write_pes_oriscus(i, first_glyph, last_glyph, shape, lique)

def write_virga_strata(i, first_glyph, last_glyph, shape, lique=L_NOTHING):
"Writes the virga strata glyphs."
def write_pes_oriscus(i, first_glyph, last_glyph, shape, lique=L_NOTHING):
"Writes the pes oriscus glyphs."
new_glyph()
glyph_name = '%s%s%s' % (shape, AMBITUS[i], lique)
if copy_existing_glyph(glyph_name):
return
if i == 1:
first_glyph = 'Punctum'
first_width = get_width(first_glyph)
last_glyph = FLATTENED_ORISCUS['AscendensOriscusFlatBottom']
if last_glyph == 'AscendensOriscusLineBL':
last_glyph = FLATTENED_ORISCUS['AscendensOriscusFlatBottom']
elif last_glyph == 'DescendensOriscusLineBL':
last_glyph = FLATTENED_ORISCUS['DescendensOriscusFlatBottom']
else:
first_width = get_width(first_glyph)-get_width('line2')
paste_glyph(first_glyph)
Expand Down
14 changes: 12 additions & 2 deletions src/gabc/gabc-glyphs-determination.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ static char add_note_to_a_glyph(gregorio_glyph_type current_glyph_type,
this_note_starts_new_glyph;
}
break;
case G_VIRGA_STRATA: /* really a pes stratus */
case G_PES_ASCENDENS_ORISCUS:
case G_PES_DESCENDENS_ORISCUS:
if (current_pitch > last_pitch) {
next_glyph_type = G_SALICUS;
} else {
Expand Down Expand Up @@ -279,9 +280,18 @@ static char add_note_to_a_glyph(gregorio_glyph_type current_glyph_type,
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
case S_ORISCUS_SCAPUS_ASCENDENS:
if (current_glyph_type == G_PUNCTUM && last_pitch < current_pitch) {
next_glyph_type = G_PES_ASCENDENS_ORISCUS;
/* Therefore G_PES_ASCENDENS_ORISCUS might be fronting an
* undetermined oriscus scapus. This will be resolved during
* oriscus orientation determination */
} else {
this_note_starts_new_glyph;
}
break;
case S_ORISCUS_SCAPUS_DESCENDENS:
if (current_glyph_type == G_PUNCTUM && last_pitch < current_pitch) {
next_glyph_type = G_VIRGA_STRATA;
next_glyph_type = G_PES_DESCENDENS_ORISCUS;
} else {
this_note_starts_new_glyph;
}
Expand Down
61 changes: 41 additions & 20 deletions src/gabc/gabc-score-determination.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,25 +207,34 @@ bool gabc_check_infos_integrity(gregorio_score *score_to_check)
return true;
}

/* data must be (gregorio_note **) */
typedef struct {
gregorio_note *note;
gregorio_glyph *glyph;
} oriscus_orientation_vars;

/* data must be (oriscus_orientation_vars *) */
static void oriscus_orientation_visit(
const gregorio_note_iter_position *const p, void *const data)
{
gregorio_note *const note = p->note;
gregorio_note **const oriscus_ptr = (gregorio_note **const)data;
gregorio_note *const oriscus = *oriscus_ptr;
/* making oriscus const ensures we don't attempt to change *oriscus_ptr
* via oriscus */
oriscus_orientation_vars *const oriscus =
(oriscus_orientation_vars *const)data;

if (oriscus) {
if (note->u.note.pitch <= oriscus->u.note.pitch) {
if (oriscus->note && oriscus->glyph) {
if (note->u.note.pitch <= oriscus->note->u.note.pitch) {
/* descending or unison */
switch(oriscus->u.note.shape) {
switch(oriscus->note->u.note.shape) {
case S_ORISCUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_DESCENDENS;
oriscus->note->u.note.shape = S_ORISCUS_DESCENDENS;
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_SCAPUS_DESCENDENS;
oriscus->note->u.note.shape = S_ORISCUS_SCAPUS_DESCENDENS;
gregorio_assert_only(oriscus->glyph->u.notes.glyph_type
!= G_PES_DESCENDENS_ORISCUS, oriscus_orientation_visit,
"glyph type should not be G_PES_DESCENDENS_ORISCUS");
if (oriscus->glyph->u.notes.glyph_type == G_PES_ASCENDENS_ORISCUS) {
oriscus->glyph->u.notes.glyph_type = G_PES_DESCENDENS_ORISCUS;
}
break;
default:
/* not reachable unless there's a
Expand All @@ -236,12 +245,15 @@ static void oriscus_orientation_visit(
/* LCOV_EXCL_STOP */
}
} else { /* ascending */
switch(oriscus->u.note.shape) {
switch(oriscus->note->u.note.shape) {
case S_ORISCUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_ASCENDENS;
oriscus->note->u.note.shape = S_ORISCUS_ASCENDENS;
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_SCAPUS_ASCENDENS;
oriscus->note->u.note.shape = S_ORISCUS_SCAPUS_ASCENDENS;
gregorio_assert_only(oriscus->glyph->u.notes.glyph_type
!= G_PES_DESCENDENS_ORISCUS, oriscus_orientation_visit,
"glyph type should not be G_PES_DESCENDENS_ORISCUS");
break;
default:
/* not reachable unless there's a
Expand All @@ -252,13 +264,15 @@ static void oriscus_orientation_visit(
/* LCOV_EXCL_STOP */
}
}
*oriscus_ptr = NULL;
oriscus->note = NULL;
oriscus->glyph = NULL;
}

switch (note->u.note.shape) {
case S_ORISCUS_UNDETERMINED:
case S_ORISCUS_SCAPUS_UNDETERMINED:
*oriscus_ptr = note;
oriscus->note = note;
oriscus->glyph = p->glyph;
break;

default:
Expand All @@ -268,19 +282,26 @@ static void oriscus_orientation_visit(

void gabc_determine_oriscus_orientation(const gregorio_score *const score)
{
gregorio_note *oriscus = NULL;
oriscus_orientation_vars oriscus = { NULL, NULL };

gregorio_for_each_note(score, oriscus_orientation_visit, NULL,
GRESTRUCT_NONE, &oriscus);

if (oriscus) {
if (oriscus.note && oriscus.glyph) {
/* oriscus at the end of the score */
switch(oriscus->u.note.shape) {
switch(oriscus.note->u.note.shape) {
case S_ORISCUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_DESCENDENS;
oriscus.note->u.note.shape = S_ORISCUS_DESCENDENS;
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_SCAPUS_DESCENDENS;
oriscus.note->u.note.shape = S_ORISCUS_SCAPUS_DESCENDENS;
gregorio_assert_only(oriscus.glyph->u.notes.glyph_type
!= G_PES_DESCENDENS_ORISCUS,
gabc_determine_oriscus_orientation,
"glyph type should not be G_PES_DESCENDENS_ORISCUS");
if (oriscus.glyph->u.notes.glyph_type == G_PES_ASCENDENS_ORISCUS) {
oriscus.glyph->u.notes.glyph_type = G_PES_DESCENDENS_ORISCUS;
}
break;
default:
/* not reachable unless there's a programming error */
Expand Down
Loading

0 comments on commit d0e5f47

Please sign in to comment.