raw data to audio

classic Classic list List threaded Threaded
13 messages Options
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

raw data to audio

hello, in audacity there is function  file-import-raw data and then you can get yasunao tone "wounded cd" type of sound (noise)
also i stumbled upon this guy  ,as i understand he is using hdd as input device for dd
 and then routes to gstreamer which converts raw data input into audio signal... how?
is anyone here ever tried something like that? any tips, suggestions? clueless so far...
grant centauri grant centauri
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

Here's something simple I think Aymeric showed me once:

sudo cat /dev/mem > /dev/dsp

this should be writing raw data from the ram (?) directly to the audio device.

I played around with generating pitch by filling a file with various patterns of 0's and 1's and then cat file > /dev/dsp .  It follows what you'd expect. 010101010101 generated a pitch an octave above 0011001100110011.  

/dev/mem sounds pretty great right now. 

/dev/urandom generates noise, though I'm not sure what kind.  Anyone have an idea about it?

Regular files are a specific length and will be the same every time, as long as they aren't modified.  Listening to a pdf right now that has some nice spots.

Is this what you're talking about?  What different ways are there to get this into a signal chain?  I'm not familiar with gstreamer. 

Perhaps there's a way to read a file at an audio rate and use its data to fill a wavetable in Puredata, or something like that.

Just some thoughts.  No specific solution.

-grant

On Mon, Aug 22, 2011 at 3:46 PM, KarlHungus <[hidden email]> wrote:
hello, in audacity there is function  file-import-raw data and then you can
get yasunao tone "wounded cd" type of sound (noise)
also i stumbled upon this
http://reboot.fm/2011/08/14/substrat-radio-2-data-carvery/ guy   ,as i
understand he is using hdd as input device for
http://en.wikipedia.org/wiki/Dd_%28Unix%29 dd
 and then routes to gstreamer which converts raw data input into audio
signal... how?
is anyone here ever tried something like that? any tips, suggestions?
clueless so far...


--
View this message in context: http://puredyne.466513.n3.nabble.com/raw-data-to-audio-tp3276288p3276288.html
Sent from the Puredyne mailing list archive at Nabble.com.
---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne


---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

yes! this is exactly what i searched for, thanks
is it possible to sonify incoming wifi this way?
what other possible inputs there might be?
martin martin
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

In reply to this post by KarlHungus

As one of the (ir)responsible carvers (the other being Danja
Vassiliev), the full command which danja used on the show was:

dd if=/dev/sdb | gst-launch-0.10 filesrc location=/dev/stdin ! queue ! tee name=v ! queue ! videoparse framerate=1 ! videoscale ! video/x-raw-yuv, width=40, height=30 ! videorate ! audioparse ! audiorate ! alsasink v. ! queue leaky=2 ! videoparse width=640 height=480 ! videoscale ! videorate ! xvimagesink sync=false

which also routes the HD data flow to the screen for unbroadcast
visual feedback/fun!

Of course, as suggested a straight:

dd if=/dev/sdb of=/dev/dsp

would do the trcik albeit at a lower bitrate (and in both examples
with /dev/sdb representing th USB-attached hard drive).

best wishes
Martin



On Mon, 22 Aug 2011 13:46:53 -0700 (PDT), KarlHungus <[hidden email]> said:

    KarlHungus> hello, in audacity there is function file-import-raw
    KarlHungus> data and then you can get yasunao tone "wounded cd"
    KarlHungus> type of sound (noise) also i stumbled upon this
    KarlHungus> http://reboot.fm/2011/08/14/substrat-radio-2-data-carvery/
    KarlHungus> guy ,as i understand he is using hdd as input device
    KarlHungus> for http://en.wikipedia.org/wiki/Dd_%28Unix%29 dd and
    KarlHungus> then routes to gstreamer which converts raw data input
    KarlHungus> into audio signal... how?  is anyone here ever tried
    KarlHungus> something like that? any tips, suggestions?  clueless
    KarlHungus> so far...


    KarlHungus> -- View this message in context:
    KarlHungus> http://puredyne.466513.n3.nabble.com/raw-data-to-audio-tp3276288p3276288.html
    KarlHungus> Sent from the Puredyne mailing list archive at
    KarlHungus> Nabble.com.  --- [hidden email]
    KarlHungus> http://identi.ca/group/puredyne
    KarlHungus> irc://irc.goto10.org/puredyne
---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

thank you for this martin, i find your and danjas work very interesting
gonna check that video code
but i also really would like to know how to route this audio madness further
say dd if=/dev/sdb of=/dev/dsp    so it becomes readable client in jack with alsa? is there something like a bridge, so i can route the audio signal to  say supercollider 3 for further real time manipulations etc.anyone?

also i found this code today:
 find . -name '*.exe' -exec cat {} > /dev/audio \;
exe files sounds exceptionally well :)
also if there is some good links about people who make noise in terminal,let me know
cheers



martin martin
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio


Although untested:

mplayer -demuxer rawaudio /dev/sdb -ao jack

might work (with more options to demuxer also).

Another option is:

cat /dev/sdb | ecasound -i stdin -o jack

But again untested as a while since I use JACK!

M

On Tue, 23 Aug 2011 06:19:00 -0700 (PDT), KarlHungus <[hidden email]> said:

    KarlHungus> thank you for this martin, i find your and danjas work
    KarlHungus> very interesting gonna check that video code but i
    KarlHungus> also really would like to know how to route this audio
    KarlHungus> madness further say dd if=/dev/sdb of=/dev/dsp so it
    KarlHungus> becomes readable client in jack with alsa? is there
    KarlHungus> something like a bridge, so i can route the audio
    KarlHungus> signal to say supercollider 3 for further real time
    KarlHungus> manipulations etc.anyone?

    KarlHungus> also i found this code today: find . -name '*.exe'
    KarlHungus> -exec cat {} > /dev/audio \; exe files sounds
    KarlHungus> exceptionally well :) also if there is some good links
    KarlHungus> about people who make noise in terminal,let me know
    KarlHungus> cheers





    KarlHungus> -- View this message in context:
    KarlHungus> http://puredyne.466513.n3.nabble.com/raw-data-to-audio-tp3276288p3277967.html
    KarlHungus> Sent from the Puredyne mailing list archive at
    KarlHungus> Nabble.com.  --- [hidden email]
    KarlHungus> http://identi.ca/group/puredyne
    KarlHungus> irc://irc.goto10.org/puredyne
---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
Claude Heiland-Allen-2 Claude Heiland-Allen-2
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

In reply to this post by KarlHungus
On 23/08/11 14:19, KarlHungus wrote:
> but i also really would like to know how to route this audio madness further
> say dd if=/dev/sdb of=/dev/dsp    so it becomes readable client in jack with
> alsa?

# assuming jack is running at 48000 and want to resample from 8000

ecasound -f:s16_le,1,48000 \
   -i:resample-hq,8000,sndfile,/usr/bin/mplayer,.raw \
   -o:jack,system

> is there something like a bridge, so i can route the audio signal to
> say supercollider 3 for further real time manipulations etc.anyone?

# untested

mkfifo bridge.fifo
sudo cat /dev/mem >> bridge.fifo &
ecasound -f:s16_le,1,48000 \
   -i:resample-hq,8000,sndfile,bridge.fifo,.raw \
   -o:jack,system


Claude
---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

all your methods worked, i can route the signal now, thanks a lot guys!!!
i try to access incoming wifi this way but i cant figure out which dev is this
thought cat /dev/network_throughput> /dev/audio   should work but it doesn't
anyone?
Aymeric Mansoux Aymeric Mansoux
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

In reply to this post by KarlHungus
KarlHungus said :

> hello, in audacity there is function  file-import-raw data and then you can
> get yasunao tone "wounded cd" type of sound (noise)
> also i stumbled upon this
> http://reboot.fm/2011/08/14/substrat-radio-2-data-carvery/ guy   ,as i
> understand he is using hdd as input device for
> http://en.wikipedia.org/wiki/Dd_%28Unix%29 dd
>  and then routes to gstreamer which converts raw data input into audio
> signal... how?
> is anyone here ever tried something like that? any tips, suggestions?
> clueless so far...

Anything that you can pipe or redirect the output of can be used.

I mean really anything :)
(well you might have the kernel complain if you want to tac/sort
dev/mem, but other than that...)

grant centauri said :
> Here's something simple I think Aymeric showed me once:
>
> sudo cat /dev/mem > /dev/dsp

Can't remember the first time I saw this trick myself. What is sure is
that the Unix pipeline/redirection penny dropped the day I typed it in a
terminal and started to add more things to it :)

BTW, we used 'cat /dev/mem > /dev/dsp' for Puredyne as a startup chime
back in 2005.

### crappy bash script circa 2005 #########
if test -e /dev/dsp ; then
    (cat /dev/mem > /dev/dsp)&
    (sleep 6.66 && kill `pidof cat /dev/mem`)&
fi
##############################################


> this should be writing raw data from the ram (?) directly to the audio
> device.

* cat prints the memory (as in the image of the physical memory as
  provided by /dev/mem) on stdout

* '>' sends it to a file

* the file we choose to send to it is a special one, a device file, that
  is an interface to the OSS device driver that is in charge of playing
  and capturing sound (modprobe snd-pcm-oss if this file is missing)

Thus, doing the opposite, cat /dev/dsp > /dev/mem will rewrite your
memory with whatever comes from the microphone (a great party trick!).


> /dev/urandom generates noise, though I'm not sure what kind.  Anyone
> have an idea about it?

It's a pseudorandom number generator - man urandom ;)


> Perhaps there's a way to read a file at an audio rate and use its data
> to fill a wavetable in Puredata, or something like that.

[pdp_rawin] is nice to play with as well.


KarlHungus said :
> yes! this is exactly what i searched for, thanks
> is it possible to sonify incoming wifi this way?
> what other possible inputs there might be?

# quick and dirty
tcpdump -i wlan0 -s 0 -w - > /dev/dsp

Then go on the interweb and browse away.

 
martin said :
> As one of the (ir)responsible carvers (the other being Danja
> Vassiliev), the full command which danja used on the show was:
>
> dd if=/dev/sdb | gst-launch-0.10 filesrc location=/dev/stdin ! queue !
> tee name=v ! queue ! videoparse framerate=1 ! videoscale !
> video/x-raw-yuv, width=40, height=30 ! videorate ! audioparse !
> audiorate ! alsasink v. ! queue leaky=2 ! videoparse width=640
> height=480 ! videoscale ! videorate ! xvimagesink sync=false

nice :)

I should find all my /dev/dsp oneliners and publish them, or better,
make an 0xA .sh musicmag with it.


KarlHungus said :
> but i also really would like to know how to route this audio madness further
> say dd if=/dev/sdb of=/dev/dsp

Next to what Martin and Claude said, this stuff looks nice too (also
untested) http://fort.xdas.com/~kor/oss2jack/
   

a.
--
http://su.kuri.mu

---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

KarlHungus said :
> is it possible to sonify incoming wifi this way?
Aymeric Mansoux said:
# quick and dirty
tcpdump -i wlan0 -s 0 -w - > /dev/dsp
Then go on the interweb and browse away.

somehow this doesn't work on my machine
terminal throws command not found: tcpdump...
alejoo alejoo
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

In reply to this post by KarlHungus

On Aug 24, 2011, at 2:00 PM, [hidden email] wrote:

>
>   7. Re: raw data to audio (KarlHungus)
>
> KarlHungus said :
>> is it possible to sonify incoming wifi this way?
> Aymeric Mansoux said:
> # quick and dirty
> tcpdump -i wlan0 -s 0 -w - > /dev/dsp
> Then go on the interweb and browse away.
>
> somehow this doesn't work on my machine
> terminal throws command not found: tcpdump...

for netrelated stuff you can also use packetpunk, it wil route to jack:
http://redmine.znerol.ch/projects/packetpunk
https://launchpad.net/~alejoduque/+archive/soup/+sourcepub/1015849/+listing-archive-extra
(as part of an old project: http://soup.znerol.ch/en/node/74)

on pd you have the object promiscous~ from ext13



---
[hidden email]
http://identi.ca/group/puredyne
irc://irc.goto10.org/puredyne
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

thanks! gonna try that
KarlHungus KarlHungus
Reply | Threaded
Open this post in threaded view
|

Re: [puredyne] raw data to audio

In reply to this post by martin
finally remembered to try out this code martin shared, which supposed to generate video from raw data

dd if=/dev/sda | gst-launch-0.10 filesrc location=/dev/stdin ! queue ! tee name=v ! queue ! videoparse framerate=1 ! videoscale ! video/x-raw-yuv, width=40, height=30 ! videorate ! audioparse ! audiorate ! alsasink v. ! queue leaky=2 ! videoparse width=640 height=480 ! videoscale ! videorate ! xvimagesink sync=false


but it doesn't work for me :

(gst-launch-0.10:2700): GLib-WARNING **: g_set_prgname() called multiple times
WARNING: erroneous pipeline: no element "videoparse"
zsh: broken pipe  dd if=/dev/sda |
zsh: exit 1       gst-launch-0.10 filesrc location=/dev/stdin ! queue ! tee name=v ! queue !  
(~) % (gst-launch-0.10:2700): GLib-WARNING **: g_set_prgname() called multiple times

what seems to be the problem?
also is there some simpler ways to get visual output ?