Let's Make Robots!

Raspberry pi GPIO

Simple question (hopefully)

As a simple starter project, I'm considering using a raspberry pi as a looper, probably based around This Software. As it uses a keyboard or midi input to trigger loop recoding, I'm wondering how hard it is to map the gpio pins on the RasPi as keyboard/midi inputs.

As an additional question, how hard would it be to send some of the data from this program to a cheap character LCD?

Thanks in advance.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

If you are familiar with Arduino, the WiringPi library will be helpful. Including GPIO and LCD functions in Arduino programming style.

Thans for the reply.

I'm not currently familiar with arduino, although I am looking at having a go with it. However, I doubt it's worth installing wiringPi. All I need to do is write a short program to turn a GPIO logic input into a keyboard or midi input, for the software to use to trigger the loop recording. I'd use a hacked PC keyboard, but I think that doing it via GPIO would be a neater arrangement, so that's why I'm asking. I would have thought that python or something similar would be capable, but I haven't any experience with it yet.

Dealing with GPIO on the pi manually can be quite a task. WiringPi is the universally preferred approach to using GPIO (and has bindings for most of the preinstalled languages on the pi, mainly python which has 2 seperate bindings I believe by different people). Come to think of it wiringPi may actually have a thing that detects input state change for you, or makes it easier (interrupts if you will).


You almost certainly want to use WiringPi, even with no arduino experience it is far easier than manually handling the inputs, it can also be faster (it uses direct hardware access somehow, most userland code accesses it by file read/write operations which linux then maps onto hardware)

Right. If it's the easiest way, then I'll use it. Is there a keyboard/midi out command or something similar in the programme?

No but as wiringpi offers control of all GPIO pins you can always write your own function/method/class/etc that uses wiringpi to set the correct output.

Those character LCD's usually use either i2c or serial. The pi has both on its GPIO lines.


The GPIO on the pi isn't particularly quick and as far as I know doesn't raise any interrupts on input change, but I should think the pi should be able to read a midi input. Failing that there are USB Midi input adaptors.

Thanks for the reply.

I'm not too worried about sending the data out to the LCD, It's pulling the data from the software that I'm wondering about, Although overall I'm not too bothered about this part of the project.

I'm not looking to accept midi on the GPIO pins; I'm looking to take a basic digital input from the GPIO pins, and convert it in software to either a keyboard or midi signal for the software. I'm not too woried about speed.