# Bug in MIDI-FX chain?

**URL:** <https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167>\
**Category:** Software\
**Tags:** issue\
**Created:** [February 22, 2024, 8:50am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167 "2024-02-22T08:50:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 8:50am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/1 "2024-02-22T08:50:16Z")

</div>

Hi @jofemodo ,

I am not sure but I think I found a small bug inside the MIDI-FX chain handling.

What I needed: NoizeMaker does not support the sustain pedal. But [Robin Gareus midifilter](https://github.com/x42/midifilter.lv2) do (see plugin `TonePedal`). Unfortunately, the version on the Zynthian is too old, which is why I installed the latest version myself:

```auto
  git clone https://github.com/x42/midifilter.lv2.git
  cd midifilter.lv2
  make
  sudo make install PREFIX=/usr

```

After searching for the LV2 plugins again, I integrated the TonePedal via MIDI-FX - but NoizeMaker still doesn’t react to the sustain pedal. But if you use the same setup in MOD-UI (i.e. MIDI-IN → TonePedal → NoizeMaker), then it works!

Questions:  
1.) Is it possible that the sustain CC (64) is filtered out in the Zynthian MIDI FX chain?  
2.) Is it possibile to update the `midifilters` in Zynthian-OS to the latest from github?

TIA, Holger

---

<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:** [February 22, 2024, 9:29am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/2 "2024-02-22T09:29:29Z")

</div>

Hi Holger!

All MIDI CC are filtered before they reach chains. Only note data hits the chain. CC is mapped seperately via the MIDI learn process. This means that we suffer from this kind of issue where someone wants to process MIDI CC using MIDI chains but it doesn’t work.

Maybe we could consider an option to allow CC to reach a MIDI chain but this would require a lot of consideration due to the way Zynthian is predicated on this principle.

---

<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 22, 2024, 10:01am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/3 "2024-02-22T10:01:32Z")

</div>

Some engines will behave badly if we allow CC to pass, but we could have a chain flag to allow this. Perhaps we can have a CC list to check the CC numbers we want. We had something similar for clone feature, so the UI part is almost done.

@C0d3man , please, open a feature request and we would consider to implement it.

Until then, you could find a way by having a pure MIDI-FX chain with the filter plugin and routing the output to the Noizemaker chain. Try it.

Regards,

---

<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:** [February 22, 2024, 10:27am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/4 "2024-02-22T10:27:15Z")

</div>

> [@jofemodo](#):
>
> pure MIDI-FX chain with the filter plugin

I doubt this will help because that chain would also not procdess the pedal CC.

This plugin is not part of the Zynthian distribution so I can’t look at it. Is the pedal control exposed in the plugin? If so you may be able to MIDI map the pedal to that control in which case I would expect it to work as desired.

---

<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 22, 2024, 10:52am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/5 "2024-02-22T10:52:05Z")

</div>

Hi @riban !

AFAIK, pure MIDI-FX chains receive ALL MIDI data. They are not like synth chains.

Regards,

---

<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 22, 2024, 10:53am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/6 "2024-02-22T10:53:50Z")

</div>

Regarding x42 plugins, currently we are using the pre-compiled version from faslktx repository.  
I just updated the install recipe for oram/bookworm, so they will be installed from source code for the next release.

Regards

---

<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:** [February 22, 2024, 11:04am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/7 "2024-02-22T11:04:20Z")

</div>

I just tried both of these ideas and none work. I wonder whether the plugin actually works as described?

---

<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:** [February 22, 2024, 12:17pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/8 "2024-02-22T12:17:03Z")

</div>

Update: In _oram_ you can create a MIDI chain with MIDI Tonal Pedal and route the output of that chain to another chain with Noize Mak3r and you get the expected behaviour. I don’t think this works in 2401.

Note that the plugin has a flaw that if you press the hold then release the hold, all the notes are turned off. Also you can get stuck notes, e.g. use the hold then play another note for a monophonic sound.

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 12:18pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/9 "2024-02-22T12:18:35Z")

</div>

Many thanks @jofemodo @riban !

> [@riban](#):
>
> All MIDI CC are filtered before they reach chains. Only note data hits the chain. CC is mapped seperately via the MIDI learn process.

Ok, I understand. This makes sense.

> [@riban](#):
>
> I just tried both of these ideas and none work. I wonder whether the plugin actually works as described?

I tried, too. Same problems. But if you create a MOD-UI pedalboard, it works. So I don’t think that the plugin has a problem.

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 12:19pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/10 "2024-02-22T12:19:47Z")

</div>

> [@riban](#):
>
> Update: In _oram_ you can create a MIDI chain with MIDI Tonal Pedal and route the output of that chain to another chain with Noize Mak3r and you get the expected behaviour. I don’t think this works in 2401.

Ah, ok… so it looks like in 2401 the CC64 is filtered in MIDI-Chain, or am I wrong?

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 12:22pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/11 "2024-02-22T12:22:31Z")

</div>

> [@riban](#):
>
> Note that the plugin has a flaw that if you press the hold then release the hold, all the notes are turned off. Also you can get stuck notes, e.g. use the hold then play another note for a monophonic sound.

Yes… not the best behaviour. But it works for my application. All I have to do is strike a note and press sustain. Then I can play along on the guitar and release sustain at some point (I need this for an intro and the NoizeMaker should hold the sub bass during the intro).

---

<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:** [February 22, 2024, 12:28pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/12 "2024-02-22T12:28:44Z")

</div>

Could you use a toggle?

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 12:34pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/13 "2024-02-22T12:34:29Z")

</div>

> [@jofemodo](#):
>
> @C0d3man , please, open a feature request and we would consider to implement it.

[Done.](https://github.com/zynthian/zynthian-issue-tracking/issues/957)

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 12:36pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/14 "2024-02-22T12:36:42Z")

</div>

What do you mean exactly?

---

<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:** [February 22, 2024, 1:18pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/15 "2024-02-22T13:18:52Z")

</div>

Don’t worry. I thought a MIDI Note Toggle plugin might have helped but it still requires converting from CC and the CC To Note plugin looks flawed.

---

<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:** [February 22, 2024, 1:56pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/16 "2024-02-22T13:56:11Z")

</div>

You could do it with a MIDI filter rule:

```auto
MAP CH#0 CC#64 => CH#0 NON#60

```

Of course this affects the hold for that MIDI channel to any chain but maybe you have a device that can perform just this pedal hold or maybe only need this for one part of the performance and can load a snapshot to support it.

Just some more ideas but of course you have probably considered these already.

---

<div class="post-metadata">

**Author:** ![C0d3man](https://discourse.zynthian.org/user_avatar/discourse.zynthian.org/c0d3man/32/9_2.png) [@C0d3man](https://discourse.zynthian.org/u/C0d3man)\
**Post date:** [February 22, 2024, 2:34pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/17 "2024-02-22T14:34:53Z")

</div>

> [@riban](#):
>
> `MAP CH#0 CC#64 => CH#0 NON#60`

Hm, very nice idea. I just tried, but I cannot get the note to stop when i get off the sustain pedal.

---

<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:** [February 22, 2024, 2:39pm UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/18 "2024-02-22T14:39:31Z")

</div>

It worked for me on _oram_ and _2401-stable_. Do you have any other filters or plugins involved? I have just one chain with just Noize Mak3r in it. I am driving from a MIDI keyboard with sustain pedal. I have tested with USB MIDI and DIN 5 and both have worked fine.

---

<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:** [March 8, 2024, 9:12am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/19 "2024-03-08T09:12:49Z")

</div>

Hi @C0d3man and @riban !

I have implemented a mechanism in oram that allows routing selected CCs into Synth chains. It’s available in chain options as “MIDI CC”.  
Note that this is only available for Synth chains because MIDI chains already route all MIDI messages, so it’s not needed.  
Also note that using this option could lead to bizarre behaviour with MIDI-controlled engines like fluidsynth, sfizz, linuxsampler, zynaddsubfx, setBfree or Pianoteq. Use it with care.

Regards,

---

<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:** [March 8, 2024, 9:17am UTC](https://discourse.zynthian.org/t/bug-in-midi-fx-chain/9167/20 "2024-03-08T09:17:11Z")

</div>

Super cool man! This is a feature that has confused many over the years - me included. Zynthian filters off the CC which isn’t intuitive but is logical, hence the confusion / frustration felt by some. I love that this feature has been added. It needs thorough testing and documentation.

Indeed, we need to spend some time updating the docs with all this wonderful development.
