Commit Graph

107 Commits

Author SHA1 Message Date
KrisKennaway 757e312602
Link to kfest 2022 presentation 2023-07-06 22:19:06 +01:00
KrisKennaway ca6973f2a2
Merge pull request #1 from KrisKennaway/1mhz-opt-osc
Complete overhaul

- model as damped harmonic oscillator instead of RC circuit
- two-stage end-of-frame processing to control clicks
- use simplest approach for core audio playback to allow access at any cycle intervals >= 10 - trying to amortize multiple speaker accesses per operation just led to pathological edge cases, e.g. when trying to reproduce 0
2022-07-22 15:01:01 +01:00
KrisKennaway 2dff0c242c
Merge branch 'master' into 1mhz-opt-osc 2022-07-22 14:58:47 +01:00
kris a7c8a2ff2b Add links and update to reference slot 3 2022-07-22 14:53:00 +01:00
kris cf24da1228 Add example audio file 2022-07-22 14:52:10 +01:00
kris 5abad38314 Improve comments 2022-07-22 14:36:09 +01:00
kris 9129cdccfe Rename toggles to voltages; get working again 2022-07-22 14:32:01 +01:00
kris 2907ba583d Tidy 2022-07-22 14:30:54 +01:00
kris 893e872da4 Tidy 2022-07-22 14:29:31 +01:00
kris b243e7afb4 Overhaul README 2022-07-22 14:28:48 +01:00
kris 30c79accd7 Add a requirements.txt 2022-07-22 12:22:56 +01:00
kris 5d628aec0f Tidy 2022-07-22 12:22:45 +01:00
kris e4f20ea9c7 Tidy 2022-07-22 12:12:46 +01:00
kris 183781da60 Tidy 2022-07-22 12:02:35 +01:00
kris cf7716d068 Tidy a bit 2022-07-22 11:39:05 +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 e79ed985bc Support 11 cycle cadence using STA $BFFF,Y(=31). This slightly improves quality 2022-07-08 23:28:35 +01:00
kris a356f6a3a7 It works! 2022-07-04 11:03:19 +01:00
kris cea66fe916 Generate stage 3 jump tables 2022-07-04 09:46:56 +01:00
kris 21c2257e5c Tidy 2022-07-03 23:18:08 +01:00
kris 8eeb26379d Oops, add missing file 2022-07-03 23:11:20 +01:00
kris 6ff35df1ae Oops, add build file for lookahead.pyx 2022-07-03 23:10:43 +01:00
kris 233e94d94f Tidy 2022-07-03 23:09:04 +01:00
kris f65aaba765 Write out wav files incrementally during processing 2022-07-03 22:42:45 +01:00
kris 2e3e51bb99 Chunk the output resampling to limit memory use 2022-07-03 22:33:01 +01:00
kris 18a16999b0 Tweak to handle full audio files without crashing 2022-07-03 22:32:36 +01:00
kris a9e7a1bbff Implement (10,10) eof duty cycle as a special case 2022-07-02 21:59:08 +01:00
kris 6772b579ca Dramatically reduce memory use 2022-07-02 21:20:16 +01:00
kris 0d217e9326 Improved quality and speed 2022-07-02 20:53:12 +01:00
kris d153119231 Allow writing out a noise wav file containing the difference between input and output audio 2022-07-02 16:50:42 +01:00
kris 535656aceb Working! 2022-07-02 14:15:41 +01:00
kris 2a20bebb37 Tidy 2022-07-02 11:43:35 +01:00
kris 3458d3a1de Assert combined EOF operations have the expected (a, b) cadence 2022-07-02 11:42:36 +01:00
kris 2016e4a5f1 Tidy 2022-07-02 10:58:38 +01:00
kris 622583696d Simplify player op generation 2022-07-02 10:52:23 +01:00
kris efb66e03d8 Begin to rework player operation generation 2022-07-02 10:05:21 +01:00
kris 695ddb2c10 Checkpoint 2022-07-02 00:27:27 +01:00
kris 445ec18f34 WIP - tidy and compute the minimum duty cycle for variants that have a STA $C030 in stage 2 trampoline 2022-07-01 23:17:25 +01:00
kris 47c7f441cf WIP - generate 3 stage EOF trampoline parametrized by (a, b) duty cycles 2022-07-01 22:22:38 +01:00
kris c33e835f7a Simulate at clock speed and downsample output 2022-06-28 22:09:42 +01:00
kris 9a9434e9aa Tweak 2022-06-28 22:09:21 +01:00
kris d2cdceb04e Regenerate 2022-06-28 22:09:09 +01:00
kris 11afaa152b - Only use the minimal player, quality is better and we don't often need more than 6 cycle gaps
- Generate 1-cycle EOF opcodes for now, but we'll need to tweak further.
- Generate both duty cycle orderings (a,b) and (b,a) since we anchor the EOF opcodes with a STA $C030 at the beginning
- Sort EOF by total length so it's clearer when looking at the usage profile which ones are needed
2022-06-28 22:06:38 +01:00
kris 346c647c40 Tweaks 2022-06-28 22:04:57 +01:00
kris 73ef91b5ad Simulate PWM audio filtered through speaker 2022-06-26 21:50:29 +01:00
kris 804ce60434 Clean up some more and restore fake EOF opcodes 2022-06-25 15:26:14 +01:00
kris efa63a5ab2 Tidy 2022-06-25 15:15:40 +01:00
kris e0908a9ced WIP - refactor player generation to be a) deterministic b) use opcodes_6502 c) statically enumerate a minimal set of opcode sequences. Since we're giving up on using arbitrary opcode combinations this is much simpler, and maybe more correct. 2022-06-25 15:14:17 +01:00
kris bc032ae3ca Autogenerate eof with speaker opcode interleaving 2022-06-21 22:32:12 +01:00
kris cb5de62cc8 Look ahead beyond the EOF opcodes for better prediction quality
Normalize based on 100th percentile
2022-06-21 21:33:19 +01:00