In some cases, when you partially extend or trim a MIDI loop in GarageBand, some notes may
stick (play continuously instead of stopping when they should) on playback. This can happen if the loop contains a sustain pedal effect, which allows notes to sound a bit longer when the effect is employed, such as in a piano loop. This can affect both prerecorded and self-recorded Software Instrument loops.
Loops that contain sustain pedal events use "on" and "off" messages to control when the sustain pedal is used. When a sustain pedal "on" message is sent, all subsequent notes will be prolonged until a sustain pedal "off" message is sent.
However, if you shorten or extend a loop to the point where the sustain "on" message is included but the following sustain "off" message will not play, some notes may stick. The severity of the issue depends on whether the instrument in use has a natural decay (such as with a drum or other percussive instrument loop) or a sound that has the potential to be sustained almost infinitely (such as with string loops or other bowed or blown sounds).
If you need to partially extend or trim a loop, try this workaround:
- To extend a loop, hold down the Option key (this will make a copy of the loop) and drag the loop to the right of the original. To trim a loop, start at step 2.
- Select the copied region (if extending) or the original (if trimming), and open the region editor by clicking the Editor (scissors) button or double-clicking the region.
- If the Advanced pane in the editor isn't displayed, click the disclosure triangle on the right side of the Region header.
- In the Advanced pane, from the top pop-up menu, choose Sustain.
- Locate the needed sustain "off" event, and move it to the left so that it occurs before the point at which you want the loop to end. (You can press Play to watch the playhead move across the events to get a visual idea of where to move it.) This picture shows a sustain event that has had its sustain "off" message trimmed away--it needs to be corrected:

This image shows a proper sustain event:

- In the timeline, drag the bottom right corner of the region to the left to the desired length.