temporal-music-notation-0.1.6: music notation

Temporal.Music.Notation.Volume

Contents

Description

representing volume

Synopsis

Types

Main datatypes are Amplitude, Diapason and Level. Volume consists of Diapason and Level. Every Volume can be converted to Amplitude (see absVolume). Amplitude is linear units and Level is logarithmic units, or decibels. Diapason defines lower and upper bound for volume level in amplitude linear units.

type Amplitude = DoubleSource

Linear volume units

type Diapason = (Amplitude, Amplitude)Source

Volume lower and upper bounds. Lower bound must be positive and upper bound must exceed lower bound.

type Accent = DoubleSource

Accent defines values between Level values on logarithmic scale. 1 Accent == 1 Level 's step.

class Seg a => Vol a whereSource

Methods

volume :: Level a -> Volume aSource

data Seg n => Volume n Source

Volume consists of Diapason and Level.

Constructors

Volume 

Instances

(Eq n, Seg n) => Eq (Volume n) 
(Show n, Seg n) => Show (Volume n) 
Seg n => LevelFunctor (Volume n) 
Seg n => VolumeFunctor (Volume n) 

data Seg n => Level n Source

Level defines number of equally spaced stamps on logarithmic scale (steps), and degree of diversion from the stamps (accents).

Constructors

Level 

Fields

levelAccent :: Accent
 
levelStep :: n
 

Instances

Seg n => Bounded (Level n) 
Seg n => Enum (Level n) 
(Eq n, Seg n) => Eq (Level n) 
(Show n, Eq n, Seg n) => Num (Level n) 
(Eq n, Seg n) => Ord (Level n) 
(Show n, Seg n) => Show (Level n) 
Seg n => Seg (Level n) 
Seg n => LevelFunctor (Level n) 

volumeNum :: Seg n => Volume n -> IntSource

number of levels in Volume scale

levelNum :: Seg n => Level n -> IntSource

number of levels in Level scale

level :: Seg n => n -> Level nSource

level constructs Level from type of class Seg. Accent is set to zero.

mediumLevel :: Seg n => Level nSource

Medium level

Transformers

class VolumeFunctor a whereSource

Methods

mapVolume :: (forall n. Seg n => Volume n -> Volume n) -> a -> aSource

Instances

VolumeFunctor a => VolumeFunctor (Score a) 
Seg n => VolumeFunctor (Volume n) 
Seg nVol => VolumeFunctor (Drum nVol a) 
(Seg nVol, Seg nPch) => VolumeFunctor (Note nVol nPch a) 

class LevelFunctor a whereSource

Methods

mapLevel :: (forall n. Seg n => Level n -> Level n) -> a -> aSource

Instances

LevelFunctor a => LevelFunctor (Score a) 
Seg n => LevelFunctor (Level n) 
Seg n => LevelFunctor (Volume n) 
Seg nVol => LevelFunctor (Drum nVol a) 
(Seg nVol, Seg nPch) => LevelFunctor (Note nVol nPch a) 

setDiapason :: VolumeFunctor a => (Amplitude, Amplitude) -> a -> aSource

sets diapason to specified value

setDiapasonRel :: VolumeFunctor a => (Double, Double) -> a -> aSource

relative update of diapason value in decibels, (0, 1) turns diapason interval into itself.

setLevel :: (Seg n, LevelFunctor a) => n -> a -> aSource

setLevel sets levelStep to given input

setAccent :: LevelFunctor a => Accent -> a -> aSource

setAccent sets Accent value to given input

accent :: LevelFunctor a => Accent -> a -> aSource

accent increases Accent value by some degree

al' :: LevelFunctor a => Accent -> a -> aSource

shorcut for 'accent louder'

aq' :: LevelFunctor a => Accent -> a -> aSource

shorcut for 'accent quieter'

loud :: LevelFunctor a => a -> aSource

Input becomes one step louder

quiet :: LevelFunctor a => a -> aSource

Input becomes one step quieter

louder :: LevelFunctor a => Int -> a -> aSource

Input becomes given number of steps louder

quieter :: LevelFunctor a => Int -> a -> aSource

Input becomes given number of steps quieter

dynamics :: LevelFunctor a => (Time -> Accent) -> Score a -> Score aSource

Accent that depends on time of note

dynamicsRel :: LevelFunctor a => [Accent] -> Score a -> Score aSource

Linear relative dyn function. Function is defined by list of its values equaly spaced along time axis. For example list [0, 1, 0] defines rise then decay lineary along full Score 's input duration. Time intervals of rise and decay segments are equal to dur /2. And list [0, 1, 0.5, 0] defines rise and decay again but here decay segment is twice longer then rise segment.

dynamicsSeg :: LevelFunctor a => [Double] -> Score a -> Score aSource

dynSeg lifts linseg function to dynamics level

Rendering

amplitude :: Seg n => Diapason -> Level n -> AmplitudeSource

converts equally spaced between lower and upper diapason bounds Level values to amplitudes. Here resulting amplitude value lies within Diapason interval. All outsiders are placed inside interval with saturation.

unsafeAmplitude :: Seg n => Diapason -> Level n -> AmplitudeSource

unsafe analog of amplitude function. Here result can go beyond limits of Diapason interval.

absVolume :: Seg n => Volume n -> AmplitudeSource

converts volume to amplitude with amplitude function

unsafeAbsVolume :: Seg n => Volume n -> AmplitudeSource

converts volume to amplitude with unsafeAmplitude function

diapasonAt :: Diapason -> Double -> DoubleSource

mapps decibels to amplitudes within specified amplitude diapason, 0 turns to lower diapason value and 1 turns to higher diapason value

levelAsDouble :: Seg s => Level s -> DoubleSource

converts level value to double

unsafeLevelAsDouble :: Seg s => Level s -> DoubleSource

converts level value to double, value can exceed level limits

levelAsDoubleRel :: Seg s => Level s -> DoubleSource

converts level value to double, and normalizes output by level limits

unsafeLevelAsDoubleRel :: Seg s => Level s -> DoubleSource

converts level value to double and normalizes output by level limits, value can exceed (0, 1) interval