Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

BPM 90 ; was 86 but on est a la noire

VARIANCE 0.3

;;;;; Sampler Channel Maps


;;;;; Sampler maps contain mapping for base pitch as key to
corresponding "filename", base DB amplitude and panning.
; pair: first: midi pitch, second: filename, amp(db), pan (0:left/
sampler1 - 1:right/sampler2)
;;;;; They are defined by channel. They are employed later by
Makenote to prepare Samplor object messages.
$channel2 := map {
(95, ["APIZZd-95-N.A.wav", -1.0, 1.]),
(92, ["APIZZd-92-N.A.wav", -1.0, 1.]),
(89, ["APIZZd-89-N.A.wav", -1.0, 1.]),
(86, ["APIZZd-86-N.A.wav", -1.0, 1.]),
(82, ["APIZZd-82-N.A.wav", -1.0, 1.]),
(79, ["APIZZd-79-N.A.wav", -1.0, 1.]),
(72, ["APIZZd-72-N.A.wav", -1.0, 1.]),
(66, ["APIZZd-66-N.A.wav", -1.0, 1.]),
(62, ["APIZZd-62-N.A.wav", -1.0, 1.]),
(59, ["APIZZd-59-N.A.wav", -1.0, 1.]),
(56, ["APIZZd-56-N.A.wav", -1.0, 1.])
}

$channel5 := map {
(98, ["ESA-98-NG.AI.wav", -4.0, 1.]),
(95, ["ESA-95-NG.AI.wav", -4.0, 1.]),
(89, ["ESA-89-NG.AI.wav", -4.0, 1.]),
(86, ["ESA-86-NG.AI.wav", -4.0, 1.]),
(84, ["ESA-NEW-84.A.wav", -4.0, 1.]),
(81, ["ESA-NEW-81.A.wav", -4.0, 1.]),
(77, ["ASA-BIS-77.A.wav", -4.0, 1.]),
(73, ["ASA-73-NG.AI.wav", -4.0, 1.]),
(70, ["ASA-70-NG.AI.wav", -4.0, 1.]),
(69, ["DSA-69-NG.AI.wav", -4.0, 1.]),
(66, ["DSA-66-NG.AI.wav", -4.0, 1.]),
(63, ["DSA-63-NG.AI.wav", -4.0, 1.]),
(62, ["GSA-62-NG.AI.wav", -4.0, 1.]),
(59, ["GSA-59-NG.AI.wav", -4.0, 1.]),
(56, ["GSA-56-NG.AI.wav", -4.0, 1.])
}

$channel12 := map {
(95, ["APIZZd-95-N.A.wav", -5.0, 0.]),
(92, ["APIZZd-92-N.A.wav", -5.0, 0.]),
(89, ["APIZZd-89-N.A.wav", -5.0, 0.]),
(86, ["APIZZd-86-N.A.wav", -5.0, 0.]),
(82, ["APIZZd-82-N.A.wav", -5.0, 0.]),
(79, ["APIZZd-79-N.A.wav", -5.0, 0.]),
(72, ["APIZZd-72-N.A.wav", -5.0, 0.]),
(66, ["APIZZd-66-N.A.wav", -5.0, 0.]),
(62, ["APIZZd-62-N.A.wav", -5.0, 0.]),
(59, ["APIZZd-59-N.A.wav", -5.0, 0.]),
(56, ["APIZZd-56-N.A.wav", -5.0, 0.])
}

$channel13 := map {
(86, ["LONG-86-N.AI.wav", -5.0, 0.]),
(82, ["LONG-82-N.AI.wav", -5.0, 0.]),
(79, ["LONG-79-N.AI.wav", -5.0, 0.]),
(76, ["LONG-76-N.AI.wav", -5.0, 0.]),
(72, ["LONG-72-N.AI.wav", -5.0, 0.]),
(69, ["LONG-69-N.AI.wav", -5.0, 0.]),
(66, ["LONG-66-N.AI.wav", -5.0, 0.]),
(62, ["LONG-62-N.AI.wav", -5.0, 0.]),
(59, ["LONG-59-N.AI.wav", -5.0, 0.]),
(56, ["LONG-56-N.AI.wav", -5.0, 0.])
}

