Hello, I'm developing on an M1 Mac, simulator only, working with the SDK's sound library.
I'm trying to make a drum kit out of the playdate synths. I'm able to make a quick attack, short decay sine wave tone which sounds as expected.
when i go to :addVoice() for some noise to simulate the strike of the drum, I don't hear any change in the instrument. I can comment out the sine wave, edit the code so the inst is composed of only the noise synth, and then i hear the noise loud and clear.
I'm sure I'm missing something obvious, any help would be appreciated!
The "sounds/4onthefloor.mid" is a file with a simple quarter note pattern, on C1 or C2 I think. Feel free to use any midi, as my issue appears to happen no matter what the instrument is being asked to play.
function newBD()
-- make voices
local base_BD_synth = sfx.synth.new(sfx.kWaveSine)
base_BD_synth:setADSR(0, .12, .01, .2)
local hit_BD_synth = sfx.synth.new(sfx.kWaveTriangle)
hit_BD_synth:setADSR(0, .10, .03, .02)
-- make inst w all the voices
BD_instrument = sfx.instrument.new(base_BD_synth)
BD_instrument:addVoice(hit_BD_synth)
return BD_instrument
end
function testDrums()
local newBD = newBD()
local BD_midi = "sounds/4onthefloor.mid"
local BD_s = sfx.sequence.new(BD_midi)
local BD_track = BD_s:getTrackAtIndex(1)
BD_track:setInstrument(newBD)
BD_s:setTempo(180)
BD_s:play()
end
testDrums()