tcalculus-1.0.0: A DSL prototype for structured realtime/reactive functional programing

Copyright(c) David Janin, Simon Archipoff, 2016
Licensesee the LICENSE file in the distribution
Maintainerjanin@labri.fr
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

TScore.Main

Contents

Description

Here, we define musical tiles (and a bit more for control) for writing and playing reactive music with the T-calculus.

Yet to be exported properly... see http://poset.labri.fr/interpolations for waiting (realized with a more adhoc version of the Tcalculus)...

Synopsis

Music types and elementary algebra

type Beat iv = Duration Rational iv Source #

Music duration type

data Music iv a Source #

Polymorphic music constructor; type iv is the type of the input values of the system to be designed such MIDI pour a system with single MIDI instrument as input.

Instances

Ord iv => Functor (Music iv) Source # 

Methods

fmap :: (a -> b) -> Music iv a -> Music iv b #

(<$) :: a -> Music iv b -> Music iv a #

Ord iv => Tilable (Beat iv) (Music iv a) Source # 

Methods

duration :: Music iv a -> Beat iv Source #

stretch :: Beat iv -> Music iv a -> Music iv a Source #

Ord iv => Fractional (Music iv a) Source # 

Methods

(/) :: Music iv a -> Music iv a -> Music iv a #

recip :: Music iv a -> Music iv a #

fromRational :: Rational -> Music iv a #

Ord iv => Num (Music iv a) Source # 

Methods

(+) :: Music iv a -> Music iv a -> Music iv a #

(-) :: Music iv a -> Music iv a -> Music iv a #

(*) :: Music iv a -> Music iv a -> Music iv a #

negate :: Music iv a -> Music iv a #

abs :: Music iv a -> Music iv a #

signum :: Music iv a -> Music iv a #

fromInteger :: Integer -> Music iv a #

type Melody iv = Music iv Midi Source #

A melody is defined as music over MIDI values

Basic music constructors

noteT :: Ord iv => Midi -> Music iv Midi Source #

Makes a note from Midi with default duration of one beat.

melody :: (Ord iv, Tilable (Beat iv) a) => a -> Music iv a Source #

Makes a note from Midi with default duration of one beat.

restI :: Ord iv => Integer -> Music iv a Source #

Makes a (polymorphic) rest from an integer value

restR :: Ord iv => Rational -> Music iv a Source #

Makes a (polymorphic) rest from a rationnal

Music constructors from tile algebra

(+) :: Num a => a -> a -> a #

(-) :: Num a => a -> a -> a #

negate :: Num a => a -> a #

Unary negation.

(*) :: Num a => a -> a -> a #

Music getters

duration :: Tilable d a => a -> d Source #