Fork me on GitHub

abeck.js

Play first

Created at #webmusicjp by @watilde

Write a Song in JavaScript with ABC music notation Syntax

var song = new abeck({
  X: 1,
  title: 'The Song',
  bpm: 120,
  meter: '4/4',
  length: '1/4',
  rhythm: 'reel',
  key: 'Cmaj'
});

song.push([
    [null, '4']
  ])
  .push([
    ['C', '1'],
    ['D', '1'],
    ['E', '1'],
    ['F', '1']
    ])
  .push([
    ["G", '1'],
    ["A", '1'],
    ["B", '1'],
    ["C'", '1']
    ]);
  ]);

song.play();

And also can out Score

Nyan nyan nyan!

  var nyan = new abeck({
    X: 1,
    title: 'The Song',
      bpm: 450,
      meter: '4/4',
      length: '1/4',
      rhythm: 'reel',
      key: 'Cmaj'
  });

  nyan.push([
      ["^d", '1'],
      ["e", '1'],
      ["^f", '2'],
      ])
    .push([
      ["b", '2'],
      ["^d", '1'],
      ["e", '1'],
    ])
    .push([
        ["^f", '1'],
        ["b", '1'],
        ["^c'", '1'],
        ["^d'", '1']
    ])
    .push([
        ["^c'", '1'],
        ["^a", '1'],
        ["b", '2'],
        ])
    .push([
        ["^f", '2'],
        ["^d", '1'],
        ["^e", '1']
        ])
    .push([
        ["^f", '2'],
        ["b", '2']
        ])
    .push([
        ["^c'", '1'],
        ["^a", '1'],
        ["b", '1'],
        ["^c'", '1']
        ])
    .push([
        ["e'", '1'],
        ["^d'", '1'],
        ["e'", '1'],
        ["^c'", '1']
        ])
    .push([
        ["^f'", '2'],
        ["^g'", '2']
     ])
    .push([
        ["^c'", '1'],
        ["^d'", '2'],
        ["b", '1']
     ])
    .push([
        ["d'", '1'],
        ["^c'", '1'],
        ["b", '2']
     ])
    .push([
      ["b", '2'],
      ["^c'", '2']
    ])
    .push([
      ["d'", '2'],
      ["d'", '1'],
      ["^c'", '1']
    ]);