Skip to content
Snippets Groups Projects
Commit 699325f5 authored by deuce's avatar deuce
Browse files

If note number is out of range, play as silence.

Only treat ESC [ MN as though the M is part of the music string of the N is
not followed by a decimal digit.
parent 643342ab
No related branches found
No related tags found
No related merge requests found
......@@ -179,7 +179,10 @@ void playnote(int notenum, int notelen, int dotted)
break;
}
duration-=pauselen;
xpbeep(((double)note_frequency[notenum])/1000,duration);
if(notenum < 72 && nottenum >= 0)
xpbeep(((double)note_frequency[notenum])/1000,duration);
else
SLEEP(duration);
SLEEP(pauselen);
}
......@@ -207,8 +210,10 @@ void play_music(void)
p++;
break;
case 'N':
cterm.noteshape=CTERM_MUSIC_NORMAL;
p++;
if(!isdigit(*(p+1)) {
cterm.noteshape=CTERM_MUSIC_NORMAL;
p++;
}
break;
case 'L':
cterm.noteshape=CTERM_MUSIC_LEGATO;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment