New Tool: Run Cmd On Selection

Saves the current selection in the sample editor as temporary file, runs the supplied command line(s) on it, and replaces the selection with the result. Allows chaining and definition of GUI presets.

[center]

RunCommandsOnSelection.xrnx
Changelog[/center]

http://sox.sourceforge.net/sox.html ← some stuff there is kinda cool actually… and it’s not all audio manipulation:

!!!

I don’t particularly get what all of this is about :) , some command-line tool that lets you hack into the sample buffer, but what ere the available arguments? “sox $in $out pitch 500” on a selection in a sample gave me “There seems to be no output file”

man sox

:)

i get this too.

This only works when you have that named command line tool installed. On windows you can be sure it isn’t. On linux sox is preinstalled on most systems. Command line usage is totally forgotten on windows system anyway, not so much on linux and mac.

have just installed it,and still gets the message as jonas :D

Did you installed the tool in the path where the script refers to?

sox needs to be either in your path or the plugin folder (or instead of “sox” you need to use “full/path/to/sox”).

some more VERY USEFUL ( :P) examples:

sox $in $out synth 3 sine 300-3300 brownnoise
sox $in $out bend .35,180,.25 .15,740,.53 0,-520,.3
sox $in $out contrast 50
sox $in $out sinc -a 150 -n 300 20
sox $in $out sinc -a 150 -n 300 -16000

the bend command is kinda cool, there could a be GUI for it…

1042 soxbox.png

:D

That doesn’t hold a candle to rubberband (it just was quick to make from the rubberband plugin so I did ^^), and I don’t see myself creating a GUI for everything sox has, but at least now I can check stuff out (should I be able find it in that huge blob of documentation heh) without any work.

And if I realize I use all the time, I can put it into soxbox for convenient access. But yeah, that will never be a full plugin, sox just has too much… I’d rather find a bunch of good command presets instead, and maybe a way to give those nicknames etc.

It might even be possible to allow command presets that define their own GUI?!?! But now I’m getting waaaay ahead of myself ^^

(sox seems to complain about a “missing FMT chunk” by the way, doesn’t seem to be problem though.)

Oh, and thanks to whoever renamed the thread, that’s much better, I’ll rename the plugin accordingly… never was happy with that name. But first I want to see if I can make it execute several lines at once, each time replacing the selection, because then it would be “run commands on selection” hehe.

oh, and I’ve also gotten sox to hang, so handle with caution of course…

well, you can run any program. what happens is basically this:

renoise gets two temporary filenames from the operating system, then replaces $in and $out in the supplied command line with those filenames, and saves the current selection as a sample called $in.

then it runs the command, and that usually reads $in, does something with it, and writes the result to $out.

the script reads $out and replaces the selection with it.

(although I have begun to change that, so you can also run commands and not replace the selection with the result, or run commands that just generate audio, but don’t need/want any sample data to work on)

so it’s very simple, but it could be very powerful if you find good commandline tools :D

Nice1, got it to work putting all the sox windows install files inside your script folder! Have yet to read through the .pdfs on what is possible argument wise.

I’ve got a bunch of commandline audio tools from sound transformation software named CDP (= composers desktop project http://www.composersdesktop.com/) that are collecting dust on my HD, bet I can use these small apps somehow in combination with your script.

hehe yeah, finding good commandline tools is really the heart of it.

I wonder if I could just package sox with this? couldn’t find anything to that effect on the website, and I’ve never noticed sox packaged with anything else, so I guess not…

there’ll be an update soon(ish), with command presets, command history, not automatically expecting an input or output file, and placeholders for stuff like sample rate, bit rate, selection length etc. and a bunch of bugs of course :lol:

I think SoX is published under GPL so you can package it as long as you don’t break GPL.

Is it possible to have the commandline processing window remain open after running the script? I’m trying out if I can get some of the CDP tools to run and like to read out the messages, but the window closes at the blink of an eye :slight_smile: .

On windows, prefix the command with: cmd /k

Like this: cmd /k sox blah

thanks!

yay, thanks!!

ideas for the other platforms? I’d like to provide a checkbox to “keep the terminal window open”.

can I expect this to work on all windows platforms renoise runs on?

Ultimate n00b here, but having the terminal open through cmd /k, kills the $in (?), am getting a: Sox fail formats: can’t open input file ‘$in’, no such file or directory.

edit:

I tried your preset mentioned above ( sox $in $out bend .35,180,.25 .15,740,.53 0,-520,.3 ) in the open terminal.

well if I understood you correctly that can’t work, since the script replaces $in and $out – but once the terminal is open, you’re just straight entering commands, and the placeholders don’t get replaced.

0.2 is here, with lots of improvements and hopefully not so many bugs.