theHarmonicAlgorithm-3.0.0: Real-time harmonic progression generation for TidalCycles live performance
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Voice lines

data Voice Source #

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.

Instances

Instances details
Bounded Voice Source # 
Instance details

Defined in Harmonic.Interface.Tidal.Orchestra

Enum Voice Source # 
Instance details

Defined in Harmonic.Interface.Tidal.Orchestra

Show Voice Source # 
Instance details

Defined in Harmonic.Interface.Tidal.Orchestra

Methods

showsPrec :: Int -> Voice -> ShowS #

show :: Voice -> String #

showList :: [Voice] -> ShowS #

Eq Voice Source # 
Instance details

Defined in Harmonic.Interface.Tidal.Orchestra

Methods

(==) :: Voice -> Voice -> Bool #

(/=) :: Voice -> Voice -> Bool #

Ord Voice Source # 
Instance details

Defined in Harmonic.Interface.Tidal.Orchestra

Methods

compare :: Voice -> Voice -> Ordering #

(<) :: Voice -> Voice -> Bool #

(<=) :: Voice -> Voice -> Bool #

(>) :: Voice -> Voice -> Bool #

(>=) :: Voice -> Voice -> Bool #

max :: Voice -> Voice -> Voice #

min :: Voice -> Voice -> Voice #

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.

InstrumentChannelRange
flute oboe clarinet bassoon horn trombone basstrom harp timpani violin1/2 viola cello contrabass1 2 3 4 5 6 6 7 8 16 16 16 16C3-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 #

Winds, channels 1–4.

Every pitched instrument takes a prepended Layer argument — T to voice the triad layer (default harmonic behaviour), S for the strata layer, M for the diatonic-mode layer:

d1 $ flute T (0,1) k voiceLines flow Soprano ["0 1 2 3"]

oboe :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Winds, channels 1–4.

Every pitched instrument takes a prepended Layer argument — T to voice the triad layer (default harmonic behaviour), S for the strata layer, M for the diatonic-mode layer:

d1 $ flute T (0,1) k voiceLines flow Soprano ["0 1 2 3"]

clarinet :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Winds, channels 1–4.

Every pitched instrument takes a prepended Layer argument — T to voice the triad layer (default harmonic behaviour), S for the strata layer, M for the diatonic-mode layer:

d1 $ flute T (0,1) k voiceLines flow Soprano ["0 1 2 3"]

bassoon :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Winds, channels 1–4.

Every pitched instrument takes a prepended Layer argument — T to voice the triad layer (default harmonic behaviour), S for the strata layer, M for the diatonic-mode layer:

d1 $ flute T (0,1) k voiceLines flow Soprano ["0 1 2 3"]

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 #

Strings. All default to channel 16 (arco); prefix an articulation (pizz, spicc, marc, legg) to route elsewhere.

violin2 :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Strings. All default to channel 16 (arco); prefix an articulation (pizz, spicc, marc, legg) to route elsewhere.

viola :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Strings. All default to channel 16 (arco); prefix an articulation (pizz, spicc, marc, legg) to route elsewhere.

cello :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Strings. All default to channel 16 (arco); prefix an articulation (pizz, spicc, marc, legg) to route elsewhere.

contrabass :: Layer -> (Double, Double) -> IK -> VoiceLines -> VoiceFunction -> Voice -> ControlPattern Source #

Strings. All default to channel 16 (arco); prefix an articulation (pizz, spicc, marc, legg) to route elsewhere.

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.

voiceBase :: Voice -> Voice Source #

Strip the divisi prime, giving the tier-0 (base) voice. Relies on the three identical-order Voice blocks of 20.

voiceTier :: Voice -> Int Source #

Divisi tier of a voice: 0 (base), 1 ('), 2 ('').