zmidi-score-0.3.0.0: Representing MIDI a simple score.

Copyright(c) 2012--2014, Utrecht University
LicenseLGPL-3
MaintainerW. Bas de Haas <w.b.dehaas@uu.nl>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

ZMidi.Score.Datatypes

Contents

Description

Summary: a simple score representation derived from a MidiFile (as parsed by the ZMidi.Core library: https://hackage.haskell.org/package/zmidi-core

Synopsis

Score representation of a MidiFile

data MidiScore Source

Stores the main elements of a musical score that can be derived from a midifile

Constructors

MidiScore 

Fields

getKey :: [Timed Key]

The Keys of the piece with time stamps

getTimeSig :: [Timed TimeSig]

The TimeSignatures of the piece with time stamps

ticksPerBeat :: TPB

The number of MIDI-ticks-per-beat

midiFormat :: MidiFormat

The kind of midi file that created this score

tempo :: [Timed Time]

The microseconds per quarter note

minDur :: Time

The minimum note length found.

getVoices :: [Voice]

The midi Voices

data Key Source

Represents a musical key

Constructors

Key 
NoKey 

Instances

data TimeSig Source

A TimeSignature has a fraction, e.g. 4/4, 3/4, or 6/8.

Constructors

TimeSig 
NoTimeSig 

type Voice = [Timed ScoreEvent] Source

A Voice is a list of ScoreEvents that have time stamps.

newtype Channel Source

The MIDI Channel as stored in the MIDI file

Constructors

Channel 

Fields

channel :: Word8
 

newtype Pitch Source

Pitch is represented by a PitchClass and an Octave

Constructors

Pitch (Octave, PitchClass) 

newtype Octave Source

Represents a musical octave

Constructors

Octave 

Fields

octave :: Int
 

newtype PitchClass Source

A Pitch class representation (there is no check for values > 11)

Constructors

PitchClass 

Fields

pitchclass :: Int
 

data Timed a Source

Adds MIDI Time information to a datatype

Constructors

Timed 

Fields

onset :: Time
 
getEvent :: a
 

Instances

Functor Timed 
Eq a => Eq (Timed a) 
Ord a => Ord (Timed a) 
Show a => Show (Timed a) 
Generic (Timed a) 
Binary a => Binary (Timed a) 
NFData a => NFData (Timed a) 
type Rep (Timed a) 

newtype Time Source

Represents MIDI time in ticks

Constructors

Time 

Fields

time :: Int
 

newtype Bar Source

A Bar counter used to interpret a MIDI Time stamp

Constructors

Bar 

Fields

bar :: Int
 

newtype Beat Source

A counter for musical beats

Constructors

Beat 

Fields

beat :: Int
 

newtype BarRat Source

Representing time within a Bar as a Ratio

Constructors

BarRat 

Fields

barRat :: Ratio Int
 

newtype TPB Source

The MIDI ticks in Time per Beat

Constructors

TPB 

Fields

tpb :: Int
 

data ScoreEvent Source

Within ZMidi.Score we represent four score events: a note, a key change, a time signature or a tempo change

Constructors

NoteEvent 

Fields

chan :: Channel
 
pitch :: Pitch
 
velo :: Velocity
 
duration :: Time
 
KeyChange 

Fields

keyChange :: Key
 
TimeSigChange 

Fields

tsChange :: TimeSig
 
TempoChange 

Fields

tempChange :: Time