Newbie here currently working on a soundpad tutorial in Lua code. I seem to be stuck at inserting the sound. this is my first attempt at coding. any help is really appreciated.
local sampleNames = {
{"kick","snare","",""},
{"hat","","",""},
{"","","",""},
{"","","",""}
}
function eventChannel1(sender, event)
if event.ButtonDown then -- was the event caused by a button being pressed?
local sampleName = sampleNames[event.Y][event.X] -- get the name of the sample from our table
local sample = gdt.ROM.User.AudioSamples[sampleName] -- load that sample from our assets
if sample ~= nil then -- is the sample we tried to load anything but nil?
gdt.AudioChip0:Play(sample, (event.X + event.Y * 4)) -- play the sample we loaded
end
end
end
I tried everything the tutorial told me to do. I expect to hear my keys make a "kick", "snare" and "hat" sound.