X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=score.c;fp=score.c;h=ac0d346522715896fc3c2e478a3a215a2b32619e;hb=2e37869bdeb7a9a6de2b758eb704320e00aae5c3;hp=e319af0c238abaf594afee0088bc8c580de6f59e;hpb=1cfc79bb867bfa72e9982b79a65bd353bd120ee9;p=scherzo diff --git a/score.c b/score.c index e319af0..ac0d346 100644 --- a/score.c +++ b/score.c @@ -538,6 +538,18 @@ score_add_note (score_staff_t *staff, { score_note_t *note; double line; + int i; + + /* Return existing note if already present. */ + for (i = 0; i < staff->num_notes; i++) { + note = staff->notes[i]; + if (note->pitch == pitch && + note->octave == octave && + note->duration == duration) + { + return note; + } + } note = talloc (staff, score_note_t); if (note == NULL)