lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Call for ideas: Music Stream applications.


From: Erik Sandberg
Subject: Call for ideas: Music Stream applications.
Date: Sun, 28 Aug 2005 08:46:39 +0200
User-agent: KMail/1.8.1

Hi all,

A couple of days ago, I leaked about my thesis on music streams. I got pretty 
much positive response from that, which I'm happy for.

A brief summary:
I'm writing a master's thesis, where I'm implementing something called Music 
Streams for lilypond. A music stream can be seen as a normalisation / 
simplification of a music expression, which only contains Events, and where 
the events have been assigned to contexts. There are also special events for 
setting properties, creating contexts, increment time, etc. The music streams 
completely separates the music-expression parser from the formatter, so you 
can convert a .ly file to a music stream, look at the stream, tweak it, 
whatever, and then load it into the formatter. The music stream is still a 
music description format, just like .ly (it contains no layout information).

We do not yet know if music streams will make it into lilypond, what I'm doing 
is an experiment. So please don't expect anything.

That said, I'm looking for potential applications of music streams. This is 
relevant for choosing adequate data structures.

The most important applications we've found so far are:
- Cleaner implementation of \partcombine and friends
- Load/save music streams to disk, use it as a stable music representation 
format. It would be easier to maintain version compatibility for music 
streams than for .ly files.
- Write converters from other formats (MusicXML, MIDI) to music streams, and 
write a good stream->ly converter. This would possibly save some work 
duplication.
- Write a stream->MusicXML converter
- Some GUI-related features (which aren't very important now, a GUI requires 
lots of additional work in other areas before it can be done)
- Custom music stream filters. You could write a Scheme function that does 
some analysis of all music inside a context, and tweaks it based on that. 
Clever pagebreaks is one example (the analysis would be to look for repeats 
and long rests, the tweaks would be to insert page-breaking penalties). 

I'm looking for more applications, especially ideas on what stream filters can 
be used for. I'm interested in applications where a music stream-based 
solution is clearly better than using music functions or applycontext.

To give a rough idea of what a music stream is, here is a simple example of 
what it could look like:

\score { << \new Voice {c2 d e f } \addlyrics { x y z w } }
=>
#<Stream_event (stream-event (0 ((id . \new) (type . Score) (ops) (unique . 1) 
(class . CreateContext) (context . 0) (name . StreamEvent)))) >
#<Stream_event (stream-event (1 ((id . \new) (type . Staff) (ops) (unique . 2) 
(class . CreateContext) (context . 1) (name . StreamEvent)))) >
#<Stream_event (stream-event (2 ((id . \new) (type . Voice) (ops) (unique . 3) 
(class . CreateContext) (context . 2) (name . StreamEvent)))) >
#<Stream_event (stream-event (2 ((id . uniqueContext0) (type . Voice) (ops) 
(unique . 4) (class . CreateContext) (context . 2) (name . StreamEvent)))) >
#<Stream_event (stream-event (1 ((id . \new) (type . Lyrics) (ops) (unique . 
5) (class . CreateContext) (context . 1) (name . StreamEvent)))) >
#<Stream_event (stream-event (0 ((moment . #<Mom 0>) (class . Prepare) 
(context . 0) (name . StreamEvent)))) >
#<Stream_event (stream-event (4 ((music . #<Music NoteEvent>) (class . 
MusicEvent) (context . 4) (name . StreamEvent)))) >
#<Stream_event (stream-event (5 ((music . #<Music LyricEvent>) (class . 
MusicEvent) (context . 5) (name . StreamEvent)))) >
#<Stream_event (stream-event (0 ((class . OneTimeStep) (context . 0) (name . 
StreamEvent)))) >
#<Stream_event (stream-event (0 ((moment . #<Mom 1/2>) (class . Prepare) 
(context . 0) (name . StreamEvent)))) >
#<Stream_event (stream-event (4 ((music . #<Music NoteEvent>) (class . 
MusicEvent) (context . 4) (name . StreamEvent)))) >
#<Stream_event (stream-event (5 ((music . #<Music LyricEvent>) (class . 
MusicEvent) (context . 5) (name . StreamEvent)))) >
#<Stream_event (stream-event (0 ((class . OneTimeStep) (context . 0) (name . 
StreamEvent)))) >
#<Stream_event (stream-event (0 ((moment . #<Mom 1>) (class . Prepare) 
(context . 0) (name . StreamEvent)))) >
#<Stream_event (stream-event (4 ((music . #<Music NoteEvent>) (class . 
MusicEvent) (context . 4) (name . StreamEvent)))) >
#<Stream_event (stream-event (5 ((music . #<Music LyricEvent>) (class . 
MusicEvent) (context . 5) (name . StreamEvent)))) >
#<Stream_event (stream-event (0 ((class . OneTimeStep) (context . 0) (name . 
StreamEvent)))) >
#<Stream_event (stream-event (0 ((moment . #<Mom 3/2>) (class . Prepare) 
(context . 0) (name . StreamEvent)))) >
#<Stream_event (stream-event (4 ((music . #<Music NoteEvent>) (class . 
MusicEvent) (context . 4) (name . StreamEvent)))) >
#<Stream_event (stream-event (5 ((music . #<Music LyricEvent>) (class . 
MusicEvent) (context . 5) (name . StreamEvent)))) >
#<Stream_event (stream-event (0 ((class . OneTimeStep) (context . 0) (name . 
StreamEvent)))) >
#<Stream_event (stream-event (0 ((moment . #<Mom 2>) (class . Prepare) 
(context . 0) (name . StreamEvent)))) >
#<Stream_event (stream-event (0 ((class . OneTimeStep) (context . 0) (name . 
StreamEvent)))) >
#<Stream_event (stream-event (4 ((class . RemoveContext) (context . 4) (name . 
StreamEvent)))) >
#<Stream_event (stream-event (0 ((class . Finish) (context . 0) (name . 
StreamEvent)))) >

-- 
Erik




reply via email to

[Prev in Thread] Current Thread [Next in Thread]