frequency meter

    Jan 09 2022 | 6:30 pm
    How make a frequency meter ? (sorry for my english, I,m Frensch ) Thanks

    • Jan 09 2022 | 6:32 pm
      How to get the fundamental frequency of a signal in a CERTAIN way?
    • Jan 09 2022 | 8:12 pm
      "fundamental frequency" is a matter of human recognition, so you can not measure or track it in a perfect way.
    • Jan 10 2022 | 1:24 pm
      Look for [pitch~] and [fiddle~] or, if you are on a Mac, for [sigmund~]. I've never used them but what you are looking for is a technique similar to audio-to-midi and tuning devices. If you are going for an audio-to-midi technique you may not want the stage where the result gets mapped to a note grid.
      One can build such a thing from scratch but it is complicated. Basically you use FFT (Fast Fourier transform) plus filters depending on the application and dynamics analysis. You set the overall frequency range you want to listen to, measure a certain time (frequency-, source- and application-dependent), find the root frequency (remove overtones and sympathetic resonances), detect the transient (depends on source and frequency) and finally average the hopefully narrow result to get a single value.
      As Roman said, no technical device can reliably find the fundamental frequency. Unless you bind the analysis to some specific algorithm (like AI can do), you only measure the loudest frequency. Your chances also depend on the sound source. Examples: For a string with multiple standing waves you can find the two lowest frequencies which are one octave apart and call the lower one the fundamental. From a horn you should get nice and long sustain for relatively convenient measurement. Note: In case you are more interested in the result than in building such a sophisticated patch, have a look at Blue Cat's FreqAnalyst Pro. This is a frequency analyser plugin that can output automation data for further processing. Center frequency, min, max, etc. Adjustable precision and speed and a graphical display of output data. I use it in Max in the vst~ object.
    • Jan 13 2022 | 5:42 pm
      Hello Peter, thanks for your reply. I will study it as soon as possible and I will keep you posted. Good evening. (7 p.m. in France)
    • Jan 14 2022 | 10:03 am
      Or fzero~
    • Jan 14 2022 | 12:07 pm
      fzero~ Ha! Seems to be working fine. This object hid well from me. Who gave it that name... :-)
    • Jan 14 2022 | 12:37 pm
      That was me. All the good names, like pitch~, were taken.
    • Jan 14 2022 | 2:27 pm
      I see. Will watch out for fone, ftwo, fthree etc. Looks like a plan.
    • Jan 16 2022 | 11:20 am
      Hello, I already tried fzero but the result is not stable; I will check your other suggestions. Good day to you ;
    • Jan 16 2022 | 12:22 pm
      The result is only stable if you measure 100% stable frequencies. In the music world such frequencies may come from synthetic sources like single oscillators. All other sources deliver drifting frequencies. For very coarse measurement you can put [ftom] after fzero~, this rounds the result to MIDI notes. For normal measurement try [slide ...] and [round ...] after [fzero~] until you get the precision you want to see.
      If fzero~ is not enough, the frequency drifts too much or you have disturbing transients or interferences. Then you have to process the signal until you can detect the frequency with the precision and smoothness you want. Finally you can use fzero~ to display the result. This is a complex playground, there is no free lunch by just throwing in some object.
    • Jan 16 2022 | 2:12 pm
      Also see the Help File of "retune~", in the "Pitch Detection" tab.
    • Jan 18 2022 | 12:10 pm
      I just started using pitch detection as well. Plan to do a lot with it.
      Here are some early tests using retune~, fzero~, yin~, and Sigmund~. (fiddle didn't work very well for me and I ran out of space on my laptop screen!) The point here is to find out how they each react to the exact same process, using kSlider, and my upright electric bass.
      Both retune~ and fzero~ seem to work best.
      The C that I am testing is in thumb position on the bass - easier to detect. When I play lower in the bass area it gets really messy. Working on some frequency carving on the lower pitches.
      Anyway, as I mentioned this is early testing. Any advice on the following would be helpful: 1. I used split and calculated the maximum C could be between B and C#. But if I want to do this for every note, that will be a lot of calculation and code for every note . There must be a better way. 2. I used modulo (thank you Andrzej Kopeć, 2015) to reduce to one octave, but as you can see the toggles are blinking when a note is played. I would like it to sustain while I am playing, then turn off when I stop playing.
      Here is the patch. Only the C that is labeled controls the volume slider.
      Thanks Wil
    • Jan 18 2022 | 3:29 pm
      A bang toggles toggle's state. You want something else - to turn on if note played matches set pitch, and to turn off if it does not. To really test and compare pitch detection objects, one has to set parameters to optimal values for what on wants to detect.
      here one simple yin~ example
    • Jan 18 2022 | 4:22 pm
      I am not a pitch detection specialist, just testet a while a couple of years ago. My knowledge is very limited and based on experience with MIDI guitar software and tuners. But in the descriptions of Charles-Jean as well as in the patch of Wil, I detect (pun intended) the same problem: Not processing the input but rather relying on some magic object and trying to suppress flickering output numbers to make the result more stable. I don't think that this method can work in a reliable way.
      Please look at the patch below. It is a quick 'n' dirty example that works reasonably well with my 6-string electric bass and has an accuracy better than 1 Hz at the lowest tone (~ 30 Hz). I believe that the three stages are necessary. Basically. And dependent on the input source of course.
      The time to detect the lowest tones can go up to almost half a second, this is about the same as with a Peterson Strobo Stomp HD, one of the best portable tuners available. By reducing the rampsmooth~ samples you can make it faster at the expense of stability. Of course, the patch doesn't work as good as a well-designed bass detector, but the result isn't bad for a quick one.
      @Wil: The parameters of [slide ...] are not ms but rather part of a formula you find in the reference page. Be careful, too high values can make your result less stable than it is or even lead to a wrong readout.
    • Jan 20 2022 | 10:58 am
      @SOURCE AUDO. Thanks for the info and the patch. Routing audio using matrix will come in very handy.
      @PETER OSTRY. Thanks for the source code for stabilizing lower frequencies. I finally tested it and works really well. I added a gate the cuts off the sound very close to zero amplitude. This eliminates any residual sound that I am getting when I am not playing a note.
      I made a patch that automatically finds the half way point (in Hz) between each note (one in octaves and one chromatic) and then splits the difference. This way, you can make copies of this patch, set all the C's, then set all of the C#'s etc. - or chromatically C - B and change octaves.
      This works well with @PETER OSTRY patch above.