mdl icon indicating copy to clipboard operation
mdl copied to clipboard

Lossless version with .flac files

Open kmturley opened this issue 3 years ago • 0 comments

Currently samples are .ogg vorbis format:

  • Vorbis Audio
  • Stereo
  • 44100 Hz
  • 192k/s https://github.com/musescore/mdl/blob/master/resources/sound/MDL_samples/auxiliary/agogo_high_F.ogg

Ogg Vorbis is a lossy format which is not ideal for high-quality sounding performances/recordings.

Within the SFZ and Soundfont world it is a standard to share instruments in a lossless format such as:

  • .wav
  • .flac https://github.com/sfzinstruments

You can create a "compact" lossy version by converting .flac back to .ogg afterwards using the commands.

  1. Convert .flac to .ogg using ffmpeg for file in $(find . -type f -name '*.flac'); do ffmpeg -i "$file" -b:a 192k "${file%.*}.ogg"; done

  2. replace all references of flac to ogg in sfz files find . -type f \( -iname \*.sfz -o -iname \*.txt \) -exec sed -i -e 's/flac/ogg/g' {} \;

  3. Delete the old .flac files find . -type f -name '*.flac' -type f -delete

This can be run in GitHub CI such as: https://github.com/studiorack/studiorack-workflows/blob/main/.github/workflows/sfz.yml#L97

Of course none of this is possible without the lossless versions being the originals

kmturley avatar Oct 07 '22 04:10 kmturley