• Stars
    star
    204
  • Rank 192,063 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 13 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

music theory library for javascript

music.js

Use Teoria.js Instead

This library is no longer maintained. I recommend using the music theory library Teoria.js instead: https://github.com/saebekassebil/teoria.

Overview

music.js is a music creation library for javascript. It includes functions and data sets to generate notes, intervals, chords, and scales.

Example usage

Note

Note.fromLatin(name): Note by latin name and octave

var n = Note.fromLatin('A4');  // single note
var freq = n.frequency();  // returns 440
var name = n.latin();  // returns "A"
var octave = n.octave();  // returns 4

var cmaj = Note.fromLatin('C4E4G4');  // chord = array of notes
var freq = cmaj[0].frequency();  // returns 261.625...
var name = cmaj[0].latin();  // returns "C"
var octave = cmaj[0].octave();  // returns 4

var n = Note.fromLatin('C4');  // base note for scale
var majorScale = n.scale('major');  // scale = array of notes

Interval

Interval.fromName(name): Interval by name

Interval.fromSemitones(num): Interval by semitones

var fifth = Interval.fromName('fifth');  // define by name
var wholeStep = Interval.fromSemitones(2); // define by # of semitones

var c = Note.fromLatin('C3');

// use intervals to transpose notes
var d = c.add(wholeStep);

// use intervals to define chords
var cmaj = c.add(['unison','major third','fifth']);

More Repositories

1

HTML5-Guitar-Tab-Player

A music player plug-in for Vexflow
JavaScript
99
star
2

express-app-testing-demo

a simple express app for demonstrating testing and code coverage
HTML
94
star
3

d3-server-side-demo

Render d3 visualizations server-side
JavaScript
89
star
4

HTML5-Cloud-Composer

a sheet music editor developed with Vexflow and jQuery Mobile
JavaScript
66
star
5

eg-cms

a simple cms built with ember.js and backed by a google spreadsheet
JavaScript
25
star
6

audiolib-tracker.js

audiolib-tracker.js is a realtime audio tracker that plays music defined in a simple json format
9
star
7

piano-flash-cards

Music note flash cards for learning piano
TypeScript
7
star
8

ember-power-select-form

Addon for embedding a form into a multi-select component
JavaScript
7
star
9

step-sequencer

a simple step sequencer designed to use native nodes in the Web Audio API
JavaScript
6
star
10

bundling-server-example

Example web server that uses esbuild to create bundles on the fly
JavaScript
5
star
11

gregjopa.github.io

Personal blog, mostly about web development
TypeScript
4
star
12

paypal-button-full-page-redirect-example

HTML-Only PayPal Button integration with the v2 Orders API
TypeScript
4
star
13

dotfiles

config files for zsh and git
Shell
2
star
14

webdriver-io-boilerplate

Webdriver.io boilerplate using Mocha and TypeScript
TypeScript
2
star
15

phoenix_inline_svg_example

Example phoenix project using phoenix_inline_svg
Elixir
1
star
16

chord-charts

1
star
17

d3-chart-templates

Reusable chart templates built with d3.js
JavaScript
1
star
18

dynamic-script-loading-demo

Test out how the async and defer attributes work when doing dynamic script loading
JavaScript
1
star
19

ember-reporting-example

Example ember app using highcharts and github's stats api
JavaScript
1
star
20

github-actions-frontend-starter

Examples of Github Actions for frontend apps
JavaScript
1
star
21

lit-element-example

lit element playround
JavaScript
1
star
22

ember-reporting-dashboard

Example reporting app built with Ember that uses GitHub's public API
JavaScript
1
star