Hey, as there is a linux version of the Renoise why not take advantage of some linux ways of making things. Apparently the Linux version can’t open MP3 for now, and probably not many other things aswell… So I am proposing this method for opening files.
On renoise startup renoise checks if there is a “renoise-open-wrapper” command. If it exists it activates following mechanism:
You are trying to open a file which Renoise doesn’t support.
The renoise-fopen-wrapper is a standalone script somewhere on path, which checks the file format and tries to convert in arbitrary way.
The wrapper outputs the converted file contents to stdout, renoise reads it and does the usual stuff renoise does when opening a sample/instrument/module.
In case wrapper returns non-zero exit status, renoise acts like it normally acts when it can’t detect the file format.
Example:
You are trying to open snare.mp3
Renoise can’t open it and runs “renoise-open-wrapper /home/suva/samples/snare.mp3”
Hey, here is an example of the wrapper. This one currently can decode MP3, WavePack (wv) and MusePack (mpc) formats. If it doesn’t detect decent decoder it tries with sox which additionally supports: 8svx aif aifc aiff aiffc al alsa au auto avr caf cdda cdr cvs cvsd dat dvms fap fssd gsm hcom ima ircam la lu mat mat4 mat5 maud mp2 mp3 nist nul null ogg ossdsp paf prc pvf raw s3 sb sd2 sds sf sl smp snd sndfile sndt sou sph sw txw u3 u4 ub ul uw vms voc vorbis vox w64 wav wve xa xi decoders. But some of the sox decoders are bit broken.
Works nice. Additional format supports and fallbacks can be added easily.
Great idea, but we’ll need a way to tell renoise which kind of files the “renoise-open-wrapper” can open, so that we can offer them as samples in the diskbrowser.
So instead of using a sh we could use a simple xml file like (just a draft):
Renoise would then parse the XML on startup, check which decoders are present via ‘CheckAvailabilityCommand’, then offer the extensions in the browser and decode them via ‘DecodeCommand’…
Yeah, that will probably work much better. Only thing to remember: Doing this kind of opening won’t let you seek in the file. This may or may not be a problem, depending on a sample load implementation.