+ scherzo_release_note (scherzo, pitch, octave);
+}
+
+static void
+scherzo_press_pedal (scherzo_t *scherzo)
+{
+ int i;
+
+ scherzo->pedal_pressed = 1;
+
+ /* Copy all pressed notes to pedaled notes */
+ for (i = 0; i < scherzo->notes_pressed.num_notes; i++)
+ note_group_add_note (&scherzo->notes_pedaled, scherzo->notes_pressed.notes[i]);
+}
+
+static void
+scherzo_release_pedal (scherzo_t *scherzo)
+{
+ score_note_t *note, *new_note;
+ int i;
+
+ /* Make new notes in score for all pressed notes. */
+ for (i = 0; i < scherzo->notes_pressed.num_notes; i++) {
+ note = scherzo->notes_pressed.notes[i];
+ new_note = score_add_note (note->staff, note->pitch, note->octave, note->duration);
+ scherzo->notes_pressed.notes[i] = new_note;
+ }
+
+ /* Then remove all previously pedaled notes from the score. */
+ for (i = scherzo->notes_pedaled.num_notes - 1; i >=0; i--) {
+ note = scherzo->notes_pedaled.notes[i];
+ score_remove_note (note);
+ note_group_remove_note_at (&scherzo->notes_pedaled, i);
+ }
+
+ scherzo->pedal_pressed = 0;
+
+ scherzo_analyze_chord (scherzo);
+
+ gtk_widget_queue_draw (scherzo->window);