Sound Bytes

A coding competition


Project maintained by coding-competitions Hosted on GitHub Pages — Theme by mattgraham

Nodal Noise

by pswg

Listen

Uses Node.js parse errors and sh pipes to generate ‘noise’ from the pits of hell.
Contains no actual JavaScript!

run.sh

n="node -i"
echo $n|$n|$n|$n|$n|$n|$n|$n|$n

Explanation

n="node -i" defines a variable, $n with the value "node -i".

echo $n returns the value of the variable $n.

|$n pipes the result of the previous command to the command pointed to by $n, that is node -i, or the node CLI with the --interactive flag. This will return the following parse error:

> node -i
ReferenceError: node is not defined

|$n pipes the result of the previous command (the above parse error) to the command pointed to by $n. This will result in even more parse errors:

> > ReferenceError: node is not defined
> ReferenceError: node is not defined
^

SyntaxError: Unexpected token >

> > >
^

SyntaxError: Unexpected token >

|$n... continues this process until enough parse errors are present to be converted to a few seconds of audio.

Language

sh + Node.js

Golf Score

43

Parameters

Sample Rate: 4000 Hz
Sample Size: 16 bits
Channels: 1 (mono)
Encoding: unsigned-integer

Commands

Run

/bin/sh run.sh

Spectrogram

Spectrogram