hs-pattrans-0.1.0.2: DSL for musical patterns and transformation, based on contravariant functors.

Safe HaskellNone
LanguageHaskell2010

Discovery

Synopsis

Documentation

type Query a = (Check a, a) Source #

data UserQuery a Source #

Constructors

ToPattern a => (Check Pattern) :@ a 

upTo :: Time -> Time -> (Time, Time) Source #

query :: Query Pattern -> MusicPiece -> [Pattern] Source #

Query equivalent patterns using a sliding window.

query1 :: UserQuery (Time, Time) Source #

Example queries.

query2 :: UserQuery (Music Pitch) Source #

(??) :: ToPattern a => Song -> UserQuery a -> IO () infix 0 Source #

Query patterns from the given song with given base pattern. e.g. "bach" ?? query1/query2

class ToPattern a where Source #

Types from which we can extract a pattern from a given song.

Minimal complete definition

toPattern

Methods

toPattern :: MusicPiece -> a -> Pattern Source #

Instances

ToMusic1 a => ToPattern (Music a) Source #

Given a datatype that can be converted to Euterpea's core Music datatype, one can subsequently convert that to get a musical pattern.

Methods

toPattern :: MusicPiece -> Music a -> Pattern Source #

ToPattern (Time, Time) Source #

Given a song name, one can extract a musical pattern by parsing the song file and selecting some time period.