🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

playa

Package Overview
Dependencies
Maintainers
0
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playa

A framework for developing musical ideas

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
0
Created
Source

Playa

npm license build Coverage Status Bundlephobia min + gzip

PLAYA (pronounced ˈpleɪə) is a framework for musical composition. It allows creating custom music algorithms, musical phrases, percussion rhythms, harmonic sequences and more.

Install

npm install --save playa

Usage

ES6 Modules

import { Chord, Key, Rhythm } from 'playa';

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

Common JS (Node)

const { Chord, Key, Rhythm } = require('playa');

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

Example

import { Scale, createMotif } from 'playa';

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

createMotif(scale.notes, ['4n', '2n', '8nt']);
/* =>
[
    { time: 0, dur: 480, next: 480, midi: 73, note: 'C#4', isRest: false },
    { time: 480, dur: 960, next: 1440, midi: 80, note: 'G#4', isRest: false },
    { time: 1440, dur: 160, next: 1600, midi: 74, note: 'D4', isRest: false }
]
*/

Guides

Interactive guide here which uses Tone.js for the sound.

An example of using PLAYA with P5 and Tone.js - PLAYA meets P5

Documentation

Can be found here.

Templates

License

Open Software License 3.0

Keywords

music

FAQs

Package last updated on 16 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts