Page 2 of 2

Re: how to run YIN starting at sound start + 0.25s?

Posted: Tue Jan 05, 2021 4:49 pm
by JimWI

Re: how to run YIN starting at sound start + 0.25s?

Posted: Tue Jan 05, 2021 5:04 pm
by stepheneb
steve wrote:
Tue Jan 05, 2021 4:14 pm
JimWI wrote:
Tue Jan 05, 2021 3:53 pm
Any suggestions?
My guess is that you are trying to use the code on a stereo track.
stepheneb's code is written for mono tracks only.
Yes.

When I record in Audacity I'm collecting stereo data but delete one of the channels before running my scripts on mono data.

Re: how to run YIN starting at sound start + 0.25s?

Posted: Tue Jan 05, 2021 5:58 pm
by steve
JimWI wrote:
Tue Jan 05, 2021 4:49 pm
If it helps, I put 2 test files here:
https://chambersislandusa.com/mando/aud ... tnotes.wav (4 secs long)
https://chambersislandusa.com/mando/aud ... enotes.wav (12 secs)
Results from "testones.wav"

Code: Select all

time		frequency	RMS
0.000	5512.501		0.002
0.500	441.234		0.041
1.000	495.712		0.104
1.500	495.898		0.042
2.000	556.505		0.117
2.500	554.872		0.028
3.000	590.785		0.026
3.500	659.309		0.092
4.000	659.394		0.022


Re: how to run YIN starting at sound start + 0.25s?

Posted: Tue Jan 05, 2021 6:01 pm
by steve
JimWI wrote:
Tue Jan 05, 2021 3:53 pm
Hello: I just tried your "updated" example on a file of mine with 5 mandolin notes recorded. The out I received was:
Nyquist !
%1.3f
I'd love to be able to get the frequencies and the time durations, as shown in your table.
Any suggestions?
Jim
Please post the full code that you are using.
When posting, use the "code tags" from the "</>" button around the code like this:

[code]
code goes here
[/code]


When you run the code in the Nyquist prompt, click the "Debug" button rather than the "OK" button.
After the code has run, the debug window will open. Copy the contents of the debug window and include it (in "code" tags) in your reply.

Re: how to run YIN starting at sound start + 0.25s?

Posted: Tue Jan 05, 2021 7:41 pm
by JimWI
Steve and steveneb:

Thanks!! Both files are mono.
Got it. Had to run it using the Nyquist prompt. I was running it from the Analyze tab.
Is there an 'easy' way to save the output to a file?

Thanks again!
Jim

Re: how to run YIN starting at sound start + 0.25s?

Posted: Tue Jan 05, 2021 8:16 pm
by steve
JimWI wrote:
Tue Jan 05, 2021 7:41 pm
Is there an 'easy' way to save the output to a file?
Saving can be written into the Nyquist script, but the "easy" way:

Now that you have it working.

1. "Help menu > Diagnostics > Show Log"
2. In the log window, click "Clear"
3. Run the Nyquist script again, but use the "OK" button this time.

Notice that the output appears in the Audacity log window.

You can now either "Save" the contents of the log window, or copy and paste from the log window.

Re: how to run YIN starting at sound start + 0.25s?

Posted: Fri Jan 08, 2021 4:18 pm
by JimWI
I got the output window to show on both my test files. I noticed that the output shows frequencies in 0.5 sec intervals. What do I change to get frequencies to show in smaller intervals, as 0.1 sec? Does it have something to do with the "dur' variable?
Thanks in advance.

Re: how to run YIN starting at sound start + 0.25s?

Posted: Fri Jan 08, 2021 5:06 pm
by JimWI
I found it. I wasn't looking very hard. It's the "window-time" variable.
Thanks for all the help.
Jim