Last active
January 19, 2024 22:48
-
-
Save catfact/85232017a83287871286fe0494bf1894 to your computer and use it in GitHub Desktop.
timber loop mode test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local timber = include("timber/lib/timber_engine") | |
engine.name = "Timber" | |
local sample_paths = { | |
_path.audio .. "/common/808/808-BD.wav", | |
_path.audio .. "/common/808/808-SD.wav" | |
} | |
function init() | |
timber.add_params() | |
params:add_separator() | |
for i,v in ipairs(sample_paths) do | |
timber.add_sample_params(i) | |
params:set("sample_" .. i, v) | |
local pmode = "play_mode_" .. i | |
params:set(pmode, 4) | |
print("play mode: ".. params:get(pmode)) | |
end | |
end | |
function key(n, z) | |
if n > 1 then | |
local id = n-1 | |
if z > 0 then | |
engine.noteOn(id, 440, 60, id) | |
else | |
engine.noteOff(id, 440, 60, id) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment