Importing txt file into Audacity (time instants into taps)

Hi everyone,

I’m very new to this so apologies if my question is a bit silly.

I have created a sequence of time instants using Sonic Visualiser. These time instants correspond to some tapping I recorded and I have saved them into a .txt file (so basically, I tapped along to some music using Sonic Visualiser, I recorded my tapping and exported a file with the time that each tap happened.)

I now want to import this .txt file onto Audacity and somehow “make” it sound like an audio track with taps. Is that possible in Audacity? I.e., import time data in a .txt file and “play” them as a rhythmic track.

Any thoughts on this would be much appreciated. Thank you very much for your time :slight_smile:

(p.s. I’m using Windows 10 and Audacity 2.4.2)

I now want to import this .txt file onto Audacity and somehow “make” it sound like an audio track with taps. Is that possible in Audacity? I.e., import time data in a .txt file and “play” them as a rhythmic track.

I don’t know what kind of text file the Sonic Visualizer generates, but probably not… I have a feeling you’ll loose the timing information (and the data is likely formatted wrong for Audacity.)

Tools → Sample Data Export and Sample Date Import can import/export text files but it has to be text of the sample values in the range of +/-1. i.e. With “CD quality” audio there are 44,100 samples per second. This makes HUGE files, bigger than WAV files since it takes more bytes to store the text representation of a value than to directly store the numerical value.

Here is an example of what that text looks like, just a few samples (less than 1 millisecond of audio) and this particular file has two samples per line since it’s stereo:

-0.00963 0.00055
-0.00190 0.00767
0.00459 0.01539
0.01186 0.02680
0.01632 0.03718
0.01693 0.03875
0.01837 0.03639
0.02158 0.03298
0.02704 0.02817

Thanks very much for your reply.

I think I know what you mean but that may not work in my case. The text file I have contains data related to time e.g.:

5.830000000
6.546190476
7.260136054
7.982108844
8.698843537
9.431904762

which represent seconds and milliseconds from the beginning of the track.

I was wondering if you knew another way to produce a rhythm track in audacity (like a metronome) but with time points that I choose, i.e. asking audacity to produce a “click” on a specific time point e.g. on 5.83000000 seconds. If not Audacity, do you know any other software that could do that?

I know it may sound weird what I’m trying to do, but it’s for a music psychology research experiment. I want to create a jittered tapping sequence that will be played on top of a music track and I will ask my participants to tell me how synchronised they think the tapping sequence is with the beat of the music. I could just record a tapping sequence that is not quite synchronised with the beat of the music but I have to do it more methodically with specific time points and specific ms off the beat. So all I need is to produce a tapping sequence that sounds like it has been produced by someone who is not very good at tapping along with the music.

Hope that makes sense. Thanks again for your help :smiley:

For the first tap sound, use a mono recording, or generate a tick with the “Rhythm Track” plug-in, or just import this sound:

Whatever you use, it should be a short, mono sound.

Select the sound, then run this code in the Nyquist Prompt effect (https://manual.audacityteam.org/man/nyquist_prompt.html):

(setf times (list
5.830000000
6.546190476
7.260136054
7.982108844
8.698843537
9.431904762))


(defun snd (t0)
  (sim (s-rest 0)
    (at-abs t0 (cue *track*))))

(simrep (i (length times)) (snd (nth i times)))

(note that the list of times is copied directly from your post)

Due to a bug in Audacity 3.0.2, it will not work correctly in that version - use Audacity 3.0.3.

Hi Steve,

That is extremely helpful, thank you so much for this! It works perfectly :smiley:

I’m so happy, thanks very much for your help and I wish you all the best!!