9 ways to NRT, part 1: NRT and Echo


Welcome to part 1 of 9 Ways to NRT!

Today, I'm going to demystify what this command means:

$ echo "d4. r8 m2" | nrt 

And explain what is being output by NRT.


A large of getting NRT to be powerful is through the use of pipes on linux with the "|" character. In this case we are piping some nrt notes to NRT with builtin echo command.


Running our command should give the following output:

$ echo "d4. r8 m2" | nrt 

NRT is taking our piped input and spitting out a text table of comma separated values. There are three values on each line. These values are start time, duration, and note number.

Time printed in NRT is in seconds, and the implied BPM of NRT output is 60. (This means that a half note is 0.5 seconds, a quarter note is 1 second, a half note is 2 seconds, etc..) The best practice for changing the tempo is to have another program handle it.

The note number is an integer. Without any octave shifts, the notes drmfsltDRMFSLTD can produce an integer with the range of 0 and 24. These notes can be offset with a root MIDI note number The best practice is to have NRT output sent to another program to assign proper keys and ranges.