From 9012a6a9d83fdaa60d273364a3d05318c6680284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Le=20Bihan?= Date: Mon, 8 Jan 2024 22:50:20 +0100 Subject: [PATCH] new script to generate mp3s --- assets/create_melodies.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assets/create_melodies.sh b/assets/create_melodies.sh index e870e8f..a8013d3 100755 --- a/assets/create_melodies.sh +++ b/assets/create_melodies.sh @@ -3,14 +3,15 @@ # Iterate through subfolders find . -type d | while read -r dir; do # Check if .midi file exists in the subfolder - midi_file=$(find "$dir" -maxdepth 1 -type f -name '*.midi' -o -name '*.mid' | head -n 1) + midi_file=$(find "$dir" -maxdepth 1 -type f -name '*.midi' | head -n 1) if [ -n "$midi_file" ]; then # Create output file name (melody.mp3) in the same subfolder output_file="${dir}/melody.mp3" # Run the given command - timidity "$midi_file" -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 64k "$output_file" + #timidity "$midi_file" -Ow -o - | ffmpeg -i - -acodec libmp3lame -ab 64k "$output_file" + fluidsynth -a alsa -T raw -F - "$midi_file" | ffmpeg -f s32le -i - "$output_file" echo "Converted: $midi_file to $output_file" fi