Live data from Hacker News

'Music' from /dev/urandom

blog.robertelder.org

41–50 of 58 posts

Re: 'Music' from /dev/urandom

#41
post #38
post #3

Here is one with the blues scale. From time to time it grooves really nice. cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,3,5,6,7,10,12",a,","); for (i = 0; i

anyone got a sample?

https://dl.dropboxusercontent.com/u/361747/urandom.mp3

Re: 'Music' from /dev/urandom

#42
post #27
post #25

Earlier quoted context omitted.

It was an excellent share you although I don't quite think "turning off CSS" would be my preferred defense. You can paste to an intermediate area to be sure you didn't catch something hidden from whichever site you don't trust (which allows users to inline arbitrary HTML elements with arbitrary styles). This is a habit one already might be in if they want to avoid being tracked from clicking on, say, Google search re…

If you try to copy a search result, it turns into a Google url that redirects to the result. On iOS this doesn't happen for some reason.

There are extensions to fix this

Re: 'Music' from /dev/urandom

#43
post #28

Earlier quoted context omitted.

It's incorrect to assume that a shell script that uses tools like xxd and awk is distro-specific. Almost every distribution ships the GNU coreutils and other GNU base tools. It's going to work on basically every distribution. What makes distributions unique is their package manager, release and security philosophy, amount of cruft, etc.

Even the same distro line but different versions may have significant issues. This is why every build on top of Linux (e.g. Android) calls out a particular kernel version. Even a particular version for the build machine . Because things like command line tools differ over time. Versionology is a whole universe of hurt on Linux.

That's the cost of supporting code that is constantly being updated, you need to start freezing versions and backporting fixes. Also, I'm not sure what command line tools you're referring to as "differing over time". Kernel version freezing is mainly fear of new code (or out-of-tree vendor patchsets that depend very strongly on the kernel ABI which changes every few months -- but that's not user visible). Sure, if your system never changes anything you don't need to worry about software versions. But there are many other problems with that.

Re: 'Music' from /dev/urandom

#44
post #3

Here is one with the blues scale. From time to time it grooves really nice. cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,3,5,6,7,10,12",a,","); for (i = 0; i

I have this version and the authors "sad" version playing together. It's weird because after about 10 or so minutes they stop sounding random and become almost like chiptune jazz.

Re: 'Music' from /dev/urandom

#45
post #3

Here is one with the blues scale. From time to time it grooves really nice. cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,3,5,6,7,10,12",a,","); for (i = 0; i

Here's Ryukyu (Okinawa) Japanese music scale

  cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("4,5,7,11",a,","); for (i = 0; i 

Re: 'Music' from /dev/urandom

#46
post #3

Here is one with the blues scale. From time to time it grooves really nice. cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,3,5,6,7,10,12",a,","); for (i = 0; i

Here's Ryukyu (Okinawa) Japanese music scale cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("4,5,7,11",a,","); for (i = 0; i

Unfortunately markdown formatting has broken your code. I can make a guess based on where the italics starts and ends, but you might want to indent that code.

Re: 'Music' from /dev/urandom

#47
post #46

Earlier quoted context omitted.

Here's Ryukyu (Okinawa) Japanese music scale cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("4,5,7,11",a,","); for (i = 0; i

Unfortunately markdown formatting has broken your code. I can make a guess based on where the italics starts and ends, but you might want to indent that code.

Oops, I'm sorry. Looks better now?

Re: 'Music' from /dev/urandom

#48
post #6

Is there a way to make it sounds more pleasant? The sine wave is a bit harsh...

The example from /r/coding[1] is very nice to listen to:

    awk 'function wl() {
        rate=64000;
        return (rate/160)*(0.87055^(int(rand()*10)))};
    BEGIN {
        srand();
        wla=wl();
        while(1) {
            wlb=wla;
            wla=wl();
            if (wla==wlb)
                {wla*=2;};
            d=(rand()*10+5)*rate/4;
            a=b=0; c=128;
            ca=40/wla; cb=20/wlb;
            de=rate/10; di=0;
            for (i=0;iwla)
                    {a=0; ca*=-1};
                if (b>wlb)
                    {b=0; cb*=-1};
                if (di>de)
                    {di=0; ca*=0.9; cb*=0.9};
                printf("%c",c)};
            c=int(c);
            while(c!=128) {
                c
[1]: https://www.reddit.com/r/coding/comments/48zvn4/bash_one_lin...

Re: 'Music' from /dev/urandom

#50
> If you're a level 500 elite hacker like I am, you will note that the cryptographic quality of numbers from /dev/urandom is not the same as numbers from /dev/random. In our case, we don't want this operation to block, so we use /dev/urandom.

This is wrong. See http://www.2uo.de/myths-about-urandom/

(The part about /dev/urandom not blocking is right though)

Edit: changed http://security.stackexchange.com/questions/3936/is-a-rand-f... to the current link, since the current link is more to the point.

Post reply on HN