midi pickup maybe?

i recently sent an email to the arduino team and they said it would not be possible to attach an audio input into the arduino to send a digital version of the data back into a computer (because of the 8-bit nature of the a/d converters), my question now is that midi runs on sending 7-bit signals back to the computer (0-127), is there any chance of bypassing an expensive piece of kit by buying a guitar midi pickup maybe or making one, and then attaching that to an arduino and sending the data back to the computer? please tell me if this is possible cheers rich

This appears to be a part of an ongoing discussion somewhere, and it is hard to pick up what it is you are trying to do without that context.

What information are you trying to extract via a guitar pick-up?

CV to MIDI is simple enough on the Arduino. Pitch detection is an entirely different prospect!

yes i would like pitch detection in a basic form, velocity and pitch bend the usual midi info, i would like to use a guitar as a midi controller, much like a midi keyboard.

Interesting project. Non-trivial.

I guess you could leverage an Arduino for pitch-detection. But pitch detection of a musical signal is complex. The algorithms are processor-intensive and the code lengthly.

Me, I'd take the DIY mentality and go to a component that does the job already. For instance; find one of those digital guitar tuners and hack it. Let the tuner do pitch detection; you just interpret.

Of course you'd be detecting one note at a time. And you still have to hack some way of determining difference between a bend and a fret change. And you have to extract leading edge from continuous tone -- and create distinct MIDI events for all of these.

Seriously, the best way to look at this is not "Can I do it more cheaply than an off-the-shelf Guitar-to-MIDI converter?" (because the answer will be "no,") but; "Can I do something that is not within the normal function of an off-the-shelf Guitar-to-MIDI box?"

thankyou nomuse your comment has inspired me, I think hacking something that already does the job is an absolutely genius idea. "Can I do something that is not within the normal function of an off-the-shelf Guitar-to-MIDI box?"

This is exactly what i would like to do, my lecturer said that because the arduino is 8bit it will be able to go from (0-1024) instead of midi 7bit (0-127), so hopefully if all goes well and i start getting to the nitty giritty, the system might be better than your average off-the-shelf midi stuff

I would recomend that you spend some (make that a lot of) time getting familiar with the MIDI protocol.

One of the best references i have found is here: http://www.borg.com/~jglatt/tech/midispec.htm

Good luck with your project

Interesting project. Non-trivial.

I guess you could leverage an Arduino for pitch-detection. But pitch detection of a musical signal is complex. The algorithms are processor-intensive and the code lengthly.

Me, I'd take the DIY mentality and go to a component that does the job already. For instance; find one of those digital guitar tuners and hack it. Let the tuner do pitch detection; you just interpret.

Of course you'd be detecting one note at a time. And you still have to hack some way of determining difference between a bend and a fret change. And you have to extract leading edge from continuous tone -- and create distinct MIDI events for all of these.

Seriously, the best way to look at this is not "Can I do it more cheaply than an off-the-shelf Guitar-to-MIDI converter?" (because the answer will be "no,") but; "Can I do something that is not within the normal function of an off-the-shelf Guitar-to-MIDI box?"

BTW, if you can isolate each individual string, pitch detection algorithms are quite trivial. Fourier transforms would only be required for complex signals. With an individual string, all that would be required would be to clip the signal and evaluate the frequency via the time it takes to go from zero to one once. (one oscillation)

Most Arduinos have at least 6 ADCs, so this is more than possible. Additionally, the Roland GK series midi pickups have a separate audio out for each string from their 13-pin cables, so this project should be a piece of cake.

I realize that this approach may seem rudimentary, and maybe even a bit crude, but it does work. I know someone who's thrown something like this together using an infra-red LED and an IR sensor in an isolated-string system, and it seems to work reliably.

