Music Suite

music-suite.github.io

Hans Höglund

Music Suite

Music Suite

           Composition         a  ➝  Music
           Manipulation         Music  ➝  Music
           Analysis         Music  ➝  b

type Music = ?

No closed definition of music(s)

type Music = ?

No closed definition of music(s)

But there are many common elements in music!

type Music = ?

Musical theory

type Music = ?

Musical theory

Musical aspects

Musical cultures treat (and rank) aspects differently!

type Music = ?

Time is special

type Music = ?

Time is special

In other words, aspects may depend on time, but not the other way around.

type Music = ?

Time is special

In other words, aspects may depend on time, but not the other way around.

We provide multiple versions of all aspects except time.

Library layout

Aspects

Special

Structure vs. Freedom

Time types

Compare graphics (2D or 3D)!

Time types

An affine transformation is simply (ProductDuration ⨯ SumTime)

Generalizes time transformations delay and stretch

class Transformable a where
    transform :: Span -> a -> a

Time types

class Transformable a where
    transform :: Span -> a -> a

Time types

class HasPosition a where
    _position :: a -> Duration -> Time
    _onset, _offset :: a -> Time  

class HasDuration a where
    _duration :: a -> Duration

Time types

type Note a = (Duration, a)
type Delayed a = (Time, a)
type Placed a = (Span, a)
 
type Voice a = [Note a]
type Score a = [Voice a]
type Track a = [Placed a]
 
type Behavior a = Time -> a

Aspects types: Pitch...

Defined in music-pitch

Main hierarchies are Music.Pitch.Absolute Music.Pitch.Common

Pitches and intervals form an affine/vector space pair

Aspects types: ...etc

More exotic

Accessing aspects

Based on lens vocabulary:

Similar for all other aspects.

Allows polymorphic updating of aspects.

Literals

Pitches

Dynamic values

In the style of OverloadedStrings.

Meta-information

A system to annotate all time types with arbitrary values.

Used for most things that does not affect how the music sounds:

Backends

Import

Export

Challenges