code-to-music
TypeScript icon, indicating that this package has built-in type declarations

1.0.13 • Public • Published

Code To Music

As simple as posible api for produce melody on JS

Installation

Install my-project with npm

  npm install code-to-music

Usage/Examples

import { Note, produceMelody } from "code-to-music";

const greenTreeMelody: Note[] = [
  { pitch: "E4", duration: 4 },
  { pitch: "C#4", duration: 8 },
  { pitch: "C#4", duration: 8 },
  { pitch: "E4", duration: 4 },
  { pitch: "C#4", duration: 8 },
  { pitch: "C#4", duration: 8 },
  { pitch: "E4", duration: 8 },
  { pitch: "D4", duration: 8 },
  { pitch: "C#4", duration: 8 },
  { pitch: "B3", duration: 8 },
  { pitch: "A3", duration: 2 },
  { pitch: "F#4", duration: 4 },
  { pitch: "A4", duration: 8 },
  { pitch: "F#4", duration: 8 },
  { pitch: "E4", duration: 4 },
  { pitch: "C#4", duration: 8 },
  { pitch: "C#4", duration: 8 },
  { pitch: "E4", duration: 8 },
  { pitch: "D4", duration: 8 },
  { pitch: "C#4", duration: 8 },
  { pitch: "B3", duration: 8 },
  { pitch: "A3", duration: 2 },
];

produceMelody(greenTreeMelody, 120);

Package Sidebar

Install

npm i code-to-music

Weekly Downloads

0

Version

1.0.13

License

ISC

Unpacked Size

14.6 kB

Total Files

18

Last publish

Collaborators

  • filipp_goriainov