From dc53af3f01c0cbaefe4b330e2dcc2396b5afde47 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Tue, 30 May 2023 21:30:44 +0200 Subject: Add initial audio sync --- src/main.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index f0fc7c3..0d4056a 100644 --- a/src/main.c +++ b/src/main.c @@ -13,7 +13,7 @@ WITH REGARD TO THIS SOFTWARE. // // UI tweaks. // + Theming support, with a number of pre-configured themes and custom colors. -// - Add more default themes +// + Add more default themes // - Add custom user themes // - Notification support for feedback when doing some operations // (copying/pasting) @@ -23,7 +23,7 @@ WITH REGARD TO THIS SOFTWARE. // // Quality of life improvements. // + Add a settings page to change some configuration parameters. -// - Change the cursor, the line is difficult to see. +// + Change the cursor, the line is difficult to see. (Option to thick cursor) // - When not on play mode, adjusting a note or a parameter triggers the sound. // This could get annoying, so maybe it should be a configuration option to // enable it? @@ -33,25 +33,24 @@ WITH REGARD TO THIS SOFTWARE. // // Advanced // + Sync via CV by using the link cable. -// - Audio sync by panning left the sound and using right as a click (or +// + Audio sync by panning left the sound and using right as a click (or // viceversa, needs to check the standard.) -// - Sync via MIDI via arduinoboy or something similar. -// - Add an FM channel using Direct Sound. +// - Allow "marking" several trigs to be able to copy/paste them and/or adjust +// their parameters. // - Per trig note probability. // - Add an envelope to ch3, would need to work with a timer in order to make // it work I think. -// - Allow "marking" several trigs to be able to copy/paste them and/or adjust -// their parameters. +// - Sync via MIDI via arduinoboy or something similar. // // Bugfixes +// + Pattern chaining seems off, it plays the first note of the pattern before +// switching +// + Memory corruption when trying to load a save file. Regression due to +// removal of filesystem.c // - Sound can get hung up sometimes, but I can't reproduce when this happens. // Not sure if this is an emulator thing or happens also in hardware. // - Cursor can stay in position instead of dissapering, again I can't // reproduce this right now, just happened randomly. Needs investigation. -// + Pattern chaining seems off, it plays the first note of the pattern before -// switching -// + Memory corruption when trying to load a save file. Regression due to -// removal of filesystem.c // #include "gba/gba.h" @@ -59,6 +58,7 @@ WITH REGARD TO THIS SOFTWARE. #include "renderer_m0.c" #include "globals.c" #include "settings.c" +#include "dsound.c" #include "sequencer.c" #define PROF_ENABLE 0 @@ -166,6 +166,9 @@ update(void) { set_time(patterns[current_pattern].bpm); update_bpm = false; } + if (audio_sync_click) { + play_click(); + } } int @@ -178,7 +181,7 @@ main(void) { // Register interrupts. irq_init(); - irs_set(IRQ_VBLANK, irs_stub); + irs_set(IRQ_VBLANK, sound_vsync); // Initialize sequencer. sequencer_init(); -- cgit v1.2.1