Playing a sequence, no sound emits :(

Platform: Mac

Tried searching for posts for quite a while, apologies if this is a repeat post!

Hope everyone's enjoying their saturday, have a small audio question! In these ~20 lines of lua code here why is my audio silent? I think I'm making a super small mistake, but it's had me stumped for almost hours now. I have a sequence "playing", but no notes are audible.

I'm able to hear the notes when I use playNote, so I don't think it's a simulator / mac speaker issue

local snd <const> = playdate.sound

synth =
instrument =
track =
sequence =

track:addNote(1, 300, 1, 1)
sequence:setLoops(1, 8, 0)

printed = false

step = sequence:getCurrentStep()

-- Uncommenting this plays a sine tone at 300hz, which makes
--      me think my instrument / track setup is fine....
-- sequence:getTrackAtIndex(1):getInstrument():playNote(300, 1)

-- Problem: Why doesn't this play an audible note on beat 1 of 8??

function playdate.update()
    local currentStep = sequence:getCurrentStep()
    if step ~= currentStep then
        step = currentStep
        print("step:", currentStep)

Thank you to dennes on discord, the issue was that my note definition needed a "midi note value" not a frequency like 300hz

-> track:addNote(1, 40, 1, 1) works instead

Is there a way for the SDK to complain if a note above 127 is provided? Would have saved me <3

playNote accepts a pitch or a note name, and the note provided to setNote takes a midi note name or a note name. Having one parameter in common but not the other was tough, and the example code in the SDK only has one mention of "setNote". Should have noticed that the 60 used there in the DrumMachine example was a very very low frequency, and was a midi note instead.

Also would be great if the SDK docs for setNote explicitly stated something like: "A midi note is an integer in the range of X - Y, with the number 60 correlating to A3" or something.

It just says "a midi note" and I didn't know much about what that was

Ah, guess I scrolled past this. Maybe it could be repeated in setNotes