

8bit.js: Write music using 8bit oscillation sounds - bulkan
https://github.com/meenie/8bit.js

======
przemoc
I like the idea, but providing the notes is extremely tedious here. In my old
PCSpk (PC-Speaker Server & Client) I made up following notation (excerpt from
README):

    
    
      first 3-digit number is integer - tempo (bpm)
      next are space seperated values TOL, where:
      T is letter - tone: C,d(des),D,e(es),E,F,g(ges),G,a(as),A,B,H,P(pause)
      O is digit - octave: 0-9
      L is digit/letter - length: L=0-9,A-Z <=> 1/(L+1)
    

J.S.Bach - Fugue in D minor (fragment):

    
    
      240 A47 G47 A47 F47 A47 E47 A47 D47 A47 d47 A47 D47 A47 E47 A47 F47 A47 A37 A47 H37 A47 d47 A47 D47 A47 d47 A47 D47 A47 E47 A47 D43
    

I've written also Siemens ringtone converter to above format in gawk (GNU
awk).

[http://git.io/siemens.gawk](http://git.io/siemens.gawk)

EDIT: I just realized that you may wonder what is H there. For conciseness
I'll quote Wikipedia on that matter
[http://en.wikipedia.org/wiki/B_(musical_note)](http://en.wikipedia.org/wiki/B_\(musical_note\))

> However, in Germany, Central and Eastern Europe, and Scandinavia, the label
> B is used for what, above, is called B-flat, and the note a semitone below C
> is called H.

~~~
kamkha
There's a fairly well-established notation similar to what you made up: ABC
notation
([http://en.wikipedia.org/wiki/ABC_notation](http://en.wikipedia.org/wiki/ABC_notation)).

~~~
przemoc
Yes, back then (2005) I didn't know about ABC nor Lilypond (which I've started
using since end of 2011, month after end of my music prototyping Ask HN thing:
[https://news.ycombinator.com/item?id=3089259](https://news.ycombinator.com/item?id=3089259),
which will hopefully get some follow-up in the future).

To be honest, today I would slightly change my notation, to make it more
readable, consistent and friendlier for English-speaking people:

    
    
      OTD[.]
      O - octave: [0-9]
      T - tone: C,d(es),D,e(s),E,F,g(es),G,a(s),A,b(es),B,P(ause)
      D - duration: [0-9A-Z] meaning:
                    breve (double whole note) // for D==0
                    1/D note                  // for D!=0
      . - dotted note, changes duration to:   // d - duration
                    d(2 - 1/2^n)              // n - number of dots
    

Same fugue would start like:

    
    
      4A8 4G8 4A8 4F8 4A8 4E8 4A8 4D8 4A8 4d8 4A8 4D8 4A8
    

which is so much more better...

Why I didn't do it like that from the beginning? No idea...

------
meenie
Hey guys, thanks for posting my library. I put it up yesterday and it just
exploded all over the net haha. I plan on making it easier to input notation
as well as support the importing of midi files (although I'm not sure how that
would be useful since there are already players for those). This library
started out as an experiment last weekend, but it seems it could be something
that Game Devs want to use in their games :). So I'll be keeping up
development and most likely creating a GUI to create songs this weekend.

If anyone has any suggestions or questions, then please raise them here:
[https://github.com/meenie/8bit.js/issues](https://github.com/meenie/8bit.js/issues)

------
victoriap
Seems cool. HTML5 games can now have their Atari/Nintendo tracks.

~~~
logn
Keep in mind, the browser can do more than 8bit sounds.

~~~
sdfjkl
8bit sounds are nonetheless still very popular for a certain genre of games.

~~~
Ecio78
it was very popular also for cracks/keygen, also available on the web :)

[http://keygenjukebox.com/](http://keygenjukebox.com/)

[http://www.keygenplayer.com/](http://www.keygenplayer.com/)

etc..

------
tomek2k1
Does not work in any browser except Safari and Chrome

~~~
harrytuttle
I think that should be labelled "does not work full stop".

I've had this rant before but WebKit is becoming the new IE6 and it's pissing
me off as a Firefox and IE user.

~~~
sjtgraham
It's a technical demonstration of the W3C WebAudio API. By your logic we
shouldn't have great demos such as these because a subset of vendors haven't
pulled their finger's out of their collective arses to implement a spec that's
been around for a couple years.

Sorry you're pissed off, but your rant is directed at the wrong people. Go
file bug reports with Mozilla and Microsoft instead of chastising someone for
making something cool.

~~~
doublec
That's a little unfair. The spec was presented when it was already implemented
in the browser by the spec authors. That's why they are so far ahead of the
curve. Mozilla had a spec and implementation of another approach that predates
the Web Audio API. Once the working group settled on what spec to go for then
implementation started.

------
Kiro
How does it generate the sound?

~~~
meenie
It uses the new HTML5 AudioContext() functionality. -
[https://developer.mozilla.org/en-
US/docs/Web/API/AudioContex...](https://developer.mozilla.org/en-
US/docs/Web/API/AudioContext)

