Polyphonic Audio to Midi Conversion using Teensy 3.1

Status
Not open for further replies.

cenk

New member
Hello,

I would like to make an audio to midi converter for a Turkish Qanun:

  • This is a 25+ nylon stringed instrument.
  • The traditional instrument has string groups formed of three, this one will have only one string per group.
  • Not a fretted instrument, similar to the harp. All strings can produce one note only.

What I would like to have your opinion about is, is it doable using teensy and which method should I work on?

FFT Method:
Trying to detect all notes (polyphonic) using a single input and a single teensy, relying on the computational capabilities of the chip and the software to be coded.

  • Polyphony?

Simple mics:
Small mics under every string, connected to the teensy via shift registers. Basically, the following information is enough because there we do not have frets:

  • Was this individual string plucked?
  • Level (Velocity in musical terms)

Optic Method:
I wouldn't try this :)

What have I done so far?


I am a designer/developer/hacker, I usually work on web based projects. I also play the guitar and produce music using DAW's, I know about midi and music. I have little experience about electronics but am willing to learn!

Any help is appreciated, thanks.

Cenk
 
The trouble with FFT is a trade-off between resolution in frequency vs response time. As you increase the number of frequency bins, for more spectral resolution, you get those output less often.

Resolution is also limited by the window algorithm, which is needed if you've got any frequencies whose periods are not an exact multiple of the FFT's analysis period... which is pretty much always the case when analyzing natural sounds. You can do overlapped FFTs, and indeed the audio library gives you 50% overlap. But each one still spans a pretty good length of time, so more than 2 or 3 overlapped is of little value.

To begin exploring the FFT approach, I'd recommend making a high quality recording of the instrument, playing a known sequence of nodes, and known sequence of groups sounding together. You could run that data through a 1024 point windowed FFT on your PC. Or you could put it into onto SD card and use the WAV player object to feed the FFT object and look at the data in the Arduino Serial Monitor. Hopefully you'll see good numbers. Then perhaps try to write code to look for the 25 notes (fundamental + harmonics at approx relative levels).

Individual sensors on each string would be the easier approach, except of course the tedious work to wire it all up.
 
I'd had a couple odd thoughts, but they involved using metal strings (and it's a nylon instrument). If you can go with metal, like a dulcimer, you could try wiring it similar to a guitar pickup - or run each string as a capacitive sensor and you could tell exactly when a string was touched (though that might give you a response TOO early).
 
Midi guitar or so

Hello,

I would like to make an audio to midi converter for a Turkish Qanun:

  • This is a 25+ nylon stringed instrument.
  • The traditional instrument has string groups formed of three, this one will have only one string per group.
  • Not a fretted instrument, similar to the harp. All strings can produce one note only.

What I would like to have your opinion about is, is it doable using teensy and which method should I work on?

FFT Method:
Trying to detect all notes (polyphonic) using a single input and a single teensy, relying on the computational capabilities of the chip and the software to be coded.

  • Polyphony?

Simple mics:
Small mics under every string, connected to the teensy via shift registers. Basically, the following information is enough because there we do not have frets:

  • Was this individual string plucked?
  • Level (Velocity in musical terms)

Optic Method:
I wouldn't try this :)

What have I done so far?


I am a designer/developer/hacker, I usually work on web based projects. I also play the guitar and produce music using DAW's, I know about midi and music. I have little experience about electronics but am willing to learn!

Any help is appreciated, thanks.

Cenk


In the past I tried with success put strings to midi with crossing 0 method. Unfortunately I have done it on PIC. It working very fine, of course incoming signal should be conditioned by LPF and anti aliasing solutions too. Can be working with nylon strings too if piezo is used. Working with guitars pretty cool if level signal is correctly setting.

Today later I will put here PIC code when I get my laptop. Maybe some people can help me rewrite it and getting it working with Teensy 3.2 :) its be great get it to work in Teensy environment. Generally I’m noob with Teensy and need learning a lot hahah

I hope that Paul Stoffregen in the next updates Audio library can provide some useful object and examples for audio/midi and envelope followers :)
I m pretty sure it can be very attractive and bring more positive noise around his Teensy project.

I tried use Teensy fft object and I get bins outside but I have no idea how to get working properly with midi. I looking for useful examples but I can’t find anything useful for audio to midi note or control change.

Maybe you can share your working code on Teensy? I tried Adafruit things and I have no success :-/ maybe working together we can get what we need.
 
Code

Codes uploaded :) B2M working really pretty good.
pmu877 is obsolete but still useful and working fine.
One no good thing with them is that is for PIC chips not for Teensy. I will be happiest man in the world if I get some like that on Teensy board.

View attachment B2M.txt B2MSchematic.jpgView attachment pmu877s audio2midi.txtpmu877s audio2midi.gif
 
FFT is not the best approach. It lacks precision in the lower frequency range. I am using a DFT with optimized frequencies, but it works in an FPGA with tight frequency distance settings, so it required a lot of calculation power. Pretty sure a Teensy cannot do this.
 
FFT is not the best approach. It lacks precision in the lower frequency range. I am using a DFT with optimized frequencies, but it works in an FPGA with tight frequency distance settings, so it required a lot of calculation power. Pretty sure a Teensy cannot do this.

I know, but I looking for nearly simple solution for simple experiments with sound frequency nearly fixed not floating much over fundamental tone. FFT should do it. My B2M on PIC do it with very good results but I want use Teensy for it.
 
Status
Not open for further replies.
Back
Top