Generates and plays a square wave with custom duration and pitch.
synth(duration, inv_pitch, "");
- Duration is approximately in microseconds (though not exact)
- The higher the inv_pitch argument, the lower the sound sounds
- Duration MUST be of the form 4x+2 (e.g. 4250+2 = 1002)
- inv_pitch SHOULD be divisible by 2
WAV header was prepared with riffwave
See the demo here
See the 140byt.es site for a showcase of entries (built itself using 140-byte entries!), and follow @140bytes on Twitter.
To learn about byte-saving hacks for your own code, or to contribute what you've learned, head to the wiki.
140byt.es is brought to you by Jed Schmidt, with help from Alex Kloss. It was inspired by work from Thomas Fuchs and Dustin Diaz.