# Software Update: Sustained notes and sustain pedal across active channel changes

**URL:** <https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794>\
**Category:** Software Updates\
**Created:** [February 11, 2020, 3:26am UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794 "2020-02-11T03:26:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [February 11, 2020, 3:26am UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/1 "2020-02-11T03:26:20Z")

</div>

Hi @zynthianers!

I just solved an old and complex issue:

> <https://github.com/zynthian/zyncoder/issues/14>
>
> I am running in Single Channel Mode and have a Pianoteq layer on channel 1 and a zynaddsubfx on channel2.
> When I...

I’ve added a mechanism that manage gracefully sustained notes and sustain pedal across active channel changes.

I would like some of you to test it carefully and tell me if you find some problem with it. Basically you should setup several layers and play, maintaining notes and sustain pedal while rotating the active layer (single channel mode enabled!). Try all the combinations and possibilities you can imagine …

But first … update your zynthian!! 😉

Enjoy!

---

<div class="post-metadata">

**Author:** ![jofemodo](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/jofemodo/32/2_2.png) [@jofemodo](https://discourse.zynthian.org/u/jofemodo)\
**Post date:** [February 11, 2020, 11:01am UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/2 "2020-02-11T11:01:11Z")

</div>

Some notes on last improvements:

- Now “Sustain-Pedal” is correctly managed across several active channel changes. You can rotate N layers and maintain sustain pedal across all of them.

[https://discourse.zynthian.org/uploads/default/original/2X/d/dead10d8029b3f5ef962d14a609c5646f0b0d5b3.ogg](https://discourse.zynthian.org/uploads/default/original/2X/d/dead10d8029b3f5ef962d14a609c5646f0b0d5b3.ogg)

- Sustained notes only will be managed across **ONE** active channel change. If you keep pressed notes across 2 or more active channel changes and release the notes on a different layer, the notes will remain ON.

Enjoy!

---

<div class="post-metadata">

**Author:** ![mheidt](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/mheidt/32/773_2.png) [@mheidt](https://discourse.zynthian.org/u/mheidt)\
**Post date:** [April 17, 2023, 6:49pm UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/3 "2023-04-17T18:49:09Z")

</div>

I think, the bug is back again.  
Or I might have misconfigured my snapshot.  
The issue:  
Multiple layers and you press sustain while your hand is switching the midi channel.  
The releasing of the sustain only sends to the current (now new channel) and not to all channels.  
I tried something with Copy CC. But you can’t switch off NoteOn only CCs.  
@riban could you pls confirm the behaviour?

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 18, 2023, 4:11pm UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/4 "2023-04-18T16:11:16Z")

</div>

I don’t see this behaviour.

- Stage mode
- Add two synth chains
- Press and hold sustain
- Press and release key - note sustains
- Change selected chain
- (Optional) press and release key - note sustains
- Release sustain - all sustained notes are released

@mheidt if you have a different workflow that triggers this please detail the steps to reproduce.

---

<div class="post-metadata">

**Author:** ![mheidt](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/mheidt/32/773_2.png) [@mheidt](https://discourse.zynthian.org/u/mheidt)\
**Post date:** [April 18, 2023, 4:51pm UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/5 "2023-04-18T16:51:08Z")

</div>

Ok, the bug was in Stage mode. This still works.  
But change it to Multi-Timbre please.  
Maybe it should not be default, but I like to see a way to propagate the Sustain and other CCs to other channels.  
Using “Clone Midi to…” doesn’t let me turn off Note events.  
And when I add the Midi rule “MAP CC#64 =\> CC#64”, rebooted the machine, I still can’t turn off the sustain of a different channel.

---

<div class="post-metadata">

**Author:** ![riban](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/riban/32/2331_2.png) [@riban](https://discourse.zynthian.org/u/riban)\
**Post date:** [April 18, 2023, 5:23pm UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/6 "2023-04-18T17:23:01Z")

</div>

This sounds quite different to the original post. I think you want to pass sustain to several chains without passing the other MIDI commands like note on/off. This is not possible with MIDI clone which clones note on/off and any configured CC - so you can select which CC to pass but cannot mute the note on/off messages. In theory you should be able to do this with MIDI Mapping rules but I have found two issues with this:

1. Multiple selection of destination channels is seen as a syntax error, e.g. `MAP CH#0 CC#64 => CH#0,1 CC#64`
2. Only the last of multiple mapping rules for the same control will work, other rules are ignored

I would suggest these are both bugs and should be reported in the issue tracker.

I tried MIDI routing a MIDI chain to another chain but only note on/off is routed, not CC. I can’t think of a way to send just CC to multiple chains at the moment.

---

<div class="post-metadata">

**Author:** ![mheidt](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/mheidt/32/773_2.png) [@mheidt](https://discourse.zynthian.org/u/mheidt)\
**Post date:** [April 18, 2023, 5:52pm UTC](https://discourse.zynthian.org/t/software-update-sustained-notes-and-sustain-pedal-across-active-channel-changes/3794/7 "2023-04-18T17:52:26Z")

</div>

Yes. and even if I use this:  
MAP CH#3 CC#64 =\> CH#1 CC#64  
MAP CH#3 CC#64 =\> CH#3 CC#64  
MAP CH#1 CC#64 =\> CH#1 CC#64  
MAP CH#1 CC#64 =\> CH#3 CC#64  
The second bug prevents it from working.

> <https://github.com/zynthian/zynthian-issue-tracking/issues/865>
>
> \*\*Describe the bug\*\*
> If you press the sustain pedal on one channel, and release… it on different channel, the note of the first channel is still on.
> This works in stage mode, but not in multi-timbral mode.
> 
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behavior:
> 1. Select Multi-timbral mode
> 2. Add Midi Filter Rule MAP CC#64 =\> CC#64
> 3. Add two synth chains
> 4. Press and hold sustain
> 5. Change Midi channel on master keyboard
> 6. Release sustain
> 
> The sound is still audible.
> 
> \*\*Expected behavior\*\*
> When releasing the sustain, I would expect all sounds to dissappear because of the filter rule I added.
> When I just use a single channel rule like
> MAP CH#3 CC#64 =\> CH#1 CC#64
> it works for this situation.
> 
> But it is not possible to add a rule like
> MAP CH#0 CC#64 =\> CH#0,1 CC#64
> 
> If you use multiple rules like
> MAP CH#3 CC#64 =\> CH#1 CC#64
> MAP CH#3 CC#64 =\> CH#3 CC#64
> MAP CH#1 CC#64 =\> CH#1 CC#64
> MAP CH#1 CC#64 =\> CH#3 CC#64
> only the last per channel is used.
> 
> We need either a 1:n mapping of rules or make the AllChannel option work.
