New to the MPC production world? Got a music production question that's not really specific to any particular MPC? Try your luck here and get help from our experienced members.
By metsaehinen Tue Mar 08, 2011 3:08 pm
..and I mean multiple samples at the same time. It takes too much time to convert samples one by one. I use Linux and need to convert my samples to work with mpc-500. Anyone got solution?

I found this guide from here:

9. Changing the Sampling Size of a Sound File

If we increase the sampling size , we will get better quality. Sample Size for audio is most often expressed as 8 bits or 16 bits. 8bit audio is more often used for voice recording.

* -b Sample data size in bytes
* -w Sample data size in words
* -l Sample data size in long words
* -d Sample data size in double long words

The following example will convert 8-bit audio file to 16-bit audio file.

$ sox -b input.wav -w output.wav
User avatar
By nogginj Tue Mar 08, 2011 5:14 pm
Howdy
Can't you use a wildcard to select your files?

You could move all the files you want to convert to one directory.

cd into that directory.

Then run:
Code: Select allsox -r 44100 -b 16 *.wav output%n.wav


That SHOULD create a number of files named outputXX.wav where XX is an incrementing number.

I could be totally wrong, I haven't used sox in a while.

Code: Select allman sox
- you know is the manual and might shed some more light on the situation.

EDIT: a little further investigation leads me to believe you might need to do this in a shell script. this is probably a pretty easy script to write and a good excuse to learn if you have never done it.
User avatar
By Pastor-of-Muppets Tue Mar 08, 2011 5:16 pm
metsaehinen wrote:.I use Linux and need to convert my samples to work with mpc-500. Anyone got solution?

this is p!ss easy with linux

metsaehinen wrote:I found this guide from here:

9. Changing the Sampling Size of a Sound File

If we increase the sampling size , we will get better quality. Sample Size for audio is most often expressed as 8 bits or 16 bits. 8bit audio is more often used for voice recording.

* -b Sample data size in bytes
* -w Sample data size in words
* -l Sample data size in long words
* -d Sample data size in double long words

The following example will convert 8-bit audio file to 16-bit audio file.

$ sox -b input.wav -w output.wav


you've just answered your own question, can't you figure it out?!

sox -l input.wav -w output.wav
User avatar
By Pastor-of-Muppets Tue Mar 08, 2011 5:31 pm
that'll do it for all wav files in the current directory, putting the converted files in a new sub-directory called 'fixed'

if you need it for an entire directory hierarchy, and you want to modify the original files (not create new ones) then ...

Code: Select alltmpfile=/tmp/tmp.wav
find . -name '*.wav' | while read f
do
     sox -l "$f" -w -r 44100 $tmpfile && mv $tmpfile "$f"
done


Edit: added quotes to handle filenames with spaces in
Edit: the $tmpfile needs to have a .wav extension or sox doesn't know what format it is
Last edited by Pastor-of-Muppets on Tue Mar 08, 2011 5:40 pm, edited 2 times in total.