Skip to content

Commit

Permalink
fixed bug with program not working if fm modulator still sounds but m…
Browse files Browse the repository at this point in the history
…ain envelope has ended
  • Loading branch information
LTVA1 committed Feb 10, 2022
1 parent c1d42dd commit 4027457
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Binary file added instrument_editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,9 @@ int main(int argc, char **argv)
#ifdef DEBUG
Uint32 start_ticks = SDL_GetTicks();
#endif


//debug("%d", mused.song.song_info[0]);

while (1)
{
SDL_Event e = { 0 };
Expand Down
2 changes: 1 addition & 1 deletion src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void program_view(GfxDomain *dest_surface, const SDL_Rect *dest, const SDL_Event
char box[6], cur = ' ';

for (int c = 0; c < CYD_MAX_CHANNELS; ++c)
if (mused.channel[c].instrument == inst && (mused.cyd.channel[c].flags & CYD_CHN_ENABLE_GATE) && (mused.channel[c].flags & MUS_CHN_PROGRAM_RUNNING) && mused.channel[c].program_tick == i) cur = '½';
if (mused.channel[c].instrument == inst && ((mused.cyd.channel[c].flags & CYD_CHN_ENABLE_GATE) || ((mused.cyd.channel[c].flags & CYD_CHN_ENABLE_FM) && (mused.cyd.channel[c].fm.adsr.envelope != 0) && !(mused.cyd.channel[c].flags & CYD_CHN_ENABLE_GATE))) && (mused.channel[c].flags & MUS_CHN_PROGRAM_RUNNING) && mused.channel[c].program_tick == i) cur = '½'; //where arrow pointing at current instrument program step is drawn

if (inst->program[i] == MUS_FX_NOP)
{
Expand Down

0 comments on commit 4027457

Please sign in to comment.