Trying to build a one button looper using the rpi gpio

Hello, I have a RPi4 I would like to make into a single button looper. I have attempted a few ways, and failed. I would like to use the RPi GPIO pins for the button, but I am completely confused. I can set up everything up till assigning the wiring for the switch and setting up the one button looper in webconf. I have a very cheap usb sound card, that take all the power, so I would like to go headless with one button from the pins. Thank you in advance!

1 Like

Hi @jesta and welcome to zynthianland. What you want to do sounds like something that zynthian should be able to do. You describe setting it all up but not what your problem is. I think you say that you want some advice on wiring a button, configuring it to perform an action and assigning that action to one-button-control of sooperlooper. Is this right?

See the wiki for info on adding extra buttons.

Look at this thread for a discussion on using SooperLooper and this thread on foot control.

  • Adding a hardware button - connect a switch between a GPIO pin and GND.
  • Configure the button - in webconf, HARDWARE->Wiring, add you GPI to the config - I don’t know how you have configured this bit or what hardware you have so cannot advise. You need to give more info about your build.
  • Configure the button action - in webconf, HARDWARE->Wiring, (ensure Advanced View is enabled) configure the switch (short) action to “Zyn CC”.

This is where it breaks down! The button doesn’t seem to work properly as a CC message. We may need to drill in further here.

I have a headless setup with generic USB sound card and a switch currently on gpio 2 ( pin3) and ground. That’s the whole thing currently. My goal is to be able to turn it on with everything plugged in and start looping.

I don’t understand what values to put into Wiring in webconf or where to go from there. I have read everything I could find including the referenced links, unfortunately I am missing something.

I don’t know what configuration (custom,rpigpio, ect) to set and tho I understand I have to add my gpio number under Switches heading, I don’t understand what or how I should do that.

Do you have zynthian running? Are you able to add chains and use it for audio processing, MIDI instrument, whatever?

@jofemodo has filled in the missing link in my description. You need to configure the switch action as MIDI CC Switch.

Confirm that you have zynthian working normally and show us your webconf config for wiring so that we may advice next steps.

First off I want to thank you for the all the advice you’ve given on other threads that have helped me on my projects. I appreciate the time and effort you give this community.

Well, to begin with, I start with a fresh install, I configure the web conf and soundcard with a screen/mouse attached. I have also attached a switch to the GPIO, in this case GPIO 2. I’m not fixed on that it’s just what I have right now. Then I usually disconnect the screen, plug in the soundcard,open the web interface on a browser, run update, configure sound card and head to wiring.

From here I don’t understand what I’m supposed to do. I see the switches tab but I don’t know how to fill in the values to what I have. If I set it to custom, or RPI GPIO I don’t get the option to assign the switch, if I try any of the other ones it mentions boards I don’t have attached. I’m just completely confused on what I should do here, it seems like it should be easy I just don’t know what I’m looking at. I have lost count of how many times I’ve reimaged my SD card to try a new configuration. I guess we can assume I will start fresh each try.

1 Like

Select RPi GPIO. This allows you to configure the GPI for the switches and encoders.

This will populate the encoder and switch parameters with default values. Replace all the numbers with “-1”, e.g. “-1,-1,-1,-1”. (Don’t include the quotes.) This will disable GPI for the encoders and their switches.

Then add “,2” to the end of the switch parameter, i.e., “-1,-1,-1,-1,2”. This will add your switch on GPI 2.

This will expose the configuration for the switch which needs to be set to “MIDI Switch CC”, MIDI Channel 1, MIDI Note/Number 4. (Actually the channel and note/number can be what you want but CC 4 is nominally foot pedal MSB.)

This should set up the switch as a CC which can be MIDI learned to the “Single Pedal” controller.

You may need to save between steps.

Good luck and keep us informed of your progress.

1 Like

Thank you, this is the explanation I have searched for. I am going to try it out and report back tomorrow.
To be clear if I add more switches on the GPIO, I add the corresponding GPIO number as a negative (,-x)? What does the - value do? Is that the difference between trigger on press vs trigger on release? Again I really appreciate your time and clear explanations.

No! “-1” means ignore this entry. You must leave the “-1,-1,-1,-1” at the start so that the first 4 switches (that are hard coded to expect the 4 encoder switches) are ignored and your user configurable switches start on the 5th entry. So to add more swithches, add the GPI to the end of the comma separated list as a positive number.

Thanks for clarifying, I was confused by a paragraph in an earlier response that stated
“Then add “,-2” to the end of the switch parameter, i.e., “-1,-1,-1,-1,2”. This will add the your on GPI 2” it seems the -2 was a typo.

As I understand it, the first 4 spots are taken up, -1 turns them off, and GPIO numbers are listed as positive numbers. Ok, I think I got this I’ll let you know.

1 Like

Sorry! That was a typo which I have now corrected to avoid others having the same confusion.