can I get date-time audio was recorded?

Am using my pitch-report nyquist plugin to collect more data about guitar strings and would like to include in the report the date and time when the audio in the source audacity project was collected. If that isn’t available a useful proxy would be the datetime the source audacity project was last modified.

Is something like this possible?

I don’t see any data like this in the global variables project or track.

(print (symbol-plist '*project*))
=> (PREVIEW-DURATION 6 TIMETRACKS 0 MIDITRACKS 0 LABELTRACKS 0 WAVETRACKS 12 TRACKS 12 RATE 11025 NAME "Daddario-EJ15-extra-light-650mm-9070g" PROJECTS 1)



(print (symbol-plist '*track*))
=> (CLIPS ((0 4.36535)) FORMAT 32 RATE 11025 PAN 0 GAIN 1 END-TIME 4.36535 START-TIME 0 SPECTRAL-EDIT-ENABLED T CHANNELS 1 VIEW "Waveform" TYPE "wave" NAME "E4-650" INDEX 1)

Background: here’s an example of a report from just one track in a project:

project           Daddario-EJ15-extra-light-650mm-9070g
sample-time       0.250
sample-step-time  0.063
sample-stop-time  2.000
tracks            1

track             E2-650
number            1
average freq      83.890
variance          0.020
stdev             0.141
time              frequency         confidence        RMS
0.000             83.971            0.999             0.128
0.063             84.085            0.999             0.193
0.126             83.984            0.998             0.253
0.189             83.868            0.998             0.251
0.252             84.035            0.998             0.245
0.315             83.851            0.998             0.240
0.378             84.012            0.998             0.236
0.441             83.889            0.998             0.228
0.504             83.871            0.998             0.225
0.567             83.858            0.998             0.220
0.630             84.012            0.998             0.213
0.693             83.944            0.998             0.207
0.756             83.662            0.997             0.200
0.820             83.636            0.998             0.195
0.883             83.896            0.998             0.186
0.946             84.017            0.998             0.180
1.009             83.786            0.997             0.174
1.072             83.808            0.996             0.168
1.135             83.991            0.997             0.161
1.198             84.055            0.996             0.155
1.261             83.717            0.995             0.149
1.324             83.987            0.997             0.141
1.387             83.712            0.994             0.136
1.450             84.115            0.996             0.131
1.513             84.007            0.995             0.128
1.576             83.913            0.997             0.123
1.639             83.816            0.992             0.120
1.702             83.909            0.995             0.116
1.765             83.893            0.992             0.111
1.828             83.563            0.993             0.109
1.891             83.606            0.995             0.106
1.954             83.997            0.994             0.103

If you are “recording” (not “importing”) the tracks, then you can enable date / time to be included in the track name. See: https://manual.audacityteam.org/man/recording_preferences.html

In Nyquist, this gets the track name:

(get '*track* 'name)

Just in case it is useful for your task, you can also get the date / time that the Nyquist code is loaded:
https://wiki.audacityteam.org/wiki/Nyquist_Plug-ins_Reference#.2ASYSTEM-TIME.2A

(Note that the time / date in this property list is supplied by Audacity when it launches the Nyquist script, so you can’t use it for timing the run time of Nyquist script.)

Thanks for the tip about the recording preferences. If the feature would also work to append a date to the name for an existing empty track when I record data it would work for my purpose.

Currently I start the data collection for a specific type of six strings by opening a template project that has 12 empty tracks with with custom names and save-as the template project with a name consisting of the string manufacturer, model #, model desc, etc.

The tracks have the following custom names:

E4-650, E4-325, B3-650, B3-325, G3-650, G3-325, D3-650, D3-325, A2-650, A2-325, E2-650, E2-325

These names correspond to the nominal fundamental pitch the strings is normally used for and the scale length in mm of the string when I measure the pitch – so they are useful symbols when both recording samples of each string into the existing named tracks and also later in the data analysis process.

Am already using data from project and track in generating the report.

If there isn’t a way of getting the datetime data in my plugin I can just add the datetime manually in the name of the project when I save-as the template project.

A second option which may or may not be possible is to create another related plugin (‘pitch-report-setup’) that lets the user input data like manufacturer, product-code, product-name, etc and then generates a new project with the correct filename and adds 12 blank tracks with the symbols. IF a plugin could do this it could also add the current datetime to either the project filename or tracknames.

It is not currently possible for a plug-in to create new tracks, but that is likely to change in the near future - possibly even the next Audacity release, but I’m still waiting to see which new features will be enabled.

I added the date and time the “Pitch Detect” plugin was loaded at top of a report.

This will be good enough for now to be able to differentiate similar reports later.

fyi: this is a very specialized plugin but if anyone is interested in it or the techniques I adapted and implemented I put it in a repository on github here: https://github.com/stepheneb/pitch-report