Just throwing that out there. Should save you some time and quite a bit of grief. (also, this can be done for much cheaper than an off-the-shelf midi converter. GK to MIDI boxes cost between 300-400 dollars, where you can buy a GK module and an Arduino for 140$ total if you play your cards right.

Hell, if you're feeling ambitious, you could build your own MIDI pickup and build the thing for under 50$ as opposed to the 400$-500$ companies want you to spend. A steal.

you see now thats why i came here, thank you for answering my question in a way i want here! I'm pretty sure that most commecial pitch to midi converters your standard GK series and others understand the signal by counting somewhere in the region of 6 oscillations and some of them more. So i might have to experiment and see what works best. almosthuman do you know if it would be hard to hack the gk midi pickup and get the information i want out of it and into the arduino, like how i would understand or make something that understood the 13-pin connection?

Roland's GK MIDI pickup doesn't output MIDI at all, which is a bit misleading. (this misunderstanding cost me about 100$)

What it does do is output each individual string's audio to a different pin on the 13-pin connector, whereas normal guitar pickups just throw the whole signal onto one conductor. The idea is that each string's vibrations are decoded by a MIDI converter box (Roland GK converter modules run from 300$ to 500$) which then sends midi to whatever device you want to control. (I.E. synth, computer, ect...)

So instead, you use an Arduino in place of the Roland GK converter box. You route each of the string's raw audio outputs (from the 13-pin cable) to each of the Arduino's analog-to-digital converters. The Arduino samples the audio from the strings and figures out what frequency the each string is vibrating at. (If you want a separate explanation on how to do this, let me know. There is a CPU efficient way to process the frequency of a single vibrating string) It then converts that frequency to a MIDI pitch, and then sends the data off to wherever. (I.E. synth, computer, ect...)

To further disambiguate, you would probably use a Roland GK MIDI pickup for this project, which is normally coupled with a Roland GR-20. (http://www.roland.com/products/en/GR-20/index.html) The GR-20 would normally be the middleman, converting the GK's audio output to midi, then sending it to your computer or synth of choice. Instead of the GR-20, you'll be using an Arduino.

Normal Config: GK Pickup --> GR-20 --> Computer

Arduino Config: GK Pickcup --> Arduino --> Computer

That's basically it in a nutshell. I'd like to restate that the GK MIDI pickup does not output MIDI. If Roland tells you this, as I have been told they will, it is not true. (trust me, I know from experience) That's why we need the Arduino. The GK pickup is basically six guitar pickups, one for each string. The reason this is done is because while processing all the strings together for pitch conversion would be very computationally expensive, processing one string at a time is quite simple, and fairly easily done. (which is why you shouldn't have to pay $350 for hardware to do it)

Almosthuman,

I'd like to know what the cpu efficient way to process te frequency of a single vibrating string is. A friend of mine once recommended using a phase-locked loop. You can get this in an ic: http://www.national.com/opf/LM/LM565.html

  • ben

Thank you very much for all your help so far...

Can you please explain a way to do pitch detection (if I can isolate each sting) please.

Sorry if i’m being dumb, but to relieve the arduino from the computation task, can’t you use some kind of ADC after the Roland “MIDI” pickup ? Don’t know if there’s a chip ready for this, but one that could take the audio signal and outputs a byte value of the frequency, maybe ?

I’m recalling now a project I was tinkering with some years (decades?) back, where I was doing to skip the frequency step completely. Detect the leading edge of the waveform and use that as the trigger for waveform generators, frequency multipliers, and the like. So at all times you are treating the actual physical motions of the string, and not an abstract of the average frequency of vibration.

Don’t know if that’s any help for this project, though.

I wish to build a somewhat similar project - use an arduino board to transfer data from a MIDI pickup to a computer (the purpose is to translate guitar input to visual output) what Arduino board should i get to handle this task?

Much as I love Arduino, if you've already got a MIDI pick-up on the guitar, and you have a MIDI interface for your computer, the physical layer is already there. What remains is software. Write yourself a "MIDI event to graphic event" package in Processing (or the language of your choice).

Actually...the cute thing would be to install color LCD's or EL wire or RGB LEDs or something in the guitar itself. For that, you'd want an embedded micro as well.

Actually, I don't have anything yet... not even the guitar, I'm trying to find a (cheap) way to get a digital signal from a guitar (for each string) MIDI will be quite expansive (to my understanding, MIDI pickup doesn't give MIDI output, as almosthuman noted, a converter is needed.)

ok, I bought a GK-3B Pickup and an Arduino Uno, what now?

What do you want to do. All it is is a normal type pickup. They sell a GI-20 if you want to drive MIDI equipment. Or do you want the arduino to emulate the GI-20. If so that is a bit of a daunting project.

The pickup will just give you an audio signal output. This will need amplifying to 5V peak to peak to feed it into the arduino. After there is a lot of maths to do on the signal to try and identify the notes being played, look up FFT http://en.wikipedia.org/wiki/Fast_Fourier_transform for the sort of maths you need.

what i want to do is to control visuals with a guitar. I need the computer to receive some input from the guitar (preferably a separate signal for each string), that can signal either Flash or Processing to start playing a movie clip.

I am a designer, I have very little technical knowledge, but will get someone to help me later on the project. (it is my final project for visual communication design degree). I can still return the GK to the store if there is a better way to do the project. (or no way at all :()

computer to receive some input from the guitar (preferably a separate signal for each string)

In that case I would go for a separate pickup on each string. Pickups are normally wired together so they add up but if you pull one apart you can get at the signals from each separate one.

I am a designer, I have very little technical knowledge

I think you will need a lot of help then, more a hands on type rather that what we can offer here.