Skip to content

Commit 4027457

Browse files
committed
fixed bug with program not working if fm modulator still sounds but main envelope has ended
1 parent c1d42dd commit 4027457

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

instrument_editor.png

146 KB
Loading

src/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,9 @@ int main(int argc, char **argv)
322322
#ifdef DEBUG
323323
Uint32 start_ticks = SDL_GetTicks();
324324
#endif
325-
325+
326+
//debug("%d", mused.song.song_info[0]);
327+
326328
while (1)
327329
{
328330
SDL_Event e = { 0 };

src/view.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ void program_view(GfxDomain *dest_surface, const SDL_Rect *dest, const SDL_Event
939939
char box[6], cur = ' ';
940940

941941
for (int c = 0; c < CYD_MAX_CHANNELS; ++c)
942-
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 = '½';
942+
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
943943

944944
if (inst->program[i] == MUS_FX_NOP)
945945
{

0 commit comments

Comments
 (0)