SP4CEBAR 2022-11-04 15:47 (Edited)
note: notes above 96.62 have a frequency that's too high for NX to handle
SUB PLAY_(V,N)
A=$FF40+12*V
POKEW A,16*16.35*2^((N-1)/12)
POKE A+2,PEEK(A+2) OR %11000000
END SUB
While making this I wrote the TOUCH_CELL(B,X,Y) function
Which uses sprites to figure out what BG and what cell have been touched
Also, the piano is generated (SUB PIANO), and so are the notes (SUB KEYSKIP)