Commit Graph

21 Commits

Author SHA1 Message Date
kris 9129cdccfe Rename toggles to voltages; get working again 2022-07-22 14:32:01 +01:00
kris 5d628aec0f Tidy 2022-07-22 12:22:45 +01:00
kris f64b1a6e2c - parametrize frame size. 4KB has too much buffering though
- Correct speaker model to apply coefficients for a square wave impulse
- Parametrize speaker scaling factor
- Flush wav file output after 1MB
2022-07-09 11:20:03 +01:00
kris 6772b579ca Dramatically reduce memory use 2022-07-02 21:20:16 +01:00
kris 535656aceb Working! 2022-07-02 14:15:41 +01:00
kris efb66e03d8 Begin to rework player operation generation 2022-07-02 10:05:21 +01:00
kris 9a9434e9aa Tweak 2022-06-28 22:09:21 +01:00
kris 13fb60fed0 Add a lot of EOF variants - quality is good but they're mostly not used 2022-06-11 17:27:52 +01:00
kris 8ea4f150ad Checkpoint - trying to mitigate EOF clicking 2022-05-24 22:19:40 +01:00
kris daee564255 Rename slowpath opcode to end_of_frame to better describe what it does.
Add command-line flags for audio normalization params.
2020-12-28 22:42:34 +00:00
kris ccba51eead Add support for targeting 6502, for which the JMP (indirect) opcode
takes 5 cycles instead of 6.
2020-12-28 13:23:57 +00:00
kris 4666171aaa Count and report on the number of speaker toggles/sec during encoding. 2020-12-28 12:30:29 +00:00
kris 0bb7871355 Allow padding out the full $300 page with opcodes, sorted by the
number of non-NOP opcodes to give the most opportunities for speaker
actuation.

Use float32 in opcode code.
2020-12-24 14:40:26 +00:00
kris 54369a620f Wrap line 2020-12-07 20:48:05 +00:00
kris b8de1d4f7b Fix a serious bug in cycle_lookahead, it was not flipping the opcode
voltage schedule based on the last value of the previous opcode.

In candidate_opcodes, return the hash of pruned_opcodes as well (since
this is relatively expensive to recompute), so this can be used to
precompute and cache partial results of applying the opcodes.
2020-12-07 20:34:57 +00:00
kris ccc8594c45 Clean up more.
Switch back to longest opcodes first, it is both smaller and slightly
better quality (~3%).
2020-10-15 20:28:26 +01:00
kris 76d6bc8426 Integrate generated player code 2020-10-15 14:27:37 +01:00
kris 8122f65dc6 Optimize memory and speed. 2020-08-25 20:46:00 +01:00
kris 7a4a36af6b Checkpoint WIP
- use exotic opcodes in player
- optimize encoder
2020-08-24 21:27:24 +01: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