Initially tried chatGPT(it shat the bed), but I ended code everything by myself, some errors I made:

Decrement a 16 bit register and believing it would change the Zero Flag.

Most docs said port 254 ear and mic where bit 3 and 4, in reality is bit 6, found that by looking at the Harlequin schematic.

I used this online  assembler:  zasm - z80 online assembler

To convert from string hex(from the rom assembler file) initially used chatGPT,  then just  made a small python script in 5 minutes, included in files section.

The Harlequin I bought on Byte delight site, it took a few months to arrive.

The only mistake in assembling was misplaced the RAM chip with the ROM, ended up buying a programmer for the ROM.

Last tests show it reading up to 20KHz :)

included timings spreadsheet