;;;;; Samplor Object Map


; A MAP OF MAP... containing MIDI channel configurations
$samplor := map {
(2, $channel2),
(5, $channel5),
(12, $channel12),
(13, $channel13)
}

; Function to use in @find for map that attempts to find the closest
key to input $a
@fun_def @closest($a, $key, $value) { $key >= $a }
/* Translate MIDI message to Samplor messages
Samplor arguments: <bang> <buffer-name> <offset/0> <dur/0>
<trans-inPitchScale> <amp> <pan>
Transposition: in semi-tones in MAP, translates to
2^(x/12).
Amplitude: Combine amp in MAP (db) & velocity. In
Linear.
*/
@MACRO_DEF Makenote($pitch, $velocity, $channel, $dur)
{
group Midinote_
{
;; Samplor value for $channel are in the inner
table $samplor($channel)
;; Now we need to calculate the needed
transposition from existing pitches.
;; NOTE: We will store calculations in @LOCAL
variables.
;; There will be certainly parallel calls to
this module and
;; this will avoid values being mixed through
various calls.
;; You need to explicitly tell Antescofo if
variables are local:
@local $ref_pitch, $trans, $amplitude, $panning,
$filename
; find closest pitch in samplor to requested pitch
$ref_pitch := @find($samplor($channel),
@closest($pitch))
if (@is_undef($ref_pitch))
{
$ref_pitch := @max_key($samplor($channel))
}

; calculate the transposition value in pitch-scale


factor for pitch in $p
$trans := @pow(2.,($pitch - $ref_pitch)/12.0)
; amplitude is Db value stored in MAP (convert to
linear) times velocity value (linear)
$amplitude := (($velocity/
127.0)*(@pow(10.,$samplor($channel)($ref_pitch)[1]/20)))
; panning and filename are just inside the map
$panning := ($samplor($channel)($ref_pitch)[2])
$filename := ($samplor($channel)($ref_pitch)[0])

samplor-in adsr 1. 1. 100. 20.


samplor-in 0. $filename 0 0 $trans $amplitude
$panning ;note-on
$dur samplor-in 0. $filename 0 0 $trans 0.
$panning ;note-off

}
}

;;;;;;; Chaotic Note generator:


