Plug-ins, Hosts, Apps,
Hardware, Soundware
Developers
(Brands)
Videos Groups
Whats's in?
Banks & Patches
Download & Upload
Music Search
KVR
   
KVR Forum » Expert Sleepers
Thread Read
A couple of Spectral Conquest scripts
os
KVRian
- profile
- pm
- e-mail
- www
PostPosted: Tue Jul 06, 2010 12:46 am reply with quote
Just to give a flavour of what can be done.

First, a modified low pass filter (as built-in to the plug-in) but with an LFO. Param 3 is the LFO rate, and Param 4 is the depth.


local lfoT = 0
local function scriptedBrickWallLPFWithLFO( state )
   local maxBin = state.maxBin
   local cutoff = state.param2 * maxBin
   local frequency = 0.1 + state.param3 * 10
   local twopi = 2 * math.pi
   lfoT = lfoT + twopi * frequency * (maxBin-1)/44100
   while lfoT >= twopi do
      lfoT = lfoT - twopi
   end
   local lfo = state.param4 * maxBin * math.sin( lfoT )
   cutoff = cutoff + lfo
   cutoff = math.max( cutoff, 0 )
   local zeroBin = zeroBin
   for i=cutoff,maxBin,1 do
      zeroBin( i )
   end
end

addSpectralScript( "LFO Low Pass", scriptedBrickWallLPFWithLFO )


Secondly, a 'freeze' script. Param 2 freezes the spectrum when it's non-zero. Works best when the FFT size is set to 4096.


local frozen = 0
local frozenStateRe = { 1 }
local frozenStateIm = { 1 }
local function scriptedFreeze( state )
   local maxBin = state.maxBin
   if frozen == 1 then
      if state.param2 == 0 then
         frozen = 0
      else
         local setBin = setBin
         for i=0,maxBin,1 do
            setBin( i, frozenStateRe[i], frozenStateIm[i] )
         end
      end
   elseif state.param2 > 0 then
      frozen = 1
      local getBin = getBin
      for i=0,maxBin,1 do
         re, im = getBin( i )
         frozenStateRe[i] = re
         frozenStateIm[i] = im
      end
   end
end

addSpectralScript( "Freeze", scriptedFreeze )
^ Joined: 21 Mar 2002  Member: #2219  Location: UK
All times are GMT - 8 Hours

Printable version
Page 1 of 1
Display posts from previous:   
ReplyNew TopicPrevious TopicNext Topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Username: Password:  
KVR Developer Challenge 2012