Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fusion fixes. #918

Merged
merged 3 commits into from
Feb 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- Adjustments to the heuristic for ledger lines to include adjacent notes (see [#862](https://github.com/gregorio-project/gregorio/issues/862)).
- The stem length determination will use the ledger line below the note with the stem (see [#863](https://github.com/gregorio-project/gregorio/issues/863)).
- Made the oriscus orientation dependent on the note that follows. Using `1` will force the ascending oriscus and `0` will force the descending oriscus. The old behavior may be restored by setting the `oriscus-orientation` gabc header to `legacy`. See UPGRADE.md for details (for the change request, see [#774](https://github.com/gregorio-project/gregorio/issues/774) and [#898](https://github.com/gregorio-project/gregorio/issues/898)).

### Added
- Controls for tuning horizontal episema vertical position. See GregorioRef for details (for the change request, see [#872](https://github.com/gregorio-project/gregorio/issues/872)).
Expand Down Expand Up @@ -66,7 +67,6 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
- The space between note and horizontal episema has been tightened for notes at the `c` or `k` height when there is no ledger line. Due to the intricacies of measurement, the system tries to make a best guess as to the existence of the ledger line. If the guess is wrong, you may use the `[hl:n]` and `[ll:n]` notations in gabc to override the guess. See [UPGRADE.md](UPGRADE.md) for details (for the change request, see [#716](https://github.com/gregorio-project/gregorio/issues/716)).
- The custos that might appear immediately before a `<eu>` block is now suppressed by default. This behavior is controlled by the `\greseteolcustosbeforeeuouae` command. See GregorioRef and [UPGRADE.md](UPGRADE.md) for details (for the change request, see [#761](https://github.com/gregorio-project/gregorio/issues/761)).
- Different glyphs will now be used for the liquescent stropha on a line or between lines, if supported by the font. If you prefer the old behavior, use `\grechangeglyph{StrophaAuctaLongtail}{*}{StrophaAucta}` in your TeX file. See [#773](https://github.com/gregorio-project/gregorio/issues/773).
- Made the oriscus orientation dependent on the note that follows. Using `<` will force the ascending oriscus and `>` will force the descending oriscus. The old behavior may be restored by setting the `oriscus-orientation` gabc header to `legacy`. See UPGRADE.md for details (for the change request, see [#774](https://github.com/gregorio-project/gregorio/issues/774)).
- Headers not recognized by gregorio, rather than inducing an error, are now simply accepted by gregorio. Most of the old "standard" headers, like `book` and `manuscript-location`, are now handled in this way and thus are no longer limited to one instance. See GregorioRef for details.
- `mode` will now be converted to Roman numerals in lower case so that it shows up as small capitals using the default `modeline` style. See [UPGRADE.md](UPGRADE.md) for details (for the change request, see [#756](https://github.com/gregorio-project/gregorio/issues/756)).
- `\grecommentary` is now less restrictive about where it occurs and need not occur directly before the score anymore.
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ By default, these are sized one half millimeter larger than their "non-text" cou

### Oriscus orientation

The oriscus orientation (whether it points up or down) is now dependent on the note the follows, even if the note is not directly connected to the oriscus (as it would be in a salicus or a pressus). Appending a `<` to an unconnected oriscus in gabc will force the oriscus to point upwards and `>` will force the oriscus to point downwards.
The oriscus orientation (whether it points up or down) is now dependent on the note the follows, even if the note is not directly connected to the oriscus (as it would be in a salicus or a pressus). Appending a `1` to an unconnected oriscus in gabc will force the oriscus to point upwards and `0` will force the oriscus to point downwards.

Prior to version 4.1, Gregorio automatically oriented the oriscus when it was within a neume, but left the orientation up the user otherwise. If you prefer this behavior, set the `oriscus-orientation` header in gabc to `legacy`. In legacy mode, the orientation of an unconnected oriscus will (by default) point downwards and may be reversed by appending `<` or `>` to the oriscus.

Expand Down
4 changes: 2 additions & 2 deletions contrib/gabc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ syn match gabcAttributeName /^[^:]*:/
syn match gabcAttributeEnd ";"
syn match gabcNoteError "." contained
syn match gabcBasicNote "[a-npA-NP]" contained
syn match gabcAlteration "[\<\>~xy#vVoOwWqQR\-Ss\.+]" contained
syn match gabcAlteration "[\<\>~xy#vVwWqQR\-Ss\.+]" contained
syn match gabcAlteration "_[0-5]*" contained
syn match gabcAlteration "['\.][01]\?" contained
syn match gabcAlteration "[oO'\.][01]\?" contained
syn match gabcAlteration "r[0-5]\?" contained
syn match gabcClef "[cf]b\?[1-5]" contained
syn match gabcTextMarkup "</\?e>" contained
Expand Down
2 changes: 1 addition & 1 deletion fonts/squarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def get_width(glyphName):
S_ORISCUS_SCAPUS = 'OriscusScapus'
S_ORISCUS_SCAPUS_LONGQUEUE = 'OriscusScapusLongqueue'
S_ORISCUS_SCAPUS_OPENQUEUE = 'OriscusScapusOpenqueue'
S_ORISCUS_REVERSUS_SCAPUS = 'OriscusScapusRev'
S_ORISCUS_REVERSUS_SCAPUS = 'OriscusScapusReversus'
S_ORISCUS_REVERSUS_SCAPUS_LONGQUEUE= 'OriscusScapusReversusLongqueue'
S_ORISCUS_REVERSUS_SCAPUS_OPENQUEUE= 'OriscusScapusReversusOpenqueue'
S_UPPER_ORISCUS = 'UpperOriscus'
Expand Down
6 changes: 4 additions & 2 deletions src/gabc/gabc-glyphs-determination.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ static char gregorio_add_note_to_a_glyph(gregorio_glyph_type current_glyph_type,
*end_of_glyph = DET_END_OF_PREVIOUS;
next_glyph_type = G_PES_QUILISMA_QUADRATUM_FIRST_PART;
break;
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_UNDETERMINED:
case S_ORISCUS_SCAPUS_ASCENDENS:
case S_ORISCUS_SCAPUS_DESCENDENS:
if (current_glyph_type == G_PUNCTUM && last_pitch < current_pitch) {
next_glyph_type = G_VIRGA_STRATA;
} else {
Expand Down Expand Up @@ -997,7 +999,7 @@ gregorio_glyph *gabc_det_glyphs_from_notes(gregorio_note *current_note,
switch (current_note->u.note.shape) {
case S_PUNCTUM:
case S_ORISCUS_UNDETERMINED:
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_UNDETERMINED:
case S_QUILISMA:
case S_QUADRATUM:
case S_QUILISMA_QUADRATUM:
Expand Down
18 changes: 17 additions & 1 deletion src/gabc/gabc-notes-determination.l
Original file line number Diff line number Diff line change
Expand Up @@ -1248,8 +1248,24 @@ o {
gregorio_change_shape(current_note, S_ORISCUS_UNDETERMINED,
legacy_oriscus_orientation);
}
o0 {
gregorio_change_shape(current_note, S_ORISCUS_DESCENDENS,
legacy_oriscus_orientation);
}
o1 {
gregorio_change_shape(current_note, S_ORISCUS_ASCENDENS,
legacy_oriscus_orientation);
}
O {
gregorio_change_shape(current_note, S_ORISCUS_SCAPUS,
gregorio_change_shape(current_note, S_ORISCUS_SCAPUS_UNDETERMINED,
legacy_oriscus_orientation);
}
O0 {
gregorio_change_shape(current_note, S_ORISCUS_SCAPUS_ASCENDENS,
legacy_oriscus_orientation);
}
O1 {
gregorio_change_shape(current_note, S_ORISCUS_SCAPUS_DESCENDENS,
legacy_oriscus_orientation);
}
w {
Expand Down
12 changes: 12 additions & 0 deletions src/gabc/gabc-score-determination.y
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ static void determine_oriscus_orientation(gregorio_score *score) {
oriscus->u.note.shape =
S_ORISCUS_DESCENDENS;
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
oriscus->u.note.shape =
S_ORISCUS_SCAPUS_DESCENDENS;
break;
case S_ORISCUS_CAVUM_UNDETERMINED:
oriscus->u.note.shape =
S_ORISCUS_CAVUM_DESCENDENS;
Expand All @@ -596,6 +600,10 @@ static void determine_oriscus_orientation(gregorio_score *score) {
oriscus->u.note.shape =
S_ORISCUS_ASCENDENS;
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
oriscus->u.note.shape =
S_ORISCUS_SCAPUS_ASCENDENS;
break;
case S_ORISCUS_CAVUM_UNDETERMINED:
oriscus->u.note.shape =
S_ORISCUS_CAVUM_ASCENDENS;
Expand All @@ -616,6 +624,7 @@ static void determine_oriscus_orientation(gregorio_score *score) {

switch (note->u.note.shape) {
case S_ORISCUS_UNDETERMINED:
case S_ORISCUS_SCAPUS_UNDETERMINED:
case S_ORISCUS_CAVUM_UNDETERMINED:
oriscus = note;
break;
Expand All @@ -637,6 +646,9 @@ static void determine_oriscus_orientation(gregorio_score *score) {
case S_ORISCUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_DESCENDENS;
break;
case S_ORISCUS_SCAPUS_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_SCAPUS_DESCENDENS;
break;
case S_ORISCUS_CAVUM_UNDETERMINED:
oriscus->u.note.shape = S_ORISCUS_CAVUM_DESCENDENS;
break;
Expand Down
19 changes: 15 additions & 4 deletions src/gabc/gabc-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,16 +515,24 @@ static void gabc_write_gregorio_note(FILE *f, gregorio_note *note,
fprintf(f, "%cV", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_ASCENDENS:
fprintf(f, "%co1", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_DESCENDENS:
fprintf(f, "%co0", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_DEMINUTUS:
fprintf(f, "%co", pitch_letter(note->u.note.pitch));
/* Note: the ASCENDENS, DESCENDENS, or DEMINUTUS is also in the liquescentia */
/* Note: the DEMINUTUS is also in the liquescentia */
break;
case S_ORISCUS_CAVUM_ASCENDENS:
fprintf(f, "%co1r", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_CAVUM_DESCENDENS:
fprintf(f, "%co0r", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_CAVUM_DEMINUTUS:
fprintf(f, "%cor", pitch_letter(note->u.note.pitch));
/* Note: the ASCENDENS, DESCENDENS, or DEMINUTUS is also in the liquescentia */
/* Note: the DEMINUTUS is also in the liquescentia */
break;
case S_QUILISMA:
if (is_quadratum) {
Expand All @@ -545,8 +553,11 @@ static void gabc_write_gregorio_note(FILE *f, gregorio_note *note,
case S_LINEA_PUNCTUM_CAVUM:
fprintf(f, "%cr0", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_SCAPUS:
fprintf(f, "%cO", pitch_letter(note->u.note.pitch));
case S_ORISCUS_SCAPUS_ASCENDENS:
fprintf(f, "%cO1", pitch_letter(note->u.note.pitch));
break;
case S_ORISCUS_SCAPUS_DESCENDENS:
fprintf(f, "%cO0", pitch_letter(note->u.note.pitch));
break;
case S_STROPHA:
case S_STROPHA_AUCTA:
Expand Down
6 changes: 4 additions & 2 deletions src/gregoriotex/gregoriotex-position.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,7 +1613,8 @@ static __inline int compute_fused_shift(const gregorio_glyph *glyph)
* fusible from above */
if (shift < 0 && ((next_is_fused && glyph->u.notes.glyph_type == G_FLEXA)
|| glyph->u.notes.glyph_type == G_PORRECTUS
|| glyph->u.notes.glyph_type == G_PODATUS
|| (glyph->u.notes.glyph_type == G_PODATUS
&& !(glyph->u.notes.liquescentia & L_DEMINUTUS))
|| (previous->u.notes.glyph_type == G_PUNCTUM
&& is_initio_debilis(previous->u.notes.liquescentia)))) {
/* may not be fused from above */
Expand All @@ -1626,7 +1627,8 @@ static __inline int compute_fused_shift(const gregorio_glyph *glyph)
const gregorio_glyph *next_glyph;
case S_ORISCUS_ASCENDENS:
case S_ORISCUS_DESCENDENS:
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_ASCENDENS:
case S_ORISCUS_SCAPUS_DESCENDENS:
next_note = first_note->next;
if (!next_note && (next_glyph = gregorio_next_non_texverb_glyph(glyph))
&& next_glyph->type == GRE_GLYPH
Expand Down
77 changes: 58 additions & 19 deletions src/gregoriotex/gregoriotex-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ SHAPE(OriscusReversusLineTL);
SHAPE(OriscusScapus);
SHAPE(OriscusScapusLongqueue);
SHAPE(OriscusScapusOpenqueue);
SHAPE(OriscusScapusReversus);
SHAPE(OriscusScapusReversusLongqueue);
SHAPE(OriscusScapusReversusOpenqueue);
SHAPE(Pes);
SHAPE(PesQuadratum);
SHAPE(PesQuadratumLongqueue);
Expand All @@ -108,10 +111,10 @@ SHAPE(PesQuilismaQuadratum);
SHAPE(PesQuilismaQuadratumLongqueue);
SHAPE(PesQuilismaQuadratumOpenqueue);
SHAPE(Porrectus);
SHAPE(PorrectusLongqueue);
SHAPE(PorrectusFlexus);
SHAPE(PorrectusFlexusLongqueue);
SHAPE(PorrectusFlexusNobar);
SHAPE(PorrectusLongqueue);
SHAPE(PorrectusNobar);
SHAPE(Punctum);
SHAPE(PunctumAscendens);
Expand Down Expand Up @@ -345,7 +348,8 @@ static const char *compute_glyph_name(const gregorio_glyph *const glyph,
switch (previous_note->u.note.shape) {
case S_ORISCUS_ASCENDENS:
case S_ORISCUS_DESCENDENS:
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_ASCENDENS:
case S_ORISCUS_SCAPUS_DESCENDENS:
fuse_head = FUSE_Lower;
break;
default:
Expand Down Expand Up @@ -397,6 +401,24 @@ static const char *compute_glyph_name(const gregorio_glyph *const glyph,
shape = SHAPE_Oriscus;
}

if (*fuse_tail) {
if (is_fused(glyph->u.notes.liquescentia)) {
if (shape == SHAPE_OriscusScapusReversus
|| shape == SHAPE_OriscusScapusReversusLongqueue
|| shape == SHAPE_OriscusScapusReversusOpenqueue) {
shape = SHAPE_Oriscus;
}
} else {
if (shape == SHAPE_OriscusScapusReversus) {
shape = SHAPE_OriscusScapus;
} else if (shape == SHAPE_OriscusScapusReversusLongqueue) {
shape = SHAPE_OriscusScapusLongqueue;
} else if (shape == SHAPE_OriscusScapusReversusOpenqueue) {
shape = SHAPE_OriscusScapusOpenqueue;
}
}
}

current_note = glyph->u.notes.first_note;
if (is_single_note) {
if (liquescentia == LIQ_Nothing) {
Expand Down Expand Up @@ -486,25 +508,34 @@ static const char *fusible_queued_shape(const gregorio_note *const note,
const char *const base_shape, const char *const longqueue_shape,
const char *const openqueue_shape)
{
const char *name = "";
const char *name = NULL;
if (glyph->u.notes.fuse_to_next_glyph < 0) {
/* queue size depends on the following note if fused down */
if (glyph->u.notes.fuse_to_next_glyph == -1) {
switch (adjusted_queuetype_of(note, note,
glyph->u.notes.fuse_to_next_glyph)) {
case Q_ON_SPACE_BELOW_BOTTOM_LINE:
case Q_ON_BOTTOM_LINE:
bool ambitus_one = (glyph->u.notes.fuse_to_next_glyph == -1);
switch (adjusted_queuetype_of(note, note,
glyph->u.notes.fuse_to_next_glyph)) {
case Q_ON_SPACE_BELOW_BOTTOM_LINE:
if (ambitus_one) {
name = openqueue_shape;
break;
case Q_ON_SPACE_ABOVE_BOTTOM_LINE:
name = base_shape;
break;
case Q_ON_LINE_ABOVE_BOTTOM_LINE:
name = longqueue_shape;
}
/* else fall through */
case Q_ON_SPACE_ABOVE_BOTTOM_LINE:
/* at ambitus one, long and short are swapped becuase the queue where
* the second note is on a space is longer than on a line */
name = ambitus_one? longqueue_shape : base_shape;
break;
case Q_ON_BOTTOM_LINE:
if (ambitus_one) {
name = openqueue_shape;
break;
}
} else {
name = base_shape;
/* else fall through */
case Q_ON_LINE_ABOVE_BOTTOM_LINE:
/* at ambitus one, long and short are swapped becuase the queue where
* the second note is on a line is shorter than on a space */
name = ambitus_one? base_shape : longqueue_shape;
break;
}
} else {
switch (queuetype_of(note)) {
Expand All @@ -518,6 +549,7 @@ static const char *fusible_queued_shape(const gregorio_note *const note,
break;
}
}
gregorio_not_null(name, fusible_queued_shape, return base_shape);
return compute_glyph_name(glyph, name, LG_NONE, true);
}

Expand Down Expand Up @@ -613,9 +645,13 @@ static const char *gregoriotex_determine_note_glyph_name(gregorio_note *note,
case S_QUILISMA:
*type = AT_QUILISMA;
return compute_glyph_name(glyph, SHAPE_Quilisma, LG_NONE, true);
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_ASCENDENS:
return fusible_queued_shape(note, glyph, SHAPE_OriscusScapus,
SHAPE_OriscusScapusLongqueue, SHAPE_OriscusScapusOpenqueue);
case S_ORISCUS_SCAPUS_DESCENDENS:
return fusible_queued_shape(note, glyph, SHAPE_OriscusScapusReversus,
SHAPE_OriscusScapusReversusLongqueue,
SHAPE_OriscusScapusReversusOpenqueue);
case S_STROPHA:
*type = AT_STROPHA;
if (!(note->u.note.liquescentia &
Expand Down Expand Up @@ -828,7 +864,8 @@ const char *gregoriotex_determine_glyph_name(const gregorio_glyph *const glyph,
break;
case S_ORISCUS_ASCENDENS:
case S_ORISCUS_DESCENDENS:
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_ASCENDENS:
case S_ORISCUS_SCAPUS_DESCENDENS:
*type = AT_ORISCUS;
*gtype = T_PESQUASSUS;
shape = quadratum_shape(glyph, SHAPE_PesQuassus,
Expand Down Expand Up @@ -893,7 +930,8 @@ const char *gregoriotex_determine_glyph_name(const gregorio_glyph *const glyph,
ltype = LG_NO_INITIO;
break;

case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_ASCENDENS:
case S_ORISCUS_SCAPUS_DESCENDENS:
*gtype = T_FLEXUS_ORISCUS_SCAPUS;
shape = flexus_shape(glyph, ambitus, SHAPE_FlexusOriscusScapus,
SHAPE_FlexusOriscusScapusLongqueue,
Expand Down Expand Up @@ -2843,7 +2881,8 @@ static void write_glyph(FILE *f, gregorio_syllable *syllable,
case S_ORISCUS_CAVUM_ASCENDENS:
case S_ORISCUS_CAVUM_DESCENDENS:
case S_ORISCUS_CAVUM_DEMINUTUS:
case S_ORISCUS_SCAPUS:
case S_ORISCUS_SCAPUS_ASCENDENS:
case S_ORISCUS_SCAPUS_DESCENDENS:
/* don't change the oriscus */
break;

Expand Down
Loading