Safe Haskell | Safe-Inferred |
---|
This module defines the notion of volume.
- data Diap = Diap {}
- data Volume = Volume {
- volumeDiap :: Diap
- volumeAccent :: Accent
- volumeLevel :: Level
- type Level = Int
- type Accent = Double
- class VolumeLike a where
- mapVolume :: VolumeLike a => (Volume -> Volume) -> a -> a
- absVolume :: VolumeLike a => a -> Double
- volumeAsDouble :: Volume -> Double
- diapAt :: Diap -> Double -> Double
Types
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
.
Volume | |
|
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.
VolumeLike Volume | |
VolumeLike (Drum a) | |
VolumeLike (Note a) |
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.