Advertisement
gocha

FlMML noise frequency table attempt

Mar 29th, 2013
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. -- FlMML のノイズの周波数を求めたかった。
  2. -- サンプルが直線的に変化しないので、平均を求めても無意味な気がします。
  3. for noiseFreq = 0, 127 do
  4.     local tri = function(n)
  5.         return n * (n + 1) / 2
  6.     end
  7.  
  8.     local freqBase = (1.0 - (noiseFreq / 128.0))
  9.     local step = tri(1.0 / freqBase) * freqBase
  10.     local nsamp = 1.0 / freqBase
  11.     local freqMul = step / nsamp
  12.     print(noiseFreq, string.format("%9.2f", 44100 * freqMul))
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement