this post refers to
http://michu.kofeina.net/kickandsnare04.zip
and tries to explain how it works.
it was written with an assumption that it will be run with rate set to 1/16.
first, there is a bunch of set opcodes, just initializing variables . helix' virtual machine generally allows only variables and labels to be used as arguments, eg. if one wants to use .666 to multiply something it should be declared as $satan variable or something.
among other things there is a counter setup. the counter is supposed to count from 0 to 31. it makes 32 steps ie 2 bars.
also notable is $chaos variable. this is kind of a seed value for a quasi-random function that makes stuff a bit less predictable. it can take any value in 0..1 range and changing it will make beats a bit different for the same note input.
let's skip the rest for now.
the initialization part is supposed to be run only once so there is a @loop label after that marking a point where the script should return for next iteration.
then there is a check if it is 1st beat in a bar (downbeat). it is done by copying counter value to a variable and perfoming modulo 16 on it. if the value returned is zero the kick will be played.
then there is a check if it is a 2nd or 4th beat (upbeat) where we want a snare.
this is done by copying counter value to a variable adding 4 to it and the doing modulo 8. if the value returned is 0 the snare will be played.
so a kick on 1 and a snare on 2 and 4 are there for sure.
for other steps in a bar there is decision process if the script should play something or leave the step mute. it involves variables i called $density, $ramping, $tension and $chaos. if the sum of this variables is >.5 a hit (for now undetermined) will be played.
$density is created by getting highest note pressed, performing mod12 on it to make sure the value is in 0..11 range regardless of the octave used and scaling it down.
$ramping is created by scaling down a current counter value so we get a 2 bars ramp of increasing hit probability creating a kind of a phraze.
$tension is a variable that gets zeroed if something was played and increased if not. the script wants to hit something and gets itchy if it doesn't for a few steps
$chaos is a quasi-random function axmod1. a can be either pi or phi depending if something was played. i like irrational numbers.
so if script decides to play something on a given step it has to decide if it should be a kick or a snare.
variables involved are $balance, $isevenincentive and $lastplayed. if sum of them is >.5 the kick will be played.
$balance is initialized at .49, is increased with each snare played and decreased with each kick. it tries to ensure that more or less the same number of kicks and snares will be played in a longer run.
$isevenincentive is added if the step is even ie an 1/8 note. this increases probablity of kick.
$lastplayed is set to zero if a kick was played, to hit velocity on a snare and is halved on each mute step. it prevents snare machineguns.
in the end we have parts which actually play (or not) given hit, perform operations for $tension, $lastplayed and $chaos, increment and eventually reset $counter and go back to @loop.
hopefully it makes a tiny bit of sense now
kickandsnare script for MaliceX
Official support for: audjoo.com
Moderator: JonasNorberg
kickandsnare script for MaliceX
2009-02-19T23:09:06+00:00
this post refers to
http://michu.kofeina.net/kickandsnare04.zip
and tries to explain how it works.
it was written with an assumption that it will be run with rate set to 1/16.
first, there is a bunch of set opcodes, just initializing variables . helix' virtual machine generally allows only variables and labels to be used as arguments, eg. if one wants to use .666 to multiply something it should be declared as $satan variable or something.
among other things there is a counter setup. the counter is supposed to count from 0 to 31. it makes 32 steps ie 2 bars.
also notable is $chaos variable. this is kind of a seed value for a quasi-random function that makes stuff a bit less predictable. it can take any value in 0..1 range and changing it will make beats a bit different for the same note input.
let's skip the rest for now.
the initialization part is supposed to be run only once so there is a @loop label after that marking a point where the script should return for next iteration.
then there is a check if it is 1st beat in a bar (downbeat). it is done by copying counter value to a variable and perfoming modulo 16 on it. if the value returned is zero the kick will be played.
then there is a check if it is a 2nd or 4th beat (upbeat) where we want a snare.
this is done by copying counter value to a variable adding 4 to it and the doing modulo 8. if the value returned is 0 the snare will be played.
so a kick on 1 and a snare on 2 and 4 are there for sure.
for other steps in a bar there is decision process if the script should play something or leave the step mute. it involves variables i called $density, $ramping, $tension and $chaos. if the sum of this variables is >.5 a hit (for now undetermined) will be played.
$density is created by getting highest note pressed, performing mod12 on it to make sure the value is in 0..11 range regardless of the octave used and scaling it down.
$ramping is created by scaling down a current counter value so we get a 2 bars ramp of increasing hit probability creating a kind of a phraze.
$tension is a variable that gets zeroed if something was played and increased if not. the script wants to hit something and gets itchy if it doesn't for a few steps
$chaos is a quasi-random function axmod1. a can be either pi or phi depending if something was played. i like irrational numbers.
so if script decides to play something on a given step it has to decide if it should be a kick or a snare.
variables involved are $balance, $isevenincentive and $lastplayed. if sum of them is >.5 the kick will be played.
$balance is initialized at .49, is increased with each snare played and decreased with each kick. it tries to ensure that more or less the same number of kicks and snares will be played in a longer run.
$isevenincentive is added if the step is even ie an 1/8 note. this increases probablity of kick.
$lastplayed is set to zero if a kick was played, to hit velocity on a snare and is halved on each mute step. it prevents snare machineguns.
in the end we have parts which actually play (or not) given hit, perform operations for $tension, $lastplayed and $chaos, increment and eventually reset $counter and go back to @loop.
hopefully it makes a tiny bit of sense now
michu
https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=1017
-
- KVRist
- Topic Starter
- 380 posts since 30 Aug, 2001 from Pyrlandia
-
- KVRAF
- 2901 posts since 26 Jul, 2005 from dun unda
- Contact:
Well it's most certainly quite a mouthful, but thanks for explaining their functions in full detail.
I suppose the real way to find out properly is to reference, edit and execute. Heh. (I'm no coder, yet.)
Regards.
I suppose the real way to find out properly is to reference, edit and execute. Heh. (I'm no coder, yet.)
Regards.
Post Reply
2 posts
• Page 1 of 1
Jump to
- The Main Forums
- ↳ KVR Studio Manager
- ↳ KVR Experts
- ↳ Getting Started (AKA What is the best...?)
- ↳ Instruments
- ↳ Effects
- ↳ Hosts & Applications (Sequencers, DAWs, Audio Editors, etc.)
- ↳ Guitars
- ↳ Mobile Apps and Hardware
- ↳ Soundware
- ↳ Samplers, Sampling & Sample Libraries
- ↳ Hardware (Instruments and Effects)
- ↳ Modular Synthesis
- ↳ Sound Design
- ↳ Production Techniques
- ↳ Music Theory
- ↳ Computer Setup and System Configuration
- ↳ DSP and Plugin Development
- ↳ DIY: Build it and they will come
- ↳ Music Cafe
- ↳ Sell & Buy (+Special Offers, Deals & Promos)
- ↳ KVR Developer Challenge 2023
- ↳ Everything Else (Music related)
- ↳ Off Topic
- ↳ Off Topic Classics
- Official Company Forums
- ↳ 2getheraudio
- ↳ accSone
- ↳ Acon Digital
- ↳ AcousticsampleS
- ↳ AcousModules
- ↳ Agitated State
- ↳ AIR Music Technology
- ↳ AMG
- ↳ Ample Sound
- ↳ Antares Audio Technologies
- ↳ Apisonic Labs
- ↳ apulSoft
- ↳ AriesCode
- ↳ Arts Acoustic
- ↳ Arturia
- ↳ Audjoo
- ↳ AudioSpillage
- ↳ Audiority
- ↳ Best Service
- ↳ Big Tick
- ↳ Bitwig
- ↳ Controller Scripting
- ↳ Blue Cat Audio
- ↳ Cherry Audio
- ↳ CWITEC
- ↳ Embertone
- ↳ energyXT
- ↳ Eventide
- ↳ Expert Sleepers
- ↳ forward audio
- ↳ Future Audio Workshop
- ↳ FXpansion
- ↳ g200kg
- ↳ Harrison Mixbus
- ↳ HG Fortune
- ↳ Homegrown Sounds
- ↳ HoRNet Plugins
- ↳ Ilya Efimov Production
- ↳ Image Line
- ↳ Impact Soundworks
- ↳ Indiginus
- ↳ Insert Piz Here
- ↳ Ju-X
- ↳ Kirk Hunter Studios
- ↳ Kirnu
- ↳ Kong Audio
- ↳ Krotos
- ↳ Kuassa
- ↳ KV331 Audio
- ↳ LennarDigital
- ↳ Les Productions Zvon
- ↳ Liqube Audio
- ↳ Loomer
- ↳ LVC-Audio
- ↳ Maizesoft
- ↳ Manytone Music
- ↳ MeldaProduction
- ↳ Mellowmuse
- ↳ MIDIMood
- ↳ moForte
- ↳ Mozaic Beats
- ↳ mucoder
- ↳ MusicDevelopments
- ↳ Tips & Tricks
- ↳ MusicLab
- ↳ MUTOOLS
- ↳ New Sonic Arts
- ↳ NUSofting
- ↳ Oli Larkin Plugins
- ↳ Orange Tree Samples
- ↳ patchpool
- ↳ Photosounder
- ↳ PlugInGuru
- ↳ Polyverse Music
- ↳ Precisionsound
- ↳ Premier Sound Factory
- ↳ Psychic Modulation
- ↳ Realitone
- ↳ Resonance-Sound
- ↳ Reveal Sound
- ↳ Roger Linn Design
- ↳ rs-met
- ↳ S3A: Spatial Audio
- ↳ SaschArt
- ↳ Smart Electronix
- ↳ sonible
- ↳ SonicBirth
- ↳ Sonic Reality / eSoundz.com
- ↳ Soundiron
- ↳ SPC Plugins
- ↳ Sugar Bytes
- ↳ TAL Software
- ↳ Tokyo Dawn Labs
- ↳ Tracktion
- ↳ u-he
- ↳ u-he Linux support
- ↳ United Plugins
- ↳ VAZ Synths
- ↳ Virharmonic
- ↳ Wolfgang Palm
- ↳ xoxos
- ↳ XSRDO - SynthCraft
- ↳ ZynAddSubFX
- Site Stuff
- ↳ Site Stuff
- Archived Forums
- ↳ AlgoMusic
- ↳ easytoolz
- ↳ Elevayta
- ↳ Hollow Sun
- ↳ Kazrog
- ↳ LinPlug
- ↳ Muse Research and Development
- ↳ Shuriken
- ↳ SoHa Sound Design
- ↳ Soniccouture
- ↳ Topten Software
- ↳ Tweakbench
- ↳ Valhalla DSP
- ↳ CK Modules & VST
- ↳ Sennheiser AMBEO
- ↳ Muon Software
- ↳ Westgatesounds.net
- ↳ Squaredheads
- ↳ Sonigen
- ↳ CFA-Sound
- ↳ Back In Time Records
- ↳ Livelab.dk
- ↳ Skytopia
- ↳ audioD3CK
- ↳ Inspire Audio
- ↳ Krakli
- ↳ Drumdrops
- ↳ Futucraft
- ↳ OverTone DSP
- ↳ RaXnTraX
- ↳ solar3d-software
- ↳ Signaldust
- ↳ Soundemote
- KVR Forum index
- All times are UTC
- Delete cookies