JSPM

  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q37989F
  • License OSL 3.0

A musical theory framework aimed at creating musical phrases

Package Exports

  • playa

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (playa) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Playa

npm license build Coverage Status

PLAYA (pronounced ˈpleɪə) is a musical theory framework aimed at creating musical phrases. It has concepts such as Keys, Scales, Chords and Notes, with which it provides ways of generating musical phrases.

Install

npm install --save playa

Usage

ES6 Modules

import { Core, Tools, Functional, Constants } from 'playa';

// or everything
import * as Playa from 'playa';

Common JS (Node)

const { Core, Tools, Functional, Constants } = require('playa');

// or everything
const Playa = require('playa');

Example

import { Core, Tools, Functional } from 'playa';
const { Scale } = Core;
const { createMotif } = Functional;
const { Rhythm } = Tools;

const scale = new Scale('A', Scale.MAJOR);

const rhythm = Rhythm.free('1:0:0', ['4n', '8n']);
// => [ '4n', '8n', '8n', '4n', '8n', '8n' ]

createMotif(scale.notes, rhythm);
/* =>
[
  { time: 0, note: 'G#4', midi: 80, dur: '4n' },
  { time: 480, note: 'E4', midi: 76, dur: '8n' },
  { time: 720, note: 'E4', midi: 76, dur: '8n' },
  { time: 960, note: 'D4', midi: 74, dur: '4n' },
  { time: 1440, note: 'F#4', midi: 78, dur: '8n' },
  { time: 1680, note: 'D4', midi: 74, dur: '8n' }
]
*/

Documentation

Can be found here.

License

Open Software License 3.0