Skip to content

Commit

Permalink
src/amy.c: Only set IS_ALGO_SOURCE if IS_SET(algo_source).
Browse files Browse the repository at this point in the history
  • Loading branch information
dpwe committed Mar 17, 2024
1 parent 966806b commit e9f843c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/AMY-Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@ void AMY::send_message(char * message) {
amy_add_event(amy_parse_message(message));
}

void AMY::drums(int32_t start, uint16_t loops) {
void AMY::drums(uint32_t start, uint16_t loops) {
example_drums(start, loops);
}

void AMY::voice_chord(uint32_t start, uint16_t patch) {
example_voice_chord(start, patch);
}

void AMY::fm(uint32_t start) {
example_fm(start);
}




Expand Down
4 changes: 2 additions & 2 deletions src/AMY-Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class AMY
void begin(uint8_t cores, uint8_t reverb, uint8_t chorus);

int32_t sysclock();
void fm(int32_t start);
void drums(int32_t start, uint16_t loops);
void drums(uint32_t start, uint16_t loops);
void voice_chord(uint32_t start, uint16_t patch);
void fm(uint32_t start);
void reset();
struct event default_event();
void add_event(struct event e);
Expand Down
5 changes: 3 additions & 2 deletions src/amy.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,9 @@ void play_event(struct delta d) {

if(d.param >= ALGO_SOURCE_START && d.param < ALGO_SOURCE_END) {
uint16_t which_source = d.param - ALGO_SOURCE_START;
synth[d.osc].algo_source[which_source] = *(int16_t *)&d.data;
if(synth[d.osc].algo_source[which_source] >= 0) synth[*(int16_t*)&d.data].status=IS_ALGO_SOURCE;
synth[d.osc].algo_source[which_source] = d.data;
if(AMY_IS_SET(synth[d.osc].algo_source[which_source]))
synth[synth[d.osc].algo_source[which_source]].status = IS_ALGO_SOURCE;
}

// for global changes, just make the change, no need to update the per-osc synth
Expand Down

0 comments on commit e9f843c

Please sign in to comment.