cuthbertLab / music21j

Javascript port of music21 -- Toolkit for Computational Musicology
Other
147 stars 43 forks source link

'live' score generation with m21j #80

Open Kaamir opened 3 years ago

Kaamir commented 3 years ago

Hello. I am currently involved in a project where we wish to produce ‘live’ music notation in the browser. The app will be a javascript program that composes music based on an algorithm. Our goal is that as the composition program is running, the music notation will generate note by note in the browser. And one of the reasons for this, is that we would like to eventually use it for live performance – music that is being generated right before the eyes of the person performing it and that can change compositional direction depending on various variables during the performance. 

However I’ve been having problems with music21j, and I’m no longer even sure if what we are attempting is even possible with the library. Here are our current biggest questions:

Many, many, thanks in advance!

mscuthbert commented 3 years ago

Hi @Kaamir -- sorry to miss this. To answer your Q:

(1) Dynamics don't work using the expressions.dynamics module, but I believe it does work if you set .volume on the notes. (See music21-python's docs on how to do that)

(2) Are you creating one giant stream or using substreams (Measures, etc.)? With the latter I can get to hundreds--maybe 1000 notes with decent speed. The other approach is to try using the canvas backend, which is much less memory intensive, which is the big problem with SVGs.

(3) Exporting isn't yet supported natively in music21j,