only instruments with samplemaps can play
by refactoring the xm loader i inadvertently broke this
This commit is contained in:
parent
ea6edaf2e4
commit
fd52b21e3f
1 changed files with 4 additions and 4 deletions
8
xm.js
8
xm.js
|
|
@ -244,11 +244,11 @@ function next_row() {
|
|||
// instrument trigger
|
||||
if (r[i][1] != -1) {
|
||||
inst = xm.instruments[r[i][1] - 1];
|
||||
if (inst != undefined) {
|
||||
if (inst && inst.samplemap) {
|
||||
ch.inst = inst;
|
||||
// retrigger unless overridden below
|
||||
triggernote = true;
|
||||
if (ch.note) {
|
||||
if (ch.note && inst.samplemap) {
|
||||
ch.samp = inst.samples[inst.samplemap[ch.note]];
|
||||
ch.vol = ch.samp.vol;
|
||||
ch.pan = ch.samp.pan;
|
||||
|
|
@ -264,7 +264,7 @@ function next_row() {
|
|||
ch.release = 1;
|
||||
triggernote = false;
|
||||
} else {
|
||||
if (inst != undefined) {
|
||||
if (inst && inst.samplemap) {
|
||||
var note = r[i][0];
|
||||
ch.note = note;
|
||||
ch.samp = inst.samples[inst.samplemap[ch.note]];
|
||||
|
|
@ -324,7 +324,7 @@ function next_row() {
|
|||
ch.periodtarget = PeriodForNote(ch, ch.note);
|
||||
}
|
||||
triggernote = false;
|
||||
if (inst != undefined) {
|
||||
if (inst && inst.samplemap) {
|
||||
if (ch.env_vol == undefined) {
|
||||
// note wasn't already playing; we basically have to ignore the
|
||||
// portamento and just trigger
|
||||
|
|
|
|||
Loading…
Reference in a new issue