Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone

Synth.Sampler.Patch.Lib.Drum

Description

Utilities shared between drum patches.

The base structure is that a drum has an enumeration of articulations, where each one is a directory of samples of increasing dynamics. There are an arbitrary number of samples, which may or may not be normalized, which form a continuum, rather than having explicit dynamic groups. Since there are no explicit variation samples, variation takes neighbor dynamics, where the variation range is defined per-patch.

There is a Common.AttributeMap mapping attrs to each articulation.

Synopsis

Documentation

data ConvertMap art Source #

Constructors

ConvertMap 

Fields

convert :: Show art => ConvertMap art -> Note.Note -> Patch.ConvertM Sample.Sample Source #

Make a generic convert, suitable for drum type patches.

StrokeMap

data StrokeMap art Source #

Describe a drum-like instrument. This is just the data for the various functions to construct the patch.

Constructors

StrokeMap 

Fields

Instances

Instances details
Show art => Show (StrokeMap art) # 
Instance details

Defined in Synth.Sampler.Patch.Lib.Drum

Methods

showsPrec :: Int -> StrokeMap art -> ShowS #

show :: StrokeMap art -> String #

showList :: [StrokeMap art] -> ShowS #

strokeMapTable :: Ord art => Drums.Stops -> [(Char, Expr.Symbol, Attrs.Attributes, art, Drums.Group)] -> StrokeMap art Source #

Make a StrokeMap from a table with all the relevant info.

strokeMap :: Ord art => Drums.Stops -> [Drums.Stroke] -> Common.AttributeMap art -> StrokeMap art Source #

Make a StrokeMap from separate strokes and AttributeMap. This happens when instruments parts are factored apart, due to having both MIDI and im versions.

stopMap :: Ord art => [(art, Drums.Group)] -> [(Drums.Group, [Drums.Group])] -> Map art (Set art) Source #

inferDuration

inferDuration :: Ord art => StrokeMap art -> [Note.Note] -> [Note.Note] Source #

Notes ring until stopped by their stop note.

file list

makeFileList :: FilePath -> [FilePath] -> String -> IO () Source #

Generate haskell code for an Articulation -> [FilePath] function.

This expects a subdirectory for each articulation, whose name is the same as the Articulation constructor, and sorts it on the last numeric dash-separated field.

This could be done with TH but it's constant so it's simpler to copy paste into the source.