From 3a8a2b7eeff9ab6f0b071872658cac0c282b1b28 Mon Sep 17 00:00:00 2001 From: Marc Oliver Orth Date: Thu, 13 Oct 2022 17:36:30 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Examples/monster-tale.txt | 1 + Examples/test.txt | 4 ++-- Modules/Music.lua | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Examples/monster-tale.txt b/Examples/monster-tale.txt index 3ca6c92..b15db11 100644 --- a/Examples/monster-tale.txt +++ b/Examples/monster-tale.txt @@ -7,6 +7,7 @@ @env0 = { 2, 16, 64, 48 } @env1 = { 8, 32, 72, 64 } + t120 A @02 o5 l4 @env0 v120 diff --git a/Examples/test.txt b/Examples/test.txt index f4b8552..ed29d16 100644 --- a/Examples/test.txt +++ b/Examples/test.txt @@ -18,7 +18,7 @@ f. e. d e c @02 r d e c @01 < h > c -C q5 l8 o2 v100 +C q5 l8 o2 c. > c. < c c. > c. < c c. > c. < c c. > c. < c c. > c. < c c. > c. < c @@ -29,7 +29,7 @@ r1 c c c c c c c c c c c c c c c c -E o1 l8 v100 +E o1 l8 v127 r1 r1 @env3 v127 c r @env1 v80 c @env3 v127 c @env3 v127 c r @env1 v80 c @env3 v127 c diff --git a/Modules/Music.lua b/Modules/Music.lua index 1947088..8b01944 100644 --- a/Modules/Music.lua +++ b/Modules/Music.lua @@ -91,9 +91,10 @@ end function music:NOISE(sample_rate, frequency) --> function() local npoints = sample_rate / frequency - return function() - i = i % npoints + 1 - return i < npoints - 1 and math.random(-1.0, 1.0) + return function(i) + --i = i % npoints + 1 + --return i < npoints - 1 and math.random(-1.0, 1.0) + return math.random(-1.0, 1.0) end end @@ -331,6 +332,7 @@ function music:render_audio() local song_voices = 0 local song_sample_count = 0 local previous_sound = {} + local sample = 0 for track, _ in pairs(self.tracks.info) do if song_duration < self:get_track_duration(track) then