| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Harmonic.Interface.Tidal.Orchestra
Description
Voice line system (SATB + octave variants) and instrument functions
with built-in MIDI range clipping and octave handling.
Each instrument is a thin arrange wrapper — clip and octave shift
are internal; the composer sees only voice assignment and kinetics range.
Synopsis
- data Voice
- = Soprano
- | Alto
- | Tenor
- | Bass
- | Soprano8va
- | Alto8va
- | Tenor8va
- | Bass8va
- | Soprano15va
- | Alto15va
- | Tenor15va
- | Bass15va
- | Soprano8vb
- | Alto8vb
- | Tenor8vb
- | Bass8vb
- | Soprano15vb
- | Alto15vb
- | Tenor15vb
- | Bass15vb
- | Soprano'
- | Alto'
- | Tenor'
- | Bass'
- | Soprano8va'
- | Alto8va'
- | Tenor8va'
- | Bass8va'
- | Soprano15va'
- | Alto15va'
- | Tenor15va'
- | Bass15va'
- | Soprano8vb'
- | Alto8vb'
- | Tenor8vb'
- | Bass8vb'
- | Soprano15vb'
- | Alto15vb'
- | Tenor15vb'
- | Bass15vb'
- | Soprano''
- | Alto''
- | Tenor''
- | Bass''
- | Soprano8va''
- | Alto8va''
- | Tenor8va''
- | Bass8va''
- | Soprano15va''
- | Alto15va''
- | Tenor15va''
- | Bass15va''
- | Soprano8vb''
- | Alto8vb''
- | Tenor8vb''
- | Bass8vb''
- | Soprano15vb''
- | Alto15vb''
- | Tenor15vb''
- | Bass15vb''
- data VoiceLines = VoiceLines {}
- voiceLines :: VoiceLines
- vlGet :: Voice -> VoiceLines -> Pattern Int
- voiceOct :: Voice -> Int
- flute :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- oboe :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- clarinet :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- bassoon :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- horn :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- trombone :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- basstrom :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- harp :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- timpani :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- violin1 :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- violin2 :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- viola :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- cello :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- contrabass :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- bassdrum :: Pattern Bool -> ControlPattern
- tamtam :: Pattern Bool -> ControlPattern
- pizz :: ControlPattern
- spicc :: ControlPattern
- marc :: ControlPattern
- legg :: ControlPattern
- arco :: ControlPattern
- type Instrument = Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern
- divisi :: Int -> Instrument -> Instrument
- divisi2 :: ControlPattern
- divisi3 :: ControlPattern
- clip :: (Int, Int) -> ControlPattern -> ControlPattern
- voiceBase :: Voice -> Voice
- voiceTier :: Voice -> Int
Voice lines
An SATB voice, at one of five octave transpositions and one of three divisi tiers.
Divisi tiers: the base 20 voices (tier 0), then the same 20 primed (tier 1,
read the ' fields), then double-primed (tier 2, the '' fields). Declared
in three identical-order blocks of 20 so voiceBase / voiceTier derive by
enum arithmetic (mod / div 20). Octave rides the constructor, so e.g.
Bass8vb' reads the bass' field at octave −1.
Constructors
data VoiceLines Source #
The scale-degree pattern assigned to each voice.
Each SATB voice has three divisi tiers: base, ', ''. All are ordinary
scale-degree patterns (same syntax and semantics); the primed fields only
exist to hold extra divisi desks. Defaults stack one/two degrees above the
base so an undeclared divisi 3 voices a chord; declared primes are whatever
the composer writes.
Constructors
| VoiceLines | |
Fields
| |
voiceLines :: VoiceLines Source #
Default voice lines: root in the bass, root 8va in the soprano, inner voices on the 2nd and 3rd degrees. Override the fields you want:
vl = voiceLines { soprano = "3 4 3 2", bass = "0" }vlGet :: Voice -> VoiceLines -> Pattern Int Source #
Read the scale-degree pattern a given Voice should play, resolving both
its SATB letter and its divisi tier.
voiceOct :: Voice -> Int Source #
Octave transposition carried by a Voice constructor: 0 loco, 1 for
8va, 2 for 15va, -1 for 8vb, -2 for 15vb.
Pitched instruments
Every pitched instrument shares the Instrument shape and carries its
own MIDI range and channel. Ranges are given in Tidal note space
(MIDI − 60); the physical range follows in parentheses.
| Instrument | Channel | Range |
|---|---|---|
| flute oboe clarinet bassoon horn trombone basstrom harp timpani violin1/2 viola cello contrabass | 1 2 3 4 5 6 6 7 8 16 16 16 16 | C3-D6 Bb3-A6 D2-Bb6 Bb1-Eb5 B1-F5 Bb1-F5 A0-G3 B1-F#7 D2-C4 G3-A7 C3-E6 C2-C6 C1-C4 |
flute :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
oboe :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
clarinet :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
bassoon :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
horn :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
Brass, channels 5–6. basstrom shares channel 6 with trombone at a
lower range.
trombone :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
Brass, channels 5–6. basstrom shares channel 6 with trombone at a
lower range.
basstrom :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
Brass, channels 5–6. basstrom shares channel 6 with trombone at a
lower range.
harp :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
Harp, channel 7. The widest range in the orchestra.
timpani :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
Timpani, channel 8. Pitched percussion; the narrowest range.
violin1 :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
violin2 :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
viola :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
cello :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
contrabass :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
Unpitched percussion
bassdrum :: Pattern Bool -> ControlPattern Source #
Bass drum, channel 9. Struct-based: takes a boolean pattern rather than a voice, since it is unpitched.
d1 $ bassdrum "t ~ ~ t"
tamtam :: Pattern Bool -> ControlPattern Source #
Tam-tam, channel 11. Struct-based, with a long sustain.
String articulations
pizz :: ControlPattern Source #
String articulations, applied as a postfix channel override:
, violin1 T (0,1) k vl flow Soprano # pizz
pizz 12, spicc 13, marc 14, legg 15, arco 16 (the string default).
spicc :: ControlPattern Source #
String articulations, applied as a postfix channel override:
, violin1 T (0,1) k vl flow Soprano # pizz
pizz 12, spicc 13, marc 14, legg 15, arco 16 (the string default).
marc :: ControlPattern Source #
String articulations, applied as a postfix channel override:
, violin1 T (0,1) k vl flow Soprano # pizz
pizz 12, spicc 13, marc 14, legg 15, arco 16 (the string default).
legg :: ControlPattern Source #
String articulations, applied as a postfix channel override:
, violin1 T (0,1) k vl flow Soprano # pizz
pizz 12, spicc 13, marc 14, legg 15, arco 16 (the string default).
arco :: ControlPattern Source #
String articulations, applied as a postfix channel override:
, violin1 T (0,1) k vl flow Soprano # pizz
pizz 12, spicc 13, marc 14, legg 15, arco 16 (the string default).
Divisi
type Instrument = Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #
The shared shape of every orchestral instrument function.
divisi :: Int -> Instrument -> Instrument Source #
Optional prefix wrapper: divide an instrument into n desks, each reading
the next divisi tier of its voice (base, ' , ''), scaled by equal-power
1/sqrt n so the combined loudness matches the undivided line.
Used in the space form; drop divisi n and the line is a normal single voice:
, divisi 3 violin1 T (0,1) k vl grid Soprano — 3 desks: Soprano/Soprano'/Soprano''
, violin1 T (0,1) k vl grid Soprano — plain
Octave rides the Voice argument, so divisi 2 contrabass T (0.9,1) k vl grid Bass8vb
voices Bass8vb and Bass8vb' (tier + octave together).
divisi2 :: ControlPattern Source #
Equal-power volume scalers for hand-built desks that differ in articulation
or entry (not uniform divisi). Postfix like the articulation tags — set
amp; the block's outer |* vel d then multiplies, giving d/sqrt n.
, violin1 T (0,1) k vl flow Soprano # divisi2
, violin1 T (0.9,1) k vl grid Soprano' # divisi2
divisi3 :: ControlPattern Source #
Equal-power volume scalers for hand-built desks that differ in articulation
or entry (not uniform divisi). Postfix like the articulation tags — set
amp; the block's outer |* vel d then multiplies, giving d/sqrt n.
, violin1 T (0,1) k vl flow Soprano # divisi2
, violin1 T (0.9,1) k vl grid Soprano' # divisi2
Internal (for testing only)
clip :: (Int, Int) -> ControlPattern -> ControlPattern Source #
Drop any event whose note falls outside a MIDI range. Applied outermost by
Instrument, so it filters after the octave shift.