Commit Graph

5 Commits

Author SHA1 Message Date
kris 4090c502a8 Add back preprocess_audio for converting audio sample rate. It's
faster to do this once when converting an audio file many times.
2020-12-28 12:54:39 +00:00
kris 4767ee51fd Fixup player timings and opcode variants for 65c02 timings since JMP
(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.
2020-08-16 23:15:30 +01:00
kris 86cd1e1114 1MHz encoder and player
- 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)
2020-08-13 22:08:50 +01:00
kris 1bbbd8c154 Merge preprocess_audio back in. We didn't end up getting a speed
boost from pypy, perhaps because the critical path is in numpy code.

Add some comments and clean up a bit.
2020-08-11 23:23:33 +01:00
kris 0f8ad1bf17 Checkpoint working code that implements delta modulation with look-ahead.
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.
2020-08-10 21:03:12 +01:00