- Switch some matrices to column-major order, since they usually have
more rows than columns. This turns out to be slightly faster.
- Precompute more of the speaker trajectory formula, since most of it
only depends on the matrix of applied voltages (which only depends
on frame_offset).
Bug fixes:
- make sure to leave enough 0-padding at the end of input data in case
we schedule a SLOWPATH towards the end, since we'll skip into this
buffer.
- Pad the last TCP frame with EXIT opcodes instead of TICK_00.
- Improve the eta counter behaviour by not setting a minimum tick
interval, and being more careful about when we update. This fixes
issues with short files
(indirect) takes 5 cycles not 6! It should be possible to also
accommodate 6502 timings in a followup.
h/t to Scott Duensing who noticed that my sample audio sounded "a tad
slow", which turned out to be due to this 1-cycle difference (which
added up to almost an extra minute playback to an 8-minute song).
Add comments and tidy up the code a bit.
Flesh out README some more.
- we simulate the speaker at full 1-cycle resolution, and
evaluate all possible opcodes that can be scheduled for the
given position in the TCP stream
- this lets us tick the speaker at any cycle interval >=9 (except 10
cycles)
I split out preprocess_audio because scipy/librosa don't run under
pypy and I was hoping that would speed up the encoding, but it does
not for some reason (maybe numpy interactions?)
Anyway, I should be able to vectorize the slow path which will likely
help a lot.