Automatically converting frequencies to note names with pYin plugin

Hi everyone,

I’m currently using Audacity with the pYin:Notes plugin to recognize notes in a melody by extracting their frequencies. However, I’m looking for a way to automatically convert these frequencies into note names (e.g., E3, D#4) and have them displayed directly in Audacity.

It seems like a simple thing, but I can’t find a solution and feel a bit stuck.
By the way, there is a plugin called Chordino:Chord Estimate, and it works fine with chords.

How it looks with frequencies:


I want to replace frequency values with note names.

I also found a plugin named note-frequency.ny pitch-detect.ny , which does something similar but only for a single note.

So, is there a way to create or use an existing plugin (maybe Nyquist?) or any other method in Audacity to automatically convert the frequencies detected by pYin into note names?

Thanks in advance!

There is pitch-detect.ny from this post: Pitch detection plug-in

My mistake - I wrote note-frequency.ny instead of pitch-detect.ny. Mixed up

Pitch-detect.ny works good for a single note (1 second), but not for all song.

.

Hello again. I tried to create nyquist plugin to convert the frequencies detected by pYin into note names. That was a real challenge for me as I have no knowledge of LISP/Nyquist/SAL.

I analysed some plugins and made a script which creates a copy of label track.

(let ((labels (nth 1 (nth 0 (aud-get-info "labels")))))
  (do ((count 0 (+ 1 count)))
      ((>= count (length labels)) labels)
    (let ((end (nth 1 (nth count labels)))
          (notevalue  (nth 2 (nth count labels))))
      (setf notevalue (format nil "~a" notevalue))
      (setf (nth 2 (nth count labels)) notevalue))))

The end variable was used for testing:
Line (setf notevalue (format nil “~a” (- end 5))) - works fine;
Line (setf notevalue (format nil “~a” (- notevalue 5))) - doesn’t…
Error: bad argument type. It seems like notevalue is being treated as a string…

I guessed that I have to replace dots by commas, cause my labels looks like 103.596. So I add subst #, #. notevalue* - didn’t help (and it was wrong idea).

Later I found a function number-string-p and that was exactly what I was looking for. Notevalue became a float and I did that:

(let ((labels (nth 1 (nth 0 (aud-get-info "labels")))))
  (do ((count 0 (+ 1 count)))
      ((>= count (length labels)) labels)
    (let ((notevalue (number-string-p (nth 2 (nth count labels)))))
      (setf notevalue (format nil "~a" (round (* 12 (/ (log (/ notevalue 440.0)) (log 2.0))))))
      (setf (nth 2 (nth count labels)) notevalue))))

Script gives a track of labels with number (semitones) how far from A4 note is current label mark (frequencies detected by pYin).

I hope to finish it later and get a track of labels with note names…

This topic was automatically closed after 30 days. New replies are no longer allowed.