Skip to content

scoreur/gen

Repository files navigation

Introduction

The app is targeted at both web and desktop.

Goal

  • Provide basic score input (melody/harmony/texture) and operations on MIDI file.
  • Incorporate structural information into music composition, generating good melody and harmony.

User Interface

  • Viewer (support pdf, image or rendered from score input).
  • Editors for melody, harmony, texture, score settings and schema
  • Buttons (generate, parse, play, etc)
  • Top Menu: File, Edit, View, Examples (json/midi/pdf)
  • Bottom Menu: Keyboard, Console, Tutorial, Instrument List

Illustrative Workflow

  • Using default score is summertime, just click parse, then the score will be parsed and rendered and you can play melody, harmony or all the MIDI tracks generated from that score.
  • In Example menu, click load sample json to load one excerpt from Chopin's butterfly etude . Then play the MIDI or generate new melody based on the associated schema.
  • In Example menu, click load sample midi to load Bach's two-part invention No.1, then analyze it (in Edit menu), set seed s1 (in Edit menu). Then you can generate music based on the rhythmic patterns in the MIDI.

Music Generation

The generation procedure includes four phases:

  1. low-level structural optimization (within one block) the current evaluation is based on harmony (chord abstraction), simplicity (material reuse), associability (piecewise similarity, auditory streaming).
  2. high-level structural enforcement (upon defined blocks) include crafted repetitions, transpositions, inversions, etc;
  3. between-block modification make coherent transitions, cadences, etc, also adjust notes not fit the harmony due to block operations;
  4. ornamentation add grace notes, trills or other small variations to enhance musicality without affecting the structure

Score Representation

The score input is based on the scale (e.g., major/pentatonic/blues scales, etc) The score parser is generated from lex file by jison. And can be extended to support more MIDI event like tempo changes. The score renderer uses vexflow as underlying library.

Utilities

  • MIDI: open MIDI file, quantize, analyze, render as score, save as wav/mp3
  • keyboard: a, s, d, f, j, k, l, ; correponds to C, D, E, F, G, A, B as the white keys, and the black keys are w, e, u, i, o which have similar positions as on the piano keyboard.

Development Guide

Build

  • Run grunt web to generate index.html and js/gen-build.js for the website.
  • Run grunt app to generate app.html, and the generated js file is in coffee/.

Launch

Run npm start to launch the app or setup a http server.

Try the examples in the menu Example. Click Parse, Render, Play MIDI one by one. Edit the melody or harmony, or generate from the schema. Then parse again.