Sustain pedal not working in layers

Good day! I’m actually new to piano and keyboard learning, I bought a cheap keyboard last week and wondered how I can improve its tones and capabilities that when I searched and stumbled upon your very nice zynthian and friendly community, today I got my headless zynthian to work, I was really amazed of how feature packed it was but I can’t get the sustain pedal to work. All it does is turn off the sustain when I turn it on manually through the mouse. And sorry in advance because the programming and the terminologies are overwhelming to me. Here is the pic of the dashboard and pedal for reference. Advanced thanks sirs.

Hi
In the webconf, you can enable “Show MIDI messages” (or something like this) and see what is comi’g out from your pedal.

Or maybe it can just act as a switch ?

1 Like

Good day sir, is this what you meant? Thats the log when I step on the pedal and release.

Yes that’s it.
As you can see, your pedal is sending a Control Change message on MIDi chanel 1 but unfortunately your pedal act as a switch on/off (value 0 or 74)

1 Like

Oh okay sir, do I have to configure something? Or do I have to change pedal? Or the keyboard is not compatible? Sorry to trouble your patience but I have trouble understanding about MIDI CC,switches and etc.

The pedal seems to work okay. Will you confirm that it sends CC 64 with value 64 when pressed and sends CC 64 with value 0 when released?

Also, what engine and preset are you using for your sound in Zynthian?

1 Like

Good day Sir! Thank you for noticing my post,


This is the midi log I just did, I don’t know what correct one to select, so I did my Keyboard (Yourock) and zynroutermain. Yes sir, In the keyboard midi log, it sends value 64 when pressed and 0 when released, I notices when looking at the log and manually turning on the sustain through the mouse it turns on when it exceeds the value of 64.

ZYNTH 4

This is the layer I’m using.

And this is my keyboard’s manual for midi sir. I don’t know if my potato observations would help solve my problem. Looking forward for your future recommendations sir. Good day :grin:

The MIDI log shows the pedal on & off commands arriving from your keyboard but only the off commands is leaving the Zynthian 's internal MIDI router.

The first thing to do is to check for updates. Use webconf or the Zynthian 's admin menu to update and reboot. You will need the Zynthian to be connected to the Internet.

I did as you said sir. I updated via webconf.

Here is the log:

Updating zynthian-sys (stable) …
Already up to date.
Executing custom update recipes …
Executing /zynthian/zynthian-sys/scripts/recipes.update.buster/00_install_packages.sh …
raspberrypi-kernel was already not hold.
raspberrypi-sys-mods was already not hold.
Reading package lists…
Building dependency tree…
Reading state information…
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists…
Building dependency tree…
Reading state information…
Updating zynthian-data …
Already up to date.
ln: failed to create symbolic link ‘/usr/local/share/zynaddsubfx/zynaddsubfx’: File exists
Updating System configuration …
BOOT LOG DISABLED
RBPI AUDIO ENABLED
OTG ENABLED
SOUNDCARD CONFIG =>
DISPLAY CONFIG => disable_overscan=1\n
ACT LED CONFIG =>
Aeolus Waves already exist!
Custom Config /zynthian/zynthian-sys/custom/soundcard/Dummy device …
SOUNDCARD_MIXER is OK
Updating zyncoder …
/zynthian/zyncoder /zynthian/zyncoder
/zynthian/zyncoder/build /zynthian/zyncoder /zynthian/zyncoder
++ Defined HAVE_WIRINGPI_LIB
++ Defined DUMMY_ENCODERS
++ Using wiringPI
– Configuring done
– Generating done
– Build files have been written to: /zynthian/zyncoder/build
Consolidate compiler generated dependencies of target zyncoder
[ 66%] Built target zyncoder
Consolidate compiler generated dependencies of target zyncoder_test
[100%] Built target zyncoder_test
/zynthian/zyncoder /zynthian/zyncoder
/zynthian/zyncoder
Updating zynthian-ui …
/zynthian/zynthian-ui/zynlibs/zynseq /zynthian/zynthian-ui
/zynthian/zynthian-ui/zynlibs/zynseq/build /zynthian/zynthian-ui/zynlibs/zynseq /zynthian/zynthian-ui
– Configuring done
– Generating done
– Build files have been written to: /zynthian/zynthian-ui/zynlibs/zynseq/build
Consolidate compiler generated dependencies of target zynseq
[100%] Built target zynseq
/zynthian/zynthian-ui/zynlibs/zynseq /zynthian/zynthian-ui
/zynthian/zynthian-ui
/zynthian/zynthian-ui/zynlibs/jackpeak /zynthian/zynthian-ui
/zynthian/zynthian-ui/zynlibs/jackpeak/build /zynthian/zynthian-ui/zynlibs/jackpeak /zynthian/zynthian-ui
– Configuring done
– Generating done
– Build files have been written to: /zynthian/zynthian-ui/zynlibs/jackpeak/build
Consolidate compiler generated dependencies of target jackpeak
[100%] Built target jackpeak
/zynthian/zynthian-ui/zynlibs/jackpeak /zynthian/zynthian-ui
/zynthian/zynthian-ui
/zynthian/zynthian-ui/zynlibs/zynsmf /zynthian/zynthian-ui
/zynthian/zynthian-ui/zynlibs/zynsmf/build /zynthian/zynthian-ui/zynlibs/zynsmf /zynthian/zynthian-ui
– Configuring done
– Generating done
– Build files have been written to: /zynthian/zynthian-ui/zynlibs/zynsmf/build
Consolidate compiler generated dependencies of target zynsmf
[100%] Built target zynsmf
/zynthian/zynthian-ui/zynlibs/zynsmf /zynthian/zynthian-ui
/zynthian/zynthian-ui
Updating zynthian-webconf …
Running Flag Actions from ‘/zynthian/zynthian-sys/scripts/update_zynthian.sh’…
Update Complete.

And tested again and still only the Value 0 was received. :frowning_face:

My apologies, I was mistaken. You were already at the latest update. (I checked against the wrong version :blush: .)

Check in webconf INTERFACE->MIDI Options whether any filters are applied. There is a box titled, MIDI Filter Rules" which should be empty.

1 Like


It’s ok sir I hope you don’t run out of patience with my problem. Haha, :smile: I’m on the default profile sir with no filter rules applied.

1 Like

Hi @iemkenn. There is some rather interesting behaviour with MIDI CC you have identified. I haven’t yet fully understood what is happening but it relates to a feature within Zynthian called, “Autodetect CC relative mode”. You should disable using webconf INTERFACE->MIDI Options then restart the Zynthian. (I think a restart is required for this feature to be changed.) You should then have a working sustain pedal.

I am inside the ZynMidiRotuer code at the moment so will look at this behaviour.

1 Like

The word “bug” was used at the moot last night…

1 Like

Well… I have investigated further since yesterday and now see it relates to the relative mode. It may not be a bug - we will see. For now there is a solution to disable this mode.

1 Like

Mind your head!

1 Like

It works!!! Haha, :grin: Thank you good sir for your unlimited patience. Does it have to do with my sustain pedal and hardware sir? I can’t thank you enough for putting time on my questions and directions even I can understand. :grin::clap::beer:

Trust me when I say there is a definite limit to my patience but answering questions that are carefully asked with quality supporting evidence tests my patience far less than someone just saying, “It don’t work - fix it!”

Your sustain pedal works absolutely fine. The specification says that any value below 64 should be considered OFF and any value above and including 64 should be considered ON. Some instruments, e.g. PianoTeq support more positions, e.g. applying a quarter press for less sustain, like a real piano sustain pedal but most pedals (like your and mine) only support two positions, on and off. Many instruments send values 0 and 127 for these states so maybe we haven’t noticed this affect before because other people are not impacted. (All three of the controllers I just tested send 0 & 127. I won’t test every keyboard I own… it would take a while and have not real benefit.)

So - what you have is fine. You can configure Zynthian to work with it. I will investigate whether we can get relative mode to play nicely. You don’t need to worry about relative mode - it is a niche (undocumented) feature. I think we should probably disable it by default.

2 Likes

Well solved crew!! You are amazing! :smiling_face_with_three_hearts:

Explanation:
Some modern MIDI controllers have infinite knobs that use some MIDI-CC relative mode. There is no official standard about this, but a kind of “defacto” pseudo-spec. Read this:

https://www.cantabilesoftware.com/guides/controllerEncoding

Zynthian implements mode 2 (offset) because i’ve an Arturia MiniLab that uses this mode. Other modes are unimplemented yet.

Instead of adding configuration options for this i decided to implement an autodetection algorithm so you don’t need to know a word about all this, but …

… the autodetection algorithm is not perfect (probably it can’t be!) and it causes bad behaviour under some circumstances. As most sustain pedal implementations use 0/127, we didn’t note this “circumstance” before, but i knew about the problem (algorithm’s wakeness) and because of this, there is a flag in the webconf :grin:

Anyway, things could be improved in several ways. For instance:

  • Disable “relative mode autodetection” flag by default, as it’s the safest action
  • Disable “relative mode autodetection” for some special CC numbers, like sustain (64), etc.

Of course, when the other CC relative-modes are implemented, things will get more funny and autodetection would be a bigger challenge. But we love challenges and of course, we love autodetection algorithms.

Enjoy!

1 Like

Thank you for your explanations @jofemodo

1 Like

I really thank you sir, this is a really great community with an incredible support, i hope one day i can build my own box. Good day sir and Cheers​:grin::grin::beer: