music-automaton

Library to output automatically generated melodies as MusicXML

Usage no npm install needed!

<script type="module">
  import musicAutomaton from 'https://cdn.skypack.dev/music-automaton';
</script>

README

music-automaton

A JavaScript library to automatically generate small melodies based on a set of predefined rules.

The output is a MusicXML string. MusicXML files can be imported into most composition softwares like MuseScore and there are other JavaScript libraries that can then be used to for example display MusicXML on a website.

Using the library

const MusicAutomaton = require('music-automaton');

const metaData = new MusicAutomaton.MetaData('Art at ' + new Date().toISOString(), 'ComposerName', 'PoetName', 'Rights');
const scale = new MusicAutomaton.Scale('Bb', 'I');
const xml = MusicAutomaton.default(metaData, scale);

This will produce a MusicXML string in B flat major.