Skip to content

Commit

Permalink
Merge pull request #651 from henryso/fix-650
Browse files Browse the repository at this point in the history
Added a case to handle T_TORCULUS_LIQUESCENS (climacus praepunctis deminutus).
  • Loading branch information
henryso committed Oct 21, 2015
2 parents 049cd5d + c38d205 commit 4044076
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 24 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ As of v3.0.0 this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased][unreleased]
### Fixed
- The spacing of manual in-line custos (`(f+)` in gabc) is now consistent with the spacing of automatic in-line custos (`(z0)` in gabc). See [#642](https://github.com/gregorio-project/gregorio/issues/642).
- Signs on the climacus praepunctis deminutus `(ghgf~)` neume are now positioned correctly. See [#650]((https://github.com/gregorio-project/gregorio/issues/650)


## [4.0.0-rc1] - 2015-10-08
Expand Down
72 changes: 48 additions & 24 deletions src/gregoriotex/gregoriotex-position.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ OFFSET_CASE(InitialVirga);
OFFSET_CASE(SalicusOriscusWide);
OFFSET_CASE(SalicusOriscusOne);

static __inline const char *note_before_last_note_case_ignoring_deminutus(
const gregorio_note *const current_note)
{
if ((current_note->u.note.pitch - current_note->next->u.note.pitch) == 1
|| (current_note->u.note.pitch -
current_note->next->u.note.pitch) == -1) {
if (!current_note->previous || current_note->u.note.pitch -
current_note->previous->u.note.pitch > 1) {
return ConnectedPenultBeforePunctumOne;
} else {
return PenultBeforePunctumOne;
}
} else {
if (!current_note->previous || current_note->u.note.pitch -
current_note->previous->u.note.pitch > 1) {
return ConnectedPenultBeforePunctumWide;
} else {
return PenultBeforePunctumWide;
}
}
}

static __inline const char *note_before_last_note_case(
const gregorio_glyph *const current_glyph,
const gregorio_note *const current_note)
Expand All @@ -92,23 +114,7 @@ static __inline const char *note_before_last_note_case(
&& current_note->next) {
return PenultBeforeDeminutus;
} else {
if ((current_note->u.note.pitch - current_note->next->u.note.pitch) == 1
|| (current_note->u.note.pitch -
current_note->next->u.note.pitch) == -1) {
if (!current_note->previous || current_note->u.note.pitch -
current_note->previous->u.note.pitch > 1) {
return ConnectedPenultBeforePunctumOne;
} else {
return PenultBeforePunctumOne;
}
} else {
if (!current_note->previous || current_note->u.note.pitch -
current_note->previous->u.note.pitch > 1) {
return ConnectedPenultBeforePunctumWide;
} else {
return PenultBeforePunctumWide;
}
}
return note_before_last_note_case_ignoring_deminutus(current_note);
}
}

Expand Down Expand Up @@ -758,25 +764,43 @@ static gregorio_vposition advise_positioning(const gregorio_glyph *const glyph,
break;
}
break;
case T_ANCUS:
case T_ANCUS_LONGQUEUE:
case T_TORCULUS_LIQUESCENS:
done = true;
switch (i) {
case 1:
note->gtex_offset_case = first_note_case(note, glyph);
h_episemus = above_if_h_episemus(note->next);
v_episemus = VPOS_BELOW;
break;
case 2:
note->gtex_offset_case = note_before_last_note_case(glyph, note);
note->gtex_offset_case =
note_before_last_note_case_ignoring_deminutus(note);
h_episemus = VPOS_ABOVE;
v_episemus = VPOS_BELOW;
break;
case 3:
default:
--i;
done = false;
break;
}

if (done) {
break;
}
/* else fallthrough to the next case! */
case T_ANCUS:
case T_ANCUS_LONGQUEUE:
switch (i) {
case 1:
note->gtex_offset_case = first_note_case(note, glyph);
h_episemus = above_if_h_episemus(note->next);
v_episemus = VPOS_BELOW;
break;
case 2:
note->is_upper_note = true;
note->gtex_offset_case = last_note_case(glyph, FinalPunctum, note,
false);
note->gtex_offset_case = note_before_last_note_case(glyph, note);
h_episemus = VPOS_ABOVE;
v_episemus = VPOS_BELOW;
v_episemus = below_if_next_ambitus_allows(note);
break;
default:
note->is_lower_note = true;
Expand Down

0 comments on commit 4044076

Please sign in to comment.