Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Time = Double
- type MIDI = Integer
- type Interval = Integer
- type ScaleDegree = Int
- type Length = Int
- data PatternGroup = PatternGroup {
- piece_name :: String
- expert_name :: String
- pattern_name :: String
- basePattern :: Pattern
- patterns :: [Pattern]
- type Pattern = [Note]
- data Note = Note {}
- (.@) :: MIDI -> Time -> Note
- (.@@) :: [Time] -> [MIDI] -> [Note]
- type MusicPiece = Pattern
- type Song = String
- inverse :: Num a => [a] -> [a]
- basePitch :: Pattern -> Maybe MIDI
- pitch :: Pattern -> [MIDI]
- intervals :: Pattern -> [Interval]
- onsets :: Pattern -> [Time]
- durations :: Pattern -> [Time]
- rhythm :: Pattern -> [Time]
- normalRhythm :: Pattern -> [Time]
- translateH :: Time -> Note -> Note
- translateV :: Interval -> Note -> Note
- pairs :: [a] -> [(a, a)]
- truncate' :: Int -> Double -> Double
- type Octave = Integer
- type Degree = Integer
- type ScaleType = [Interval]
- type Scale = Map MIDI (Degree, Octave)
- major :: ScaleType
- harmonicMinor :: ScaleType
- melodicMinor :: ScaleType
- createScaleInC :: ScaleType -> Scale
- createScaleInD :: ScaleType -> Scale
- allScales :: [Scale]
- guessScale :: Pattern -> Scale
- guessScaleCandidates :: Int -> Pattern -> [Scale]
- toDegree :: Scale -> MIDI -> Integer
- applyScale :: Scale -> Pattern -> [Interval]
- pmap :: (a -> b) -> [a] -> [b]
- pforM :: Traversable t => t a -> (a -> IO b) -> IO (t b)
- pmapM :: Traversable t => (a -> IO b) -> t a -> IO (t b)
Documentation
type ScaleDegree = Int Source #
data PatternGroup Source #
A pattern group is one of the patterns of a piece of music, identified by an expert or algorithm, and defined by a pattern prototype and other pattern occurences.
PatternGroup | |
|
A simplistic music note (only time and pitch).
type MusicPiece = Pattern Source #
A piece of music is a huge pattern.
basePitch :: Pattern -> Maybe MIDI Source #
The base pitch of a pattern (the pitch of its first note). e.g. basePitch [(25,1), (27,2), (25,2.5)] = Just 25
pitch :: Pattern -> [MIDI] Source #
The (real) pitch structure of a pattern. e.g. pitch [(25,1), (27,2), (25,2.5)] = [25, 27, 25]
intervals :: Pattern -> [Interval] Source #
The (relative) pitch structure of a pattern. e.g. intervals [(25,1), (27,2), (25,2.5)] = [2, -2]
onsets :: Pattern -> [Time] Source #
The (real) rhythmic structure of a pattern. e.g. onset [(25,1), (27,2), (25,2.5)] = [1, 2, 2.5]
durations :: Pattern -> [Time] Source #
The (relative) rhythmic structure of a pattern. e.g. rhythm [(25,1), (27,2), (25,2.5)] = [1, 0.5]
normalRhythm :: Pattern -> [Time] Source #
Normalized (relative) rhythmic structure of a pattern. e.g. normalRhythm [(A,2), (C#,6), (Eb,8), (B,1), (A,2)] = [1, 3, 4, 1/2, 1]
translateH :: Time -> Note -> Note Source #
Translate a note horizontally (in time). e.g. translateH (-0.5) [(25,1), (27,2), (25,2.5)] = [(25,0.5), (27,1.5), (25,2)]
translateV :: Interval -> Note -> Note Source #
Translate a note vertically (in pitch). e.g. translateV (-20) [(25,1), (27,2), (25,2.5)] = [(5,1), (7,2), (5,2.5)]
pairs :: [a] -> [(a, a)] Source #
Get list as pairs of consecutive elements. e.g. pairs [a, b, c, d] = [(a, b), (b, c), (c, d)]
createScaleInC :: ScaleType -> Scale Source #
createScaleInD :: ScaleType -> Scale Source #
guessScale :: Pattern -> Scale Source #