More sounds#

To get more sounds you can use some music software like MuseScore, Sibelius, etc, and create a file like this:

_images/all_notes.png

As you can see, it has 84 notes, that is, the complete 7 octaves of a piano.

You render this file to mp3 and with some simple Bash or Python script you can get all the piano notes, an example with Bash is the following:

#!/bin/bash

file="${1}"
start="${2}"
end="${3}"
duration="${4:-2}" # Default: 2
size="${5:-4}"     # Default: 4
DIR="${6:-notes}"  # Default: "notes"

echo "file:     ${file}"
echo "start at: ${start}"
echo "end at:   ${end} (notes)"
echo "duration: ${duration}s per note"
echo "size:     ${size}s to next note"
echo "DIR:      ${DIR}"

if [ -d "$DIR" ];
then
  echo "$DIR directory exists, removing"
  rm -rf "${DIR}"
  mkdir "${DIR}"
else
  echo "$DIR directory does not exist, creating folder".
  mkdir "${DIR}"
fi

for ((i=start;i<=end;i++));do
  i_fixed=$((i * size))
  echo "ffmpeg -ss ${i_fixed}.03 -t ${duration} -i ${file} -c:a copy ${DIR}/${i}.mp3"
  ffmpeg -hide_banner -loglevel error \
    -ss "${i_fixed}.03" -t "${duration}" -i "${file}" -c:a copy "${DIR}/${i}.mp3"
done

The way to use this file is simple, first you enter the name of the mp3 file (file), the initial value (start), the final value (end), the duration of each note (duration), the time between the start from one note to the next (size) and the directory (DIR).

In our file we have that there are 15 crotchet per minute, so an eighth note lasts 2 seconds, and the time between each note is 4 seconds because we leave a silence in the middle.

The script to get all the notes would be (assuming the script is called get-notes):

$ ./get-notes file.mp3 0 84 3 4

The reason why I left it 3 seconds instead of 2 seconds is because some instruments last longer even if they stop being played, and that extra second is for the sound to conclude and not end abruptly.

You can also export the file to MIDI and use some program with virtual instruments to get the desired sound file.