How can I use playdate.sound.channel?
I've added an affect and pan, and also a source but when I play the source synth I can't hear the affect or pan.
On windows:
gfx = playdate.graphics
-- synth/source
sawtooth = playdate.sound.synth.new(playdate.sound.kWaveSawtooth)
sawtooth:setADSR(0.5, 0.5, 0.5, 0.5)
sawtooth2 = playdate.sound.synth.new(playdate.sound.kWaveSawtooth)
sawtooth2:setADSR(0.5, 0.5, 0.5, 0.5)
list = {}
list[1] = { note=49, step=1, length=4, velocity=1 }
-- list[2] = { note=64, step=2, length=2, velocity=1 }
-- list[3] = { note=67, step=4, length=2, velocity=1 }
-- track
trx = playdate.sound.track.new()
--trx:addNote(1, 60, 1)
trx:setNotes(list)
trx:setInstrument(sawtooth)
-- sequence
seq = playdate.sound.sequence.new()
seq:addTrack(trx)
seq:setTempo(4)
-- effect
bitcrush = playdate.sound.bitcrusher.new()
-- channel
chan = playdate.sound.channel.new()
chan:addEffect(bitcrush)
chan:addSource(sawtooth)
chan:setPan(1)
Bdown = false
Adown = false
function playdate.update()
gfx.clear()
if Bdown then sawtooth2:playNote('Db3')
gfx.drawText("B Pushed", 20,20)
end
if not Bdown then sawtooth2:noteOff() end
if Adown then seq:play()
gfx.drawText("A Pushed", 20,50)
end
if not Adown then seq:stop() end
end
function playdate.BButtonDown()
if Bdown == true then Bdown = false
elseif Bdown == false then Bdown = true end
end
function playdate.AButtonDown()
if Adown == true then Adown = false
elseif Adown == false then Adown = true end
end