Copyright | (c) David Janin, 2017 |
---|---|
License | see the LICENSE file in the distribution |
Maintainer | janin@labri.fr |
Stability | experimental |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides basic definitions for midi music
- data Interval
- data PitchClass
- pitchClassToPitch :: PitchClass -> MidiPitch
- pitchClassAndScaleToPitch :: PitchClass -> Int -> MidiPitch
- pitchToPitchClass :: MidiPitch -> PitchClass
- data NumMode
- type MidiPitch = Int
- type Channel = Int
- type Velocity = Int
- data Midi = Midi {}
- type EventMidi = Event Midi
- type Tone = MidiPitch
- type ScalePattern = [Int]
- majorP :: ScalePattern
- betweenP :: ScalePattern
- minorP :: ScalePattern
- toneP :: ScalePattern
- chromaticP :: ScalePattern
- dimP :: ScalePattern
- pentatonicP :: ScalePattern
- alteredP :: ScalePattern
- rotateP :: ScalePattern -> NumMode -> ScalePattern
- sizeP :: ScalePattern -> Int
- data Scale = Scale {}
- note :: Scale -> Int -> MidiPitch
- major :: PitchClass -> Scale
- between :: PitchClass -> Scale
- majorMode :: PitchClass -> NumMode -> Scale
- minor :: PitchClass -> Scale
- minorMode :: PitchClass -> NumMode -> Scale
- tone :: PitchClass -> Scale
- pentatonic :: PitchClass -> Scale
- altered :: PitchClass -> Scale
- chromatic :: PitchClass -> Scale
- dim :: PitchClass -> Scale
- data ScaleType
- = Pentatonic
- | Tone
- | Between
- | Diminished
- | Major
- | Minor
- | Altered
- | Chromatic
- scale :: PitchClass -> ScaleType -> Scale
- rankInScale :: Midi -> Scale -> Int
- noteInScale :: Scale -> Midi -> Midi
- transpose :: Scale -> Int -> Midi -> Midi
- toScale :: MidiPitch -> MidiPitch -> Midi -> Midi
- pitchShift :: MidiPitch -> Midi -> Midi
- module Reactive.Event
Documentation
Type enumerating some diatonic intervals (to be used in conjunction with scale patterns)
data PitchClass Source #
Type enumerating some pitch classes (ordered in perfect fiths)
Fbb | |
Cbb | |
Gbb | |
Dbb | |
Abb | |
Ebb | |
Bbb | |
Fb | |
Cb | |
Gb | |
Db | |
Ab | |
Eb | |
Bb | |
F | |
C | |
G | |
D | |
A | |
E | |
B | |
Fs | |
Cs | |
Gs | |
Ds | |
As | |
Es | |
Bs | |
Fss | |
Css | |
Gss | |
Dss | |
Ass | |
Ess | |
Bss | |
Fsss | |
Csss | |
Gsss |
Bounded PitchClass Source # | |
Enum PitchClass Source # | |
Eq PitchClass Source # | |
Ord PitchClass Source # | |
Read PitchClass Source # | |
Show PitchClass Source # | |
Updatable PitchClass d iv Source # | No update needed |
pitchClassToPitch :: PitchClass -> MidiPitch Source #
Converts pitchclass into midi pitch from 0 (C) to 11 (B)
pitchClassAndScaleToPitch :: PitchClass -> Int -> MidiPitch Source #
Converts pitchclass and scale number into midi pitch (A0 = 22, C1 = 24)
pitchToPitchClass :: MidiPitch -> PitchClass Source #
Converts midi pitch into pitchClass (from C to A sharp)
Enumerating (sub) mode number
Type defining a Midi value
Midi | |
|
type ScalePattern = [Int] Source #
Type defining the direction of a tranposition data Direction = Lower | Upper deriving (Show, Enum, Eq)
Type denoting the pattern of a scale in semi-tones. For example:
>>>
major pattern
majorP = [2,2,1,2,2,2,1]>>>
minor pattern
minorP = [2,1,2,2,1,2,2]>>>
tone pattern
toneP = [2,2,2,2,2]>>>
diminished pattern
dimP = [2,1,2,1,2,1,2,1]
majorP :: ScalePattern Source #
Major scale pattern
betweenP :: ScalePattern Source #
Between scale pattern
minorP :: ScalePattern Source #
Minor scale pattern
toneP :: ScalePattern Source #
Tone scale pattern
chromaticP :: ScalePattern Source #
Half-tone (or chromatic) scale pattern
dimP :: ScalePattern Source #
Diminished scale pattern
pentatonicP :: ScalePattern Source #
Diminished scale pattern
alteredP :: ScalePattern Source #
Altered scale pattern
rotateP :: ScalePattern -> NumMode -> ScalePattern Source #
Rotates a scaler patterns according to a mode nummber
sizeP :: ScalePattern -> Int Source #
Size of a pattern octave (in semitones)
Type denoting a scale
major :: PitchClass -> Scale Source #
Major scales
between :: PitchClass -> Scale Source #
Between scales
majorMode :: PitchClass -> NumMode -> Scale Source #
Major mode scales (ex: D Dorian is majorMode C II)
minor :: PitchClass -> Scale Source #
Minor scales
tone :: PitchClass -> Scale Source #
Tone scales
pentatonic :: PitchClass -> Scale Source #
Pentatonic scales
altered :: PitchClass -> Scale Source #
Altered scales
chromatic :: PitchClass -> Scale Source #
Chromatic scales
dim :: PitchClass -> Scale Source #
Diminished scales
Predefined type of scale
Pentatonic | |
Tone | |
Between | |
Diminished | |
Major | Lydian |
Minor | Phrygian | Dorian | Aeolian | Mixolydian | Locrian |
Altered | |
Chromatic |
noteInScale :: Scale -> Midi -> Midi Source #
Moves a pitch to the nearest higher picth in a given scale
transpose :: Scale -> Int -> Midi -> Midi Source #
Diatonic transpose given scale and interval (in Int)
module Reactive.Event