;; Arguments:
;; $pitchlist : table of MIDI pitches
;; $gracedelay: delay for generating note after grace
(short beat time)
;; 3 offset levels in Db
;; sends random pitch from list: 2 pitches or 1 pitch - velocity 50,
duration 500ms
;; PATTERN0: 2 pitches: channel 1/5 (random) and channel 1/5
(random) -- delayed by variable r3a-grace-dur (80ms)
;; PATTERN1: 1 pitch: channel 2
;; To choose between the two, reads randomly from a table of [0, 0,
0, 1] to choose patterns
@MACRO_DEF ChaoticNotegen($pitchlist, $unitdur, $graceoffset,
$note1offset, $note2offset )
{
@local $chooser1, $channels, $randompitch, $randomchannel1,
$randomchannel2, $randomlevel, $gracedelay
$chooser := @rand_int(4) ; returns 0, 1, 2 or 3
$channels := [2, 5]
$randompitch := @rand_int(@size($pitchlist))
$dblvls := [0, -6, -9, -12]
$randomlevel := @rand_int(4)

switch
{
; if random is 1,2 or 3, a grace note followed by a note is
generated
case ($chooser > 0):
$randomchannel1 := @rand_int(2)
$randomchannel2 := @rand_int(2)

;;; Grace note generation: Set level


samp2-out-db (($dblvls[$randomlevel])+
$graceoffset)
;;; Grace note generation: Duration is 40% of the
event duration, choose channel randomly between pizz and arco
@Makenote( ($pitchlist[$randompitch]), 50,
($channels[$randomchannel1]), $unitdur*0.4)
;;; Note generation: set level. Delayed by the
duration of Pizz
$unitdur*0.4 samp2-out-db
(($dblvls[$randomlevel])+$note1offset)
;;; Note generation: Duration is 60% of the event
duration. Choose channel randomly
@Makenote( ($pitchlist[$randompitch]), 50,
($channels[$randomchannel2]), 500ms)

case ($chooser ==0):


samp2-out-db (($dblvls[$randomlevel])+
$note2offset) 5
@Makenote(($pitchlist[$randompitch]), 50, 2,
$unitdur)

;;; Chaotic Phrase generator:


;; calls Hysteria Note Generator
;; Creates a loop, each cycle has a random (max given by $n-units,9)
elements,
;; delays between elements are given by $unit-dur
(200ms)
;; After the end of each cycle wairs for ($until-n-wait*$unit-dur)
;; to launch the new cycle
;; ARGUMENTS:
;; - $pitchlist: table of pitches
;; - $nunits: integer, max number of units in a phrase
;; - $unitdur: time duration of a cycle
;; - $waituntil: # of cycles to wait after each loop
;; - $leveloffsets: level offsets in db, table of three values
@proc_def Chaotic($pitchlist, $nunits, $nrest, $unitdur,
$leveloffsets )
{
loop Phrase ( ($nunits-1)*$unitdur + $nrest*$unitdur)
@tempo := 60
{
;print set Chaotic phrase loop with ($numelements)
elements
@local $counter
$counter := 0
loop Notes ($unitdur)
{
@ChaoticNotegen($pitchlist, $unitdur,
($leveloffsets[0]), ($leveloffsets[1]), ($leveloffsets[2]))
$counter := $counter +1
}until ($counter >= $nunits)

; Note: Rests are generated automatically since the


period of loop "Phrase" is > period of loop "Notes"
}
}

;; turn on sampler
samp1-out-db -3.0
samp2-out-db 0.0
ir1-out-db -3.0

;; put it on stereo
src5 1. 1. 0. 0. 0. 0.
ir1-param damping 0.3,early 0.1, tail 0.75, roomsize 75, spread 23,
bandwidth 0.5, dry 0.0, revtime 11.0

/****** Commented:
NOTE D4 4.0

@Makenote(77, 80, 13, 500ms)


@Makenote(101, 80, 13, 500ms)

;;;;;;; Launch Two Chaotic Processes


$leveloffsets := [-9, -18, -24]
$pitchlist1 := [82, 83, 84, 90, 91]
$R3A := ::Chaotic($pitchlist1, 9, 3, 0.2, $leveloffsets )

$pitchlist2 := [77, 81, 87, 88]


$R3B := ::Chaotic($pitchlist2, 11, 4, 0.175,
$leveloffsets )

abort $R3A
abort $R3B

;;;;;; Cloud
ir1-param revtime 40.0, tail 0.75, early 0.1, bandwidth 0.5
$cloudpitches := [77, 81, 82, 83, 84, 87, 88, 90, 91]
$cloud_n := 9
;; Generate cloud_n1 times with 20ms delays between each
generation, pitches from list randomly
;; Send each pitch to channel 12 (vel= 80, dur=200ms) and
channel 13 (vel=20, dur=500ms)
$counter := 0
loop cloud 0.02 @tempo:=60
{
$randompitch :=
$cloudpitches[ (@rand_int( @size($cloudpitches) ) ) ]
;print DEBUG: Cloud random pitch on iteration
$counter is $randompitch
@Makenote($randompitch, 80, 12, 200ms)
@Makenote($randompitch, 20, 13, 500ms)
$counter := $counter + 1
} until ($counter >= (2*$cloud_n) )*/

You might also like