X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=scherzo.c;h=3fcae5cfb9e3e291f367b9cac94726ad6c7f4b7a;hb=2e37869bdeb7a9a6de2b758eb704320e00aae5c3;hp=0b0a97f77e9ed2049f82422d1069300525e0fa39;hpb=1cfc79bb867bfa72e9982b79a65bd353bd120ee9;p=scherzo diff --git a/scherzo.c b/scherzo.c index 0b0a97f..3fcae5c 100644 --- a/scherzo.c +++ b/scherzo.c @@ -585,6 +585,17 @@ note_group_init (void *ctx, note_group_t *group) static void note_group_add_note (note_group_t *group, score_note_t *note) { + int i; + + /* Do nothing if note is already in group. */ + for (i = 0; i < group->num_notes; i++) { + if (group->notes[i]->pitch == note->pitch && + group->notes[i]->octave == note->octave) + { + return; + } + } + group->num_notes++; if (group->num_notes > group->size) {