aboutsummaryrefslogtreecommitdiffhomepage
path: root/midi.lua
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2023-09-05 03:51:51 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2023-09-05 23:39:23 +0300
commit05dab37fe1559d0bcbe089ea519ca0118ef25d13 (patch)
tree4e9bd1ca236ebcfea74b3e8819f97037210dcae6 /midi.lua
parent8cdcf6f747cd85ebc1425acfd9d8a9ebfa84e752 (diff)
downloadapplause2-05dab37fe1559d0bcbe089ea519ca0118ef25d13.tar.gz
replaced math.pow(x, y) with x^y
Diffstat (limited to 'midi.lua')
-rw-r--r--midi.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/midi.lua b/midi.lua
index ac6283d..4025fe5 100644
--- a/midi.lua
+++ b/midi.lua
@@ -127,7 +127,7 @@ do
local mtof_cache = table.new(128, 0)
for note = 0, 127 do
-- MIDI NOTE 69 corresponds to 440 Hz
- mtof_cache[note] = 440*math.pow(2, (note - 69)/12)
+ mtof_cache[note] = 440 * 2^((note - 69)/12)
end
-- Convert from MIDI note to frequency