Hi there.
I'm trying to get the chords played by a piano or a guitar by the frequency they produce, and i was able so far to get only the pitch from a single note.
Anyone as an ideia on how this is done?
Best regards
Detecting Chord's with adc~
Hi there.
I'm trying to get the chords played by a piano or a guitar by the frequency they produce, and i was able so far to get only the pitch from a single note.
Anyone as an ideia on how this is done?
Best regards
I haven't looked into this since about a year ago, but at that time, anyway, real-time polyphonic pitch detection wasn't yet very successful. The non-real-time methods I came across were pretty intense.
[fiddle~] does give you the option of trying to track up to three pitches, but it's not very good. Particularly with more consonant intervals, it tends to get them wrong or miss them altogether. I'm guessing because there are more overlapping harmonics with those intervals.
Hi there Joesh, actually i managed to detect the pitch of a signle note on a guitar and convert it (with milisec's delay) to midi note with sigmund~ pitch object. and its actually accurate enough to produce some real time effects especially when operating with midi with logic or ableton live, that's what i tried, but the guitar player that i know and the composition we are about to produce contains a lot of chords and i want a list of the fundamental and harmonics to get that chord in a single value or multiple values so that i can apply some math on it in order to get a fundamental pitch of a chord. if anyone knows a lot about this, i would be glad to hear something from you.
Maelstorm, what you are saying about fiddle its really true, the first picth detection i tried to make with fiddle was really depressing and i had already 2 times the size of the patch that i have now with sigmund~, just to try to control all those randomly incoming values.
I had a workshop in January with Marco Donnarumma and i really believe that he knows a lot about this, but probably i cannot get in touch with him as often as i needed to get to really do something or understand it at least.
Best Regards
Hi Aijeen
I thought about the same problems that you mentioned just after I posted the reply. Interestingly enough I occasionally have some contact with Marco Donnarumma via twitter, so you could always leave a message there, or on his website.
Another place to ask questions is via the PD-list and Miller Puckette (and Co) are very happy to answer questions via the 'list'. Try (or leave) a question there as someone may have a good answer.
even for a human ear and brain, it is very hard to tell which individual notes make up a chord, just by hearing it played.
For example, you could play a C major root chord to a musician, and they'll tell you that it's a C chord. However, they are not hearing the 3 individual notes that make up the chord as separate tones - they are just telling you from experience that the total sound is what a C chord sounds like.
If you randomly hit 3 keys on a piano as a chord, then even trained musicians will have a lot of difficulty in knowing which 3 notes make up the resulting chord.
To an extent, the Melodyne software system seems to do quite well at polyphonic chord detection, but it's not a realtime process, and also it's not at all easy to understand.
It kind of depends on the training, I think. I can hear solitary chords and tell you whether or not they are major, minor, dom7, and so forth. I don't hear them as individual notes, just as sonorities. But since I know what makes those chords, I can, of course, tell you the notes--if you give me a reference note. I have a decent ear for relative pitch, but not absolute pitch (perfect pitch).
In the context of tonal music, chords have functional roles, and it makes it even easier to tell what they are based on how they work. Subdominant chords want to go to the dominant, and dominants want to go to the tonic, etc.
In terms of just random notes, as long as there aren't too many, I can probably tell you what they are (again, needing a reference). Three is doable. An eight-note cluster, though...forget it. BUT with clusters, you can generally at least pick out the highest and lowest notes. For simpler chords, like triads, this greatly helps in hearing what inversion the chord is (i.e. which note is in the bass).
I've met a few people with perfect pitch who can pull out any note they hear, and I really want to punch them every time they do it (genetically over-privileged bastards). Interestingly, many of them don't particularly like their talent. A lot of them say it makes it difficult to listen from a more "relative pitch" perspective, which has a lot to do with how chords function in tonal music.
I'm not going to lie, I forgot where I was going with all of this.....Fuck it. SUBMIT!
It's fun to see the thread that's developed from the initial question.
As Maelstorm says it is easily possible to recognise notes, chords and their function. I know because :
a) I had to do it - a long time ago - to get my diplomas in music.
I now teach the stuff, and it's standard practice for all jazz musicians to recognise complicated chords, chord movements, notes and note intervals.
As Maelstorm also points out, most trained musicians hear all this relatively, which is the most common and practical situation we find ourselves in. Those with perfect pitch (not my case) find it useful and frustrating depending on situations, a long story and probably too long to go into here.
But, back at the original question. I think that as 'Mod' mentioned, it is a very complex problem to recognise notes and analyse them as the modulation around a note must complicate the problem. Just putting a number box on the first output of [fiddle~], singing a note and watching the numbers jiggle around proves the point. However, if guitar tuners, automatic note correction units - to be found in all studios - and transposition programs such as 'Transcribe' can analyse the sound spectrum and come up with accurately corrected notes or chord names, then Pure Data should be able to do it also.
Unfortunately I'm reasonably new to Pure Data otherwise I'd be trying to build something to solve this problem, and after that's what makes PD fun and different as it grows as if there just isn't an object that does it now, the answer is actually ....... yet!
The question for a polyphonic pitch tracker (and shifter) pops up frequently these days. For a short while, I've also had the hope we could bring this to Pd if only we know the secrets of recent techniques like used in Melodyne DNA.
Well, there is no secret in Melodyne DNA. All it's details are described in a patent application:
http://www.google.com/patents/US8022286?printsec=description#v=onepage&q&f=false
If you're familiar with the frequency domain, you'll probably understand the whole story. The text also makes clear why note separation, needed for polyphonic analysis and processing, can not be done in 'real' real time: the analysis is done on 'note objects'. Meaning, it works on notes which are in memory from start till end. You'd have a few seconds latency at least. Besides that, high quality note separation seems to be an elaborate process. It will consume quite some CPU %s, and more important, quite a bit of programming effort.
This is a contrast with monophonic pitch tracking which needs no more than a few periods of a sound before it can start reporting a pitch.
Katja
Thats it katjav i've followed also all your posts regarding pitch detection and pitch modulation and i was really impressed on all of your research, it's really amazing and actually influenced all of my research, and even tough i really understand why it would take too much of a cpu resource in a real time situation that's what's needed to be done, and this is, as you said, of much concern in the community maybe its time for some really efforts on trying to develop this tool.
I'll try go get as much information as i can with my college teacher's of processing and interactive sound. And i actually should contact Marco Donnarumma, i'm almost sure he knows something about this.
By the way there is a game of much inspiration on this project that you should check out, there is a link for an youtube video.
Sometimes the sound is not really interesting but the concern with visual effects related to audio its huge.
Now imagine your guitarist, kinda messing with the environment with those chords and single notes.
Just an update. I left a message on the PD-List asking about this topic, here's the reply - from William Brent - which could be useful to anyone looking for a solution :
I don't know of any polyphonic pitch tracking object in Pd, but there's PolyPitch in SuperCollider. You could run it there and route the results to Pd via OSC. The quality of results will depend a lot on the kind of input signal you're trying to analyze.
Hello everybody:
I found interesting info about PolyPitch, besides source code, here:
http://www.sussex.ac.uk/Users/nc81/code.html#SC
and here:
http://arg.cs.tut.fi/index.php/research/musicanalysis
Since I don't have the time and probably the skills to develop this, I leave it to the better prepared: you. I wish you success.
Sumidero
Debian Stretch on Lenovo T450i, Lexicon Omega.
Pd-vanilla 0.49.0-3~bpo9+1 (installed from repo)
Hi Joesh
I'm in the middle of that experience you told, working with SuperCollider and PD actually i have the polypitch patch already, the only problem now is...how to send communications to PD. I am aware of the receiving process in PD and i tried already with OSCulator, and it really works good. But how to send the Polypitch analysis from Super Collider, i have no ideia.
Best regards
Hi Aijeen, I'm going to look into it in a week or two as I'm busy trying to solve another PD problem at the present. It certainly looks interesting ...... in fact I'm mighty curious!
Keep me posted if you get anywhere.
Thanks.
Hi Aidjeen,
I know this thread is a couple months old, but I'm very curious about whether or not you figured a way to send the PolyPitch output to PD. If you did, could you possibly share the process?
Thanks.
Hi cbjact.
I really didn't, and actually i found another way to do it so.
My main purpose was to get the notes of each string in and electric guitar, and
for doing so i would get the chords in real time. My teacher explained me and it makes a lot of sense, that digitally its really hard to get perfect results, since the harmonics of each note will coincide with other notes from other octave.
What i did was going around this, and so i built a single string pickup, connecting each one to an audio interface, and configuring adc~ with inputs from 1 to 6. and adding sigmund ~pitch. This object is really amazing since you can get it to work with a lot precision, or with no precision at all.
I think that is the way that Midi Guitar work : one pitch detection for each string.
Yeah its true, there is something you can try, plug-a jack TS to your computer input, and concet the other tip to a guitar, try to do some pick'n in your strings, and use pure data to get the pitch you are playing and transform that into midi notes.
Dont forget to route your internal midi.
Try to play in VST Synth that actually has a keyboard and you will see, wich string matches the piano keys. All in real time, with a little bit of delay.
[helmholtz~], written by Katjav, seems to be a very efficient external to find pitch, also.
Using helmholtz~ , is it possible that filtering out the detected frequency and sending the (filtered) audio to a second helmholtz~ for pitch detection would result in an effective polyphonic pitch detector? For my initial experimenting with this, I hooked up a series of six helmholtz~ objects, taking the output from each to set a hipass filter with a cutoff frequency just above the detected frequency. I then send the audio input source through the filter and into the next helmholtz~ , with the hope that I have reduced the first detected frequency by enough that the next most dominant frequency will be detected.
The result with my electric guitar as input source was interesting; most of the time all six helmholtz~ objects output the same frequency. However, I found that if I played softly enough, I could get some of the frequencies to 'stick' at their previous values. It's kind of a cool effect in its own way, but not what I was going for, since my hope was to be able to trigger full chord changes.
I think maybe some of the problem may be my implementation, since I'm pretty new to pd, and I'm going to be playing with this a little more to see if I can get it working better. I'm curious though, if anyone else has tried this method before, and if I'm trying something that will definitely not work.
The problem with that is that one pitch contains many frequencies that are harmonically relate (i.e. integer multiples of the fundamental frequency). So filtering out the fundamental won't eliminate the pitch. You could use a comb filter to take out the harmonics, but if other pitches share those frequencies (which happens with consonant intervals) it could make detection of those other pitches more difficult. This is one of the major problems with polyphonic pitch detection. It's common for chords to contain notes with overlapping frequency content, so it can be difficult to determine whether certain frequencies belong to one note or several.
Oops! Looks like something went wrong!