From bac16fa2662f61cfa3b56111649685b4eb397442 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 22 Jul 2023 08:32:04 +0200 Subject: Fix default parameters for channel params --- src/main.c | 14 +++++------ src/patterns.c | 77 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 47 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 09f0465..ffe60e4 100644 --- a/src/main.c +++ b/src/main.c @@ -12,27 +12,27 @@ WITH REGARD TO THIS SOFTWARE. // TODO: A list of features I would like to get to implement in the near future. // // UI tweaks. -// - Add custom user themes -// - Animations for cursor movement/current step highlight. (A fade out maybe?) -// - Add panning support. // + Add new UI for the parameter pages // + Change cursor drawing for new parameter pages -// - Change cursor behaviour for new parameter pages -// - Allow prob control (% based or 1:2, etc.) +// + Change cursor behaviour for new parameter pages // - Display notification when editing a parameter with the highest priority +// - Add panning support. +// - Allow prob control (% based or 1:2, etc.) +// - Add custom user themes +// - Animations for cursor movement/current step highlight. (A fade out maybe?) // // Quality of life improvements. +// + Make the channel parameters initialize to default // - 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? // - Undo/Redo. -// - Make the channel parameters initialize to default // // Advanced +// - Per trig note probability. // - Add tap tempo for BPM. // - 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. // - Sync via MIDI via arduinoboy or something similar. diff --git a/src/patterns.c b/src/patterns.c index 6b68463..799ca47 100644 --- a/src/patterns.c +++ b/src/patterns.c @@ -16,6 +16,7 @@ typedef struct ChannelSquareParams { u8 sweep_time; u8 sweep_direction; u8 prob; + s8 pan; } ChannelSquareParams; typedef struct ChannelWaveParams { @@ -26,6 +27,7 @@ typedef struct ChannelWaveParams { u8 shape_b; u8 phase_b; u8 prob; + s8 pan; } ChannelWaveParams; typedef struct ChannelNoiseParams { @@ -34,6 +36,7 @@ typedef struct ChannelNoiseParams { u8 env_direction; u8 bit_mode; u8 prob; + s8 pan; } ChannelNoiseParams; typedef struct ChannelSquare { @@ -63,11 +66,6 @@ typedef struct Pattern { u8 bank; } Pattern; -static ChannelSquareParams ch1_params = {0}; -static ChannelSquareParams ch2_params = {0}; -static ChannelWaveParams ch3_params = {0}; -static ChannelNoiseParams ch4_params = {0}; - // // Defaults. // @@ -172,22 +170,22 @@ const ChannelWave default_ch3 = { {true, NOTE_G_5}, }, .params = { - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, - {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, + {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}, }, .active = true, }; @@ -212,22 +210,22 @@ const ChannelNoise default_ch4 = { {false, NOTE_E_6}, }, .params = { - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, - {0xF, 0x2, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, + {0xF, 0x2, 0, 0, 0}, }, .active = true, }; @@ -244,3 +242,8 @@ static Pattern patterns[8] = { {default_ch1, default_ch2, default_ch3, default_ch4, default_bpm, 0}, {default_ch1, default_ch2, default_ch3, default_ch4, default_bpm, 0}, }; + +static ChannelSquareParams ch1_params = {8, 4, 0, 2, 0, 0, 0, 0, 0}; +static ChannelSquareParams ch2_params = {8, 4, 0, 2, 0, 0, 0, 0, 0}; +static ChannelWaveParams ch3_params = {3, 0, WAVE_SIN, 0, WAVE_SAW, 0, 0, 0}; +static ChannelNoiseParams ch4_params = {0xF, 0x2, 0, 0, 0, 0}; -- cgit v1.2.1