Convert any file to music

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: MattKingUSA, khz

Post Reply
neitcho
Established Member
Posts: 9
Joined: Mon Jul 14, 2008 2:11 pm
Location: Sweden
Contact:

Convert any file to music

Post by neitcho »

Have you tried this command?

Code: Select all

cat filename > /dev/dsp
This is a sample output of this image.
studio32

Re: Convert any file to music

Post by studio32 »

Can't hear anything :/

ps. do we have your blog in our planet?
neitcho
Established Member
Posts: 9
Joined: Mon Jul 14, 2008 2:11 pm
Location: Sweden
Contact:

Re: Convert any file to music

Post by neitcho »

studio32 wrote:Can't hear anything :/
I don't know if the command works on every distribution. Anyway the example ogg should work. It's recorded with low level so you might have to push the volume knob a bit.
studio32 wrote: ps. do we have your blog in our planet?
It's not there.
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: Convert any file to music

Post by raboof »

added it (assuming you don't mind), should show up soon.
neitcho
Established Member
Posts: 9
Joined: Mon Jul 14, 2008 2:11 pm
Location: Sweden
Contact:

Re: Convert any file to music

Post by neitcho »

I got a tip about a path that actually sounds musically.

Code: Select all

cat /usr/share/icons/hicolor/* > /dev/dsp
Sound with selective EQ
TraumFlug
Established Member
Posts: 16
Joined: Sat Dec 26, 2009 2:07 am

Re: Convert any file to music

Post by TraumFlug »

reminds me of old fast-tracker-][...as it needed the feature to open raw audio files, like used by amigas (those guys needed no fileheader or file extension, they knew the file would be a sample by themselves :P), you could open any arbitrary file as sample & work with it (it gets loaded as 8bit by default, but you could make it be interpreted as 16bit, too, sounds different then).

pure text files often sound kind of melodical/rythmical. nice idea to add the lyrics of a song, interpreted as sample, as some kind of sound fx. it will sound very mechanical/computerized & kind of "hard" though (without filtering).

I've just tested, the ft2-clone milkytracker can happily load raw files as samples, too, in case you'd like to experiment (it can also save the loaded raw sample as .wav for use in other progs that actually care about correct sample format headers).

I guess other audio progs that can load "raw" files do the trick, too. for example with mhwaveedit, when you open any file that does not match the audio format filters, it will ask for the sample format & load whatever you opened as sample ready for playback & modification :P
neitcho
Established Member
Posts: 9
Joined: Mon Jul 14, 2008 2:11 pm
Location: Sweden
Contact:

Re: Convert any file to music

Post by neitcho »

TraumFlug: Nice to hear about the use of things in a way it's not intended for. They say the lyrics count for 50% of the composition, now I know why :)
TraumFlug
Established Member
Posts: 16
Joined: Sat Dec 26, 2009 2:07 am

Re: Convert any file to music

Post by TraumFlug »

yay, not only lyrics, you can "hide" any data this way in you tune if you're clever enough to manage making the process reversible - in the 60's they'd play speech backwards, this hidden messages of the digital age ;)

the kind it sound reminds me of another case of transdata usage in music: aphex twin for example has some tracks where he had converted monochrome pictures to spectral data (horiziontal is time, vertical is frequency, pixel intensity is amplitude). look up his wikipedia entry, there it is mentioned, and a pic of a spectral plot of a passage of one of his songs.

when you analyze those songs with a spectral analyzer, you'll see images in the spectral plot! one track has spirals in there, another a distorted picture of the artist grinning kind of evil. listening to those passages blasts your ears off, though - it doesn't sound very musically, but hey, it's digital art! :D

does anyone know of a linux tool that can do that, too? I'd be interested, because I guess simple inverse fft of the image data would cause gaps/holes in the spectral-plot-image because of phase cancellations, maybe something really nifty would have to be done to the phases of the freqs...
TraumFlug
Established Member
Posts: 16
Joined: Sat Dec 26, 2009 2:07 am

Re: Convert any file to music

Post by TraumFlug »

sorry, not soon, but...err...put "the file" onto usb-sticks tied with rubberbands to one end of somekind of rod (somekind of "stick" of 1 meter length that isn't too uncomfortable to hold with the hands at the other end should be fine). open a piano, put a heavy rock onto the sustain-pedal, and whip the crap out of the piano strings with the above rod. record that somehow. or...print out a hexdump of the file onto sheets of paper, and then record how you sing the byte numbers in improvised melody, or wrap a sheet around a comb and do that good old trick...punching/ripping the paper results in sounds usable for percussion if remastered properly, or...no, wait I'll stop here, and: do at your own risk ;) :twisted:

you need to be more specifically on what you want; or better: what is "the file" and what kind of music do you wish to produce from it? this thread is about "random" data abused as raw sample information. there's some ways to do that, read the above, ask if you need more info, but please ask clever (not too generic). however, most stuff will sound like noise and/or metallic buzzes, and playing that stuff too loud is surely unhealthy for the soundcard (and your ears, too). copying some files to /dev/dsp is probably the most crude (and most funny) way to do that (turn down volume a lot before, or.....!!!!). what I added was that sample editors can be abused to load any file. the resulting, barbaric noise could then for example be edited and used as basis for music production.

by the way, it'd be funny to convert data to music by some more sophisticated means, i.e. define a scale & interpret the data as note numbers and lengths on that scale, managed by somekind of framework that actually makes it sound musical...converting data to music is such a wide field, after all it's just numbers that can be twisted into anything if processed properly.

(EDIT)...err, I'm dumb I see now. someone called "elisa...", writing in a pretty strange way...maybe the user account status "human" should be changed...?
hiunicorn
Posts: 1
Joined: Fri Oct 15, 2010 8:57 am

Re: Convert any file to music

Post by hiunicorn »

might be a stupid question but how can i save this as a soundfile? i thought i can simply record it but when i start jack it says that the dev/dsp is already used. something like cat /home/justin/Desktop/file->sound/titanic.jpg > /dev/dsp > titanic_sound.mp3 didn´t work either :(
TraumFlug
Established Member
Posts: 16
Joined: Sat Dec 26, 2009 2:07 am

Re: Convert any file to music

Post by TraumFlug »

try what I suggested above: install some good sample editor (mhwaveedit does this well), and open the file (yes, the .jpg!) with it, trying different configurations as for how to interpret the input data, until you find the settings that sound like the "cat" command to dev/dsp. then you can edit (eq'ing out the high freqs does good on such tasks...) and just save as .wav or whatever you like. hard of course for multiple files, you'd need to concatenate them (for example with cat & streaming ">>" into the output file..., maybe? I'm not so good at unix console commands...) to a single file, first.
User avatar
zwenny
Established Member
Posts: 84
Joined: Mon May 17, 2010 12:42 pm

Re: Convert any file to music

Post by zwenny »

hiunicorn wrote:[...] something like cat /home/justin/Desktop/file->sound/titanic.jpg > /dev/dsp > titanic_sound.mp3 didn´t work either :(
What about using a pipe.

Code: Select all

cat /home/justin/Desktop/titanic.jpg > /dev/dsp | cat /dev/dsp > /home/justin/Desktop/titanic.wav
Another question: Is this only working with /dev/dsp (Old OSS) or is it the same with /dev/audio?
Looking forward to look back what happens now

Listen to my music at:
https://www.jamendo.com/artist/373939/zwenny
Post Reply