pitch detector

A place for developers to share ideas and assist each other in solving problems.

Moderators: valis, garyb

Post Reply
User avatar
alfonso
Posts: 2224
Joined: Sun Mar 25, 2001 4:00 pm
Location: Fregene.
Contact:

Post by alfonso »

hello everybody,
i'm not a scope developer, just a pulsarian, but i post here to ask if anyone thougt to make a module for the modular that detects pitch of an incoming signal (of course monophonic) and outputs a freq. mvc type signal to drive pitch of the oscillator...
could anybody tell me the specs of mvc freq. out? what kind of values are output to the osc.?
i tried to drive directly with a guitar a modular osc and it sounds, but acting mostly like a weird filter.....but it must be possible to do something else.

i hope i didn't bother you
cheers, alfonso
User avatar
alfonso
Posts: 2224
Joined: Sun Mar 25, 2001 4:00 pm
Location: Fregene.
Contact:

Post by alfonso »

i've done it!
not the pitch detector, but a true modular to be driven by guitar or vocals or....
very soon on cw site and planetz.
just to close the thread a little O.T.

cheers, alfonso.
User avatar
Neutron
Posts: 2274
Joined: Sun Apr 29, 2001 4:00 pm
Location: Great white north eh
Contact:

Post by Neutron »

We have everything we need to make a pich detector except for a critical component which is a frequency to "voltage" (control level) converter this is not to hard to make with analog components but probably quite difficult with DSP.

one way similar to analog pitch detector circuit would be an atom that sends out a fixed length pulse every zero crossing, and another one to count how many pulses there were per second (adjustable time period - accuracy vs speed) and output a "voltage"

you would need other circuitry to pre process the input, but thats all there allready.
Peezahj
Posts: 103
Joined: Wed Jun 06, 2001 4:00 pm
Location: Los Angeles
Contact:

Post by Peezahj »

Isn't that basically what the Obsidian Tuner is doing (which has quite a lag, btw, which may be the fault of the method rather than the designer)?
User avatar
Neutron
Posts: 2274
Joined: Sun Apr 29, 2001 4:00 pm
Location: Great white north eh
Contact:

Post by Neutron »

I have not seen this device.
claes
Posts: 41
Joined: Sat Aug 04, 2001 4:00 pm
Location: lund, sweden
Contact:

Post by claes »

it's just to count the samples since the last positive zero crossing every time a positive zero crossing occurs..

it shouldn't need more than a couple of rows of assembly to do it.
stecki
Posts: 11
Joined: Mon Jun 25, 2001 4:00 pm
Location: Germany
Contact:

Post by stecki »

<<<Just determine the zero-crossings ??

believe me, it´s not so easy ! There is a bit
more to do !

Greets
claes
Posts: 41
Joined: Sat Aug 04, 2001 4:00 pm
Location: lund, sweden
Contact:

Post by claes »

you're probably right. it would leave quite an ugly output, and quite sensitive to how the input spectrum look's like.

the point that i was trying to make was, that it's probably better to think in code than atoms when it comes to building such a device.


cheers,
claes
stecki
Posts: 11
Joined: Mon Jun 25, 2001 4:00 pm
Location: Germany
Contact:

Post by stecki »

The problem is that a zero crossing for detecting the frequency would only work for a sinewave ! but if you try to determe the frequency of a squarewave(which includes almost all frequencies), it can´t be done with zero crossings ! And music also doesn´t exist only of sine-waves !
claes
Posts: 41
Joined: Sat Aug 04, 2001 4:00 pm
Location: lund, sweden
Contact:

Post by claes »

afaik a square wave only has two zero-crossings per cycle. and if you only trigger on positive ones that will leave one to trigger each cycle.

i don't understand why it should be more than one positive zero crossing, perhaps you could explain?

The only reason I can think of why it wouldn't work is if the base frequency is too low in amplitude so it gets overridden by it's formants, causing it to trigger more often. and you could solve this by putting filters in front of it.
jupiter8
Posts: 448
Joined: Wed Mar 28, 2001 4:00 pm
Location: Sweden lives in Norway

Post by jupiter8 »

I do agree BUT... at which frequency should you start filter? Too low and the high notes don't get detected, too low and you still have the same problem.
I don't like to be negative but i doubt that you can solve the pitch detector problem with "a few lines of assembler". I think the issue is a little more complex then that even though i agree with your theory.
claes
Posts: 41
Joined: Sat Aug 04, 2001 4:00 pm
Location: lund, sweden
Contact:

Post by claes »

with "needing jut a few rows of assembler" I was just refering to the part of the circuit defex was describing an atom based solution to(count zerocrosssings and output frequency). the rest of the circuit would be easier to do with standard atoms.

The tricky part of pitch detection as I see it is probably to pre-filter the signal in an effective matter. Perhaps a lo-cut filter set really low just to remove rumble and then a 6 or 12 dB/oct lowpass filter just to ensure that the base frequency is dominant. this filter could be set to the same low frequency as the lo-cut, since dynamic range shouldn't be a problem since the signal shouldn't be used as an audio signal anyway. the pitch detection algorithm doesn't care how quiet it is, it just cares about zero crossings and with a 32-bit dynamic range the lowpass filtering hopefully wont kill the signal too much (not a 6db/osct at least).

