Skip to content

Commit

Permalink
Implemented '@' in gabc for neume fusion and no-bar shapes.
Browse files Browse the repository at this point in the history
Part of the implementation for gregorio-project#679, gregorio-project#687, and gregorio-project#692.
  • Loading branch information
henryso committed Dec 14, 2015
1 parent fc3a164 commit 960116e
Show file tree
Hide file tree
Showing 9 changed files with 511 additions and 293 deletions.
23 changes: 10 additions & 13 deletions src/gabc/gabc-glyphs-determination.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@ gregorio_glyph *gabc_det_glyphs_from_notes(gregorio_note *current_note,

/* a char representing the liquescentia of the current glyph */
gregorio_liquescentia liquescentia = L_NO_LIQUESCENTIA;
gregorio_liquescentia head_liquescentia;

if (current_note == NULL) {
return NULL;
Expand Down Expand Up @@ -774,23 +775,19 @@ gregorio_glyph *gabc_det_glyphs_from_notes(gregorio_note *current_note,
continue;
}

/*
* first we do what must be done with liquescentia
*/
if (is_initio_debilis(current_note->u.note.liquescentia)) {
/*
* meaning that the note is an initio debilis, maybe more
*/
/* first we do what must be done with liquescentia */
head_liquescentia = current_note->u.note.liquescentia
& (L_INITIO_DEBILIS | L_FUSED);
if (head_liquescentia) {
/* initio debilis or fused */
if (current_glyph_type != G_UNDETERMINED) {
/*
* if it is not the first glyph
*/
/* if it is not the first glyph */
close_glyph(&last_glyph, current_glyph_type,
&current_glyph_first_note,
liquescentia, current_note->previous);
current_glyph_type = G_UNDETERMINED;
}
liquescentia = L_INITIO_DEBILIS;
liquescentia = head_liquescentia;
}

next_glyph_type =
Expand Down Expand Up @@ -824,7 +821,7 @@ gregorio_glyph *gabc_det_glyphs_from_notes(gregorio_note *current_note,
/*
* we deal with liquescentia
*/
if (is_liquescentia(current_note->u.note.liquescentia)) {
if (is_tail_liquescentia(current_note->u.note.liquescentia)) {
/* special cases of oriscus auctus, treated like normal oriscus
* in some cases. */
if (current_note->u.note.shape == S_ORISCUS_AUCTUS
Expand Down Expand Up @@ -911,7 +908,7 @@ gregorio_glyph *gabc_det_glyphs_from_notes(gregorio_note *current_note,
liquescentia = L_NO_LIQUESCENTIA;
last_pitch = USELESS_VALUE;
/* we deal with liquescentia */
if (is_liquescentia(current_note->u.note.liquescentia))
if (is_tail_liquescentia(current_note->u.note.liquescentia))
/* not an initio debilis, because we considered it in the first
* part... */
{
Expand Down
10 changes: 7 additions & 3 deletions src/gabc/gabc-notes-determination.l
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,10 @@ r5 {
lex_add_note(1, punctum(gabc_notes_determination_text[1]), _NO_SIGN,
L_INITIO_DEBILIS);
}
@[a-mA-M] {
lex_add_note(1, punctum(gabc_notes_determination_text[1]), _NO_SIGN,
L_FUSED);
}
\'[01]? {
add_sign(_V_EPISEMA);
}
Expand All @@ -634,13 +638,13 @@ _[0-5]* {
add_sign(_PUNCTUM_MORA);
}
~ {
gregorio_add_liquescentia(current_note, L_DEMINUTUS);
gregorio_add_tail_liquescentia(current_note, L_DEMINUTUS);
}
> {
gregorio_add_liquescentia(current_note, L_AUCTUS_DESCENDENS);
gregorio_add_tail_liquescentia(current_note, L_AUCTUS_DESCENDENS);
}
\< {
gregorio_add_liquescentia(current_note, L_AUCTUS_ASCENDENS);
gregorio_add_tail_liquescentia(current_note, L_AUCTUS_ASCENDENS);
}
q {
gregorio_change_shape(current_note, S_QUADRATUM);
Expand Down
20 changes: 9 additions & 11 deletions src/gabc/gabc-write.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,16 @@ static void gabc_print_char(FILE *f, grewchar to_print)

static void gabc_write_end_liquescentia(FILE *f, char liquescentia)
{
if (liquescentia == L_NO_LIQUESCENTIA) {
return;
}
if (liquescentia == L_DEMINUTUS
|| liquescentia == L_DEMINUTUS_INITIO_DEBILIS) {
switch (liquescentia & TAIL_LIQUESCENTIA_MASK) {
case L_DEMINUTUS:
fprintf(f, "~");
}
if (liquescentia == L_AUCTUS_ASCENDENS
|| liquescentia == L_AUCTUS_ASCENDENS_INITIO_DEBILIS) {
break;
case L_AUCTUS_ASCENDENS:
fprintf(f, "<");
}
if (liquescentia == L_AUCTUS_DESCENDENS
|| liquescentia == L_AUCTUS_DESCENDENS_INITIO_DEBILIS) {
break;
case L_AUCTUS_DESCENDENS:
fprintf(f, ">");
break;
}
}

Expand Down Expand Up @@ -655,6 +651,8 @@ static void gabc_write_gregorio_glyph(FILE *f, gregorio_glyph *glyph)
case GRE_GLYPH:
if (is_initio_debilis(glyph->u.notes.liquescentia)) {
fprintf(f, "-");
} else if (is_fused(glyph->u.notes.liquescentia)) {
fprintf(f, "@");
}

current_note = glyph->u.notes.first_note;
Expand Down
4 changes: 3 additions & 1 deletion src/gregoriotex/gregoriotex-position.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,8 +1303,10 @@ void gregoriotex_compute_positioning(const gregorio_element *element)
if (glyph->type == GRE_GLYPH) {
gregorio_note *note;
i = 0;
/* We only want type from this call, so use 0 for fuse
* parameters */
gregoriotex_determine_glyph_name(glyph, element, &ignored,
&type);
&type, 0, 0);
for (note = glyph->u.notes.first_note; note;
note = note->next) {
if (note->type == GRE_NOTE) {
Expand Down
Loading

0 comments on commit 960116e

Please sign in to comment.