temporal-music-notation-0.2.3: music notation

Safe HaskellSafe-Inferred

Temporal.Music.Volume

Contents

Description

This module defines the notion of volume.

Synopsis

Types

data Diap Source

Diapason defines minimum and maximum bound for Volume level. Field diapLim specifies volume limit. Value diapLim is rendered to highest amplitude and -diapLim is rendered to the lowest amplitude. All values that go beyond the limit are clipped.

Constructors

Diap 

Fields

diapRange :: (Double, Double)
 
diapLim :: Int
 

Instances

data Volume Source

Volume denotes amplitude. It's not a Double for ease of performing some musical transformations, such as making notes louder or using accents. Volume can be converted to Double with function amp.

Constructors

Volume 

type Level = IntSource

Volume levels.

type Accent = DoubleSource

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

VolumeLike

class VolumeLike a whereSource

Volume can be used alongside with many other parameters (they can define timbre or pitch). Class VolumeLike provides getters and setters for data types that contain value of type Volume. In Temporal.Music.Score module you can find many functions that are defined in terms of this class. Once you have chosen some note representation you can make an instance for it and use all volume-modifiers.

Methods

setVolume :: Volume -> a -> aSource

getVolume :: a -> VolumeSource

mapVolume :: VolumeLike a => (Volume -> Volume) -> a -> aSource

Volume modifier.

Rendering

absVolume :: VolumeLike a => a -> DoubleSource

Calculates amplitude for a Volume -like value.

volumeAsDouble :: Volume -> DoubleSource

Calculates value of type Volume as coordinate within specidfied diapason. 1 corresponds to maximum bound and 0 corresponds to minimum bound.

diapAt :: Diap -> Double -> DoubleSource

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