PDA

View Full Version : Attenuate the machine gun effect for Silver and Sonar users


SergeD
07-04-2005, 10:10 AM
Hi,

Theo Krueger offered a bright manner to eliminate the machine gun effect for Gold and Kontakt 2 users in this thread http://www.soundsonline-forums.com/showthread.php?t=969

I clumsily proposed something for Silver users having Sonar in his thread. Sorry Theo, I apologize for this hijack. Besides, after reading the pdf file from Scott Cairns, it seems that my script has a totally different approach from the Theo idea.

Now this Cal script is intented to attenuate (instead of eliminate) the machine gun effect for Silver users working with Sonar or Homestudio.

Since samples are already stretched in Silver the theo idea cannot be applied in this library. But I think that if a sample is gently pitched the results are not so bad.

Are some silver users would like to try this script with samples like snare, glock or any staccato articulation and give their appreciation please ?

;; ---------------------
;; Pitch_RANDOM.CAL, by Serge Daigneault 2005
;; Insert random pitch

(do
(dword setting 6) ; Or whatever you want
(int NewPitch 0)
(int OldPitch 0)
(int Channel 0)

(do
(forEachEvent
(do
(if (== Event.Kind NOTE)
(do
(= NewPitch OldPitch)
(= Channel Event.Chan)

; Randomize pitch. No repeating equal values ...

(while (== NewPitch OldPitch)
(= NewPitch (* 15 (random (* -1 setting) setting)))
)
(insert (- Event.Time 1) Channel WHEEL NewPitch) ; Random wheel
(= OldPitch NewPitch)
))
))
(insert Event.Time Channel WHEEL 0) ; Reset wheel on last note event
)
)
;;------------------------

For people which have never used Cal files in Sonar, follow these steps:

1) In Sonar or HomeStudio check in Options / Global where is the Cal folder
2) Copy and paste this script in a file, save the file as Pitch_RANDOM.CAL in the Cal Folder
3) In Sonar select repetitive notes which sound as machine gun.
4) Hit Ctrl + F1 and double click on Pitch_RANDOM.CAL


Thanks,

SergeD

SergeD
07-06-2005, 01:03 PM
This final script randomize pitch, velocity, duration and time event.

;; ---------------------------
;; __Randomizer.Cal, by Serge Daigneault 2005
;; Insert random pitch, velocity, duration and event time
;; Be careful with Variation values. Values below 2 will conduct to and endless loop trap.

(do
(int PitchVar 6) ; Pitch variation may be changed
(int VelVar 5) ; Velocity variation may be changed
(int DurVar 10) ; Duration variation may be changed
(int EveVar 5) ; Event time variation may be changed

(int NoteVel 0) ; If NoteVel = 0 Note.Vel is used, otherwise NoteVel is used
(int NoteDur 0) ; If NoteDur = 0 Note.Dur is used, otherwise NoteDur is used

(int VelVal 0)
(int DurVal 0)
(int EveVal 0)

(int NewPitch 0)
(int OldPitch 0)
(int NewVel 0)
(int OldVel 0)
(int NewDur 0)
(int OldDur 0)
(int NewEve 0)
(int OldEve 0)
(int Channel 0)

(do
(forEachEvent
(do
(if (== Event.Kind NOTE)
(do
(= NewPitch OldPitch)

(= NewVel OldVel)
(= VelVal Note.Vel)
(if (> NoteVel 0) (= VelVal NoteVel)) ; instead of Note.Vel used

(= NewDur OldDur)
(= DurVal Note.Dur) ; or any constant number
(if (> NoteDur 0) (= DurVal NoteDur)) ; instead of Note.Dur used

(= NewEve OldEve)
(= Channel Event.Chan)

; Randomize pitch, velocity, duration and Time event. No repeating equal values ...

(while ( || ( || (|| (== NewPitch OldPitch) (== NewVel OldVel)) (== NewDur OldDur)) (== NewEve OldEve))
(do
(= NewPitch (* 15 (random (* -1 PitchVar) PitchVar))) ; may try other than 15 value
(= NewVel (+ VelVal (random (* -1 VelVar) VelVar)))
(= NewDur (+ DurVal (random (* -1 DurVar) DurVar)))
(= NewEve (+ EveVal (random (* -1 EveVar) EveVar)))
))
(+= Event.Time NewEve) ; Random Time Event
(= Note.Vel NewVel) ; Random velocity
(= Note.Dur NewDur) ; Random duration
(insert (- Event.Time 1) Channel WHEEL NewPitch) ; Random wheel

(= OldPitch NewPitch)
(= OldVel NewVel)
(= OldDur NewDur)
(= OldEve NewEve)
))
))
(insert Event.Time Channel WHEEL 0) ; Reset wheel on last note event
)
)
;; ---------------------------

Sorry for the lack of tabs, I could not preserved them in the thread...

SergeD