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.
Renoise popens “renoise-open-wrapper filename.ext”
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.
- You are trying to open snare.mp3
- Renoise can’t open it and runs “renoise-open-wrapper /home/suva/samples/snare.mp3”
- Wrapper runs command “lame --decode /home/suva/samples/snare.mp3 -o /dev/stdout”
- Renoise reads the output as if it was WAV file and opens it as sample.
I could easily post a script that converts MP3, MPC, WAVPACK, etc. formats + extract audio from video files by this evening.
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.
Sounds like a good method for Mp3 import.
Not only MP3. This script I wrote in 10 already imports dozens of different formats and adding new ones is no problem. Not even .sid, .nsf, etc.
Okay… then write us a few other tracker like .669 and .s3m import converters as well
Renoise doesn’t open S3M?
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):
<checkavailabilitycommand>"lame --version > /dev/null || exit 1</checkavailabilitycommand><br>
<decodecommand>lame --decode "$1" - 2> /dev/null</decodecommand><br>
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.