the frequency of these filters could be user controllable to be able to adjust it for the in signal. (still sharing the same frequency is probably as good idea for ease of use)

the signal could also be postfiltered with a simple lowpass to smooth it out a little.

a probably good idea would also be to implement an optional hold function that holds the pitch whenever the gate signal is off as you can release notes even if the source signal doesn't have any long release.

Of course, I haven't tried it since I don't have DP and there are probably further issues that you notice when you actually try it. Perhaps I'll try it in a vst plugin later. This is also just the pitch detection, to play something with an insignal you have to gate it in a smart manner which is probably quite more tricky than the pitch detection if you want a satisfying result.
User avatar
Neutron
Posts: 2274
Joined: Sun Apr 29, 2001 4:00 pm
Location: Great white north eh
Contact:

Post by Neutron »

Pre filtering is (on some analog pitch detectors) an adjustable low pass filter to get rid of harmonics, and then the wave is over amplified to a square wave so the zero crossing detector can work better. that part may not be neccesary ona DSP based one because the circuit does not have hysterisis(sp?)
yade
Posts: 7
Joined: Sun Sep 23, 2001 4:00 pm

Post by yade »

If it would work to count zerocrossings, what about crushing it to 1 bit?
claes
Posts: 41
Joined: Sat Aug 04, 2001 4:00 pm
Location: lund, sweden
Contact:

Post by claes »

It would work counting the time between two zero crossing of the same polarity. This would give the period time, which is the inverse of the frequency.

I've played around with this a little and here is a vst-plugin that works by that principle.

http://www.vember.net/vstplugins/treemonster.dll

note that it doesn't have any prefiltering built in. It is actually intended for fx.

You could also count zero crossings during a specific time like you mentioned (f.ex. one second) and there directly get the frequency. But reducing the resolution to one bit isn't enough. you have to be able to detect the switch from -1 to 1 and be able to add it to a variable. I don't think this is possible without coding your own atoms and i don't have dp but you could try.

If youre really anal you can use a reciproc method to get better measurements, but thats not really needed in pitch detection and counting period time is still the fastest way.

Ive contacted creamware about obtaing /dp and they wanted to see something ive done before and wonder what i intend to bring to the platform. I sent som stuff to them but i haven't got any reply yet. If you're lucky, they like it and let me have dp so i can bring you some fresh new atoms for pitch-detection.. :smile:



<font size=-1>[ This Message was edited by: claes on 2001-10-21 12:16 ]</font>
Nick
Posts: 27
Joined: Wed Mar 28, 2001 4:00 pm
Contact:

Post by Nick »

Myself, I would *kill* for a audio-to-midi device in Pulsar. I play the violin and so far the only devices that can track pitch in real time are the Zeta Synthony (~1300$USD) (in conjunction with the Zeta electric MIDI violin (1000+$USD) and Max/MSP, which is 300$, but runs on Mac. And I have a PC. Actually, MSP can actually detect different attacks and stuff.

Anyhow, to make a irrelevent story short, has anybody actually made any progress on this sort of device for pulsar? (modv2?)

<font size=-1>[ This Message was edited by: Nick on 2002-03-29 13:16 ]</font>
subhuman
Posts: 2573
Joined: Thu Mar 29, 2001 4:00 pm
Location: Galaxy Inside

Post by subhuman »

Nick, if you're serious, don't wait, get the Zeta. My girlfriend's father has one and it's simply awesome. If such a device was created I can't imagine it would be free or too cheap.

My studiomate has an electric guitar hooked up to a Yamaha G50 Guitar to Midi Converter, and it tracks pretty well, almost usable, especially in the higher frequency range. The G50 was over $600 used and still sells new for about that much... In the end it doesn't really give as much expression through midi as the instrument alone does. Perhaps tryin recording the Violin and running it through some wacked out effects instead... this actually sounds pretty awesome on violin, and isn't anywhere near as popular as on guitar! :smile:
User avatar
Neutron
Posts: 2274
Joined: Sun Apr 29, 2001 4:00 pm
Location: Great white north eh
Contact:

Post by Neutron »

I think detecting the top of a cycle is easier than trying to extract a frequency from zero crossing. there is too much going on down there.

Image

That way the filtering does not have to be so fancy, basically it just has to make sure the fundimental is the loudest partial in the waveform. It can probably be done with what we have.

When peak value is detected output a "1" signal which increments a counter. (gotta be sync though. can a sync counter be made with current atoms?)

once a certain time has gone by, sample the value and reset the counter.
j9k
Posts: 266
Joined: Sun Feb 24, 2002 4:00 pm
Location: san diego
Contact:

Post by j9k »

you should look at what the decimator i just posted in the devices area does to wave forms. it samples the peaks and valleys at the up down transition.

see ya
Post Reply