Csound Csound-dev Csound-tekno Search About

Re: [Csnd] GPIO to MIDI (Raspberry Pi & Csound)

Date2020-04-23 13:02
From"Richard (Zappfinger) van Bemmelen"
SubjectRe: [Csnd] GPIO to MIDI (Raspberry Pi & Csound)

I never connect to the GPIO directly. In these cases I use an Arduino where I connect my sensors to.
Then via USB I get the data. This also provides power to the Arduino…

 

Richard

 

Verzonden vanuit Mail voor Windows 10

 

Van: Matti Koskinen
Verzonden: donderdag 23 april 2020 13:38
Aan: CSOUND@listserv.heanet.ie
Onderwerp: Re: [Csnd] GPIO to MIDI (Raspberry Pi & Csound)

 

Hi Mark,

Can't you use OSC-messages?

-m

 

 

On 23.4.2020 14.05, Mark Ferguson wrote:

Hi Matti, 

 

Thanks! Unless I'm mistaken, I think you can do the ADC via the following little device:
https://www.freva.com/2019/06/12/light-sensor-on-raspberry-pi/

 

That can connect directly to the GPIOs.

 

Sorry, perhaps should have been clearer at the start: it's mainly the code element I need help with; how to somehow convert GPIO values to MIDI, if that is even possible...

 

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

 


Date2020-04-23 13:24
FromJames Surgenor
SubjectRe: [Csnd] GPIO to MIDI (Raspberry Pi & Csound)
Hi Mark,

Hope you're well.

In answer to your question, yes you can.
I've done it for creating an OSC controller, but the principle is the same.
Also, it was a while ago, so some aspects might be rusty.

You don't need an Arduino at all.
Find the GPIO pin reference for your PI first, then you know what you're dealing with.
Then you'll need an ADC (something like an MCP3004), in addition to your sensor, and to look into using something like the wiringPI libraries - either through python or C/C++.

As for MIDI, I'd recommend OSC for this case, but it's possible.

Happy to discuss off-list if easier.

Best,
James



On Thu, Apr 23, 2020 at 1:03 PM Richard (Zappfinger) van Bemmelen <zappfinger@gmail.com> wrote:

I never connect to the GPIO directly. In these cases I use an Arduino where I connect my sensors to.
Then via USB I get the data. This also provides power to the Arduino…

 

Richard

 

Verzonden vanuit Mail voor Windows 10

 

Van: Matti Koskinen
Verzonden: donderdag 23 april 2020 13:38
Aan: CSOUND@listserv.heanet.ie
Onderwerp: Re: [Csnd] GPIO to MIDI (Raspberry Pi & Csound)

 

Hi Mark,

Can't you use OSC-messages?

-m

 

 

On 23.4.2020 14.05, Mark Ferguson wrote:

Hi Matti, 
 
Thanks! Unless I'm mistaken, I think you can do the ADC via the following little device:
https://www.freva.com/2019/06/12/light-sensor-on-raspberry-pi/
 
That can connect directly to the GPIOs.
 
Sorry, perhaps should have been clearer at the start: it's mainly the code element I need help with; how to somehow convert GPIO values to MIDI, if that is even possible...
 
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

 

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here