Pages: [1]   Go Down
Author Topic: guitar2midi converter  (Read 2929 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,

i build a guitar to midi converter which can convert incoming audio data into midi notes.
it works monophonic so it is only possible to play single notes on your guitar.

the bad!!:
the latency varies between 42 and 25ms. this is dependent from the frequency. lower notes need more time than higher notes.

the good!!:
i need no super short latency to perform my idea behind:).

functions and needs:
 * stable stage suitable body
 * 9V dc connector (already on arduino board)
 * play notes on guitar and drive them with a nice monophonic synthesizer. i use a mopho
 * connect/disconnect the device from your guitar signal flow using an foot switch
 * cut the guitar through signal  via foot switch, to play only midi
 * select the ONE SHOT MODE via foot switch and catch only the guitar signal if you hold down a second button
   this make it possible to play normal guitar, and only on pressing the SHOT button you can catch a note which can do some nice base tone sounds beside the guitar play

buttons:
button 1(toggle) on top left, connect/disconnect guitar signal to processor.
button 2(toggle) on top right, cut guitar through signal
button 3(toggle) on down left, enable ONE SHOT MODE
button 4(push button) catch a note


some more photos:
http://popez.org/~wolke/arduino/g2m/20111211_002.jpg
http://popez.org/~wolke/arduino/g2m/20111211_007.jpg
http://popez.org/~wolke/arduino/g2m/20111211_006.jpg

the circuit:
 http://popez.org/~wolke/arduino/g2m/20111211_001.jpg
EDIT 12/18/2011:
an circuit enhancement to increase input resistance.
http://popez.org/~wolke/arduino/g2m/new_buffer.jpg

the code:
http://popez.org/~wolke/arduino/g2m/git2midi.pde
EDIT 12/18/2011:
new Arduino 1.0 compatible sketch:
http://popez.org/~wolke/arduino/g2m/git2midi.ino
 
a small video shows the converter connected to an mopho:


how does it works:
the arduino record some samples of audio data in 8bit mode via an analogue input.
than we analyse the data using the YIN algorithm to get an frequency value.
if this is done we convert the frequency to an midi note and fire the midi data via serial tx output.
 
IMPORTANT NOTE:
the nice work to implement and simplify the YIN algorithm into fixed-point math which works very well on an arduino
comes from Frederic Hamel (thx). hi build an arduino based guitar tuner. the project is really well documented and here available.
http://deambulatorymatrix.blogspot.com/2010/11/digital-chromatic-guitar-tuner-2008.html?showComment=1323111013326#c3088234981825128005
please read the licence notes into the code. frederic's parts of the code are licensend under Attribution-NonCommercial 3.0 Unported Creative Commons license.

the analogue part:
to record the guitar output into the arduino analogue input we need an small amplification and an exact DC offset at 2.5V on arduino input pin. because we can only record positive values.
to do this work, i use manly an TLC272. here the circuit http://popez.org/~wolke/arduino/g2m/20111211_001.jpg.
the tlc272 can do a good job with an 5V single supply which is available on the arduino uno. IMPORTANT use later a good wall wart. better no switching wall wart. use one with a transformer. the arduino supply is not the best and we can catch high frequency noise.
the first 10k resistor give us an input resistance from arround 10k. this is ok for us and don't suck to much signal for the guitar through jack, which will connected to your amp. on an amp with 68k input resistance i can not notice any different between connected or disconnected following midi converter circuit. we need the c1 cap to decouple DC from the input stage.
the first inverting op amp stage do the main amplification. the second inverting stage give us a smaller amplification in combination with a low pass filter beginning at ~1khz (16k+10n in feedback loop) . both stages have voltage divider 10k+10k on positive input pin to centre dc offset to the half of Vcc.

ok, this is enough blah blah smiley.
/g
wolke
« Last Edit: December 18, 2011, 12:27:54 pm by wolke3 » Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
a small update because the analogue circuit input resistance is a bit to low and works in combination with the input cap. more or less like an low pass filter for the guitar through signal. this caused with lost heights on guitar through signal.
so i decide to add an jfet(bf245a) based input buffer. now the input resistance is increased to 1,1m ohm. with this high input resistance the guitar through signal is not audible changed.

the new buffer:
http://popez.org/~wolke/arduino/g2m/new_buffer.jpg

also i do some changes on source code to adapt the code to the new Arduino 1.0 version.
the code:
http://popez.org/~wolke/arduino/g2m/git2midi.ino

greetings wolke
« Last Edit: December 16, 2011, 05:20:07 pm by wolke3 » Logged

Upstate NY
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is fantastic...

A question.  What happens if you do try and play a chord?  Does it do the typical "I don't know which note to pick" freakout?

If it does, I have a variation on this idea that could be pretty interesting.  What if you were to have a tap tempo (and/or knob) driven way to pick when it samples the frequency.  Let it pick one and hold the note until the next sample.  Sample and Hold.  Could make for a nice random accompaniment for chords.

I'll probably take off from your design and make a go at this.  So great.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm attempting a similar project, but I have six individual piezo elements (one in each saddle). I'm trying to find a way to input those six signals separately and read them separately, but latency is an even larger issue. I'm stuck.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Stuart, i'm a newbie in this project, and didn't do my research yet. The latence problem is inerent of the project or with a stronger processor it would be fast enough?
Logged

Pages: [1]   Go Up
Jump to: