AlgoRhythm- Algorithmic music composition

Safe HaskellNone




densityToDurations :: Density -> [(Weight, Duration)] Source #

Sample weights for note durations during a cerain density

relativeWeights :: [(Weight, Interval)] Source #

Weights table containing the relative importance of all possible intervals

intervalWeights :: PitchClass -> [Interval] -> [(Weight, PitchClass)] Source #

Get the relative note importance from a certain scale using the global weights table

mergeWeights :: Eq a => [(Weight, a)] -> [(Weight, a)] -> [(Weight, a)] Source #

inScale :: PitchClass -> [Interval] -> Constraint PitchClass Source #

Constraint that requires all generated notes to be in a certain scale

beamSelector :: (Eq a, Enum a) => Double -> Accessor st s a -> Selector a a Source #

Note selector that generates a distribution based on the last note that was generated

getDistributions :: (Eq a, Enum a) => a -> Double -> [(Weight, a)] -> [(Weight, a)] Source #

stripList :: [(Weight, a)] -> [a] Source #

genAspect :: (Eq a, Enum a) => Accessor GenState a a -> a -> Int -> Double -> [(Weight, a)] -> MusicGenerator () [a] Source #

diatonicPhrase :: Duration -> Density -> PitchClass -> [Interval] -> SemiChord -> [(Int, Octave)] -> MusicGenerator () MusicCore Source #

Generate a diatonic phrase. Strictly speaking, the generated melodies don't have to be diatonic, as any possible scale can be given to function as the generator's basis

diatonicMelody :: GenConfig -> MusicGenerator () MusicCore Source #

Generate a diatonic melody over a given chord progression. This is done by generating separate phrases that are linked together with a rest in between. The phraseses are aware of the chord they are over, so that they will use notes from the current chord with a higher probability.

phraseLength :: Density -> IO Duration Source #

Generate a (random) length for a phrase. A higher density will result in phrases with more notes allowed, in order to enforce that the average high density phrase will take roughly the same amount of time as the average low density phrase.

pauseLength :: IO Duration Source #

Choose a random rest length

fromDistribution :: [(Int, a)] -> IO a Source #

Generate an element from a distribution

chordalTimeline :: Music SemiChord -> [(SemiChord, Duration)] Source #

Convert a sequential piece of music to a timeline, containing pairs of all musical elements in the piece with the point in time they occur on

getTimeline :: [(Maybe a, Duration)] -> Duration -> [(a, Duration)] Source #

Convert a list of musical elements and durations to a list of all elements and the absolute point in time they occur on.

trimToLength :: Duration -> [Duration] -> [Duration] Source #

Trim a generated rhythm sequence to a certain length.

boundedRhythm :: Duration -> Density -> MusicGenerator () [Duration] Source #

Generate a rythm piece with a maximum length.

concatM :: Monad m => [m [a]] -> m [a] Source #

Concatenates the result of a list of monadic computations that all yield a list themselves