Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions js/ft2.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ Fasttracker.prototype.initialize = function()
this.channel[i].currentsample=0.0;
this.channel[i].lastsample=0.0;
this.channel[i].oldfinalvolume=0.0;

this.channel[i].interactiveMute = false;
this.channel[i].interactiveVolume = 1.0;
}
}

Expand Down Expand Up @@ -893,8 +896,10 @@ Fasttracker.prototype.mix = function(mod, bufs, buflen) {
fr=fl*f;
fl*=1.0-f;
}
outp[0]+=fl;
outp[1]+=fr;
if (!mod.channel[ch].interactiveMute && mod.channel[ch].interactiveVolume > 0) {
outp[0]+=fl*mod.channel[ch].interactiveVolume;
outp[1]+=fr*mod.channel[ch].interactiveVolume;
}

// advance sample position and check for loop or end
var oldpos=mod.channel[ch].samplepos;
Expand Down
21 changes: 13 additions & 8 deletions js/pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ Protracker.prototype.initialize = function()
this.channel[i].vibratodepth=0
this.channel[i].vibratopos=0;
this.channel[i].vibratowave=0;

this.channel[i].interactiveMute = false;
this.channel[i].interactiveVolume = 1.0;
}
}

Expand Down Expand Up @@ -449,15 +452,17 @@ Protracker.prototype.mix = function(mod, bufs, buflen) {
}

// mix channel to output
och=och^(ch&1);
f=0.0;
if (mod.channel[ch].noteon) {
if (mod.sample[mod.channel[ch].sample].length > mod.channel[ch].samplepos)
f=(mod.sample[mod.channel[ch].sample].data[Math.floor(mod.channel[ch].samplepos)]*mod.channel[ch].volume)/64.0;
outp[och]+=f;
mod.channel[ch].samplepos+=mod.channel[ch].samplespeed;
if (!mod.channel[ch].interactiveMute && mod.channel[ch].interactiveVolume > 0) {
och=och^(ch&1);
f=0.0;
if (mod.channel[ch].noteon) {
if (mod.sample[mod.channel[ch].sample].length > mod.channel[ch].samplepos)
f=(mod.sample[mod.channel[ch].sample].data[Math.floor(mod.channel[ch].samplepos)]*mod.channel[ch].volume)/64.0*mod.channel[ch].interactiveVolume;
outp[och]+=f;
mod.channel[ch].samplepos+=mod.channel[ch].samplespeed;
}
mod.chvu[ch]=Math.max(mod.chvu[ch], Math.abs(f));
}
mod.chvu[ch]=Math.max(mod.chvu[ch], Math.abs(f));

// loop or end samples
if (mod.channel[ch].noteon) {
Expand Down
9 changes: 7 additions & 2 deletions js/st3.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ Screamtracker.prototype.initialize = function()

this.channel[i].currentsample=0.0;
this.channel[i].lastsample=0.0;

this.channel[i].interactiveMute = false;
this.channel[i].interactiveVolume = 1.0;
}
}

Expand Down Expand Up @@ -633,8 +636,10 @@ Screamtracker.prototype.mix = function(mod, bufs, buflen) {
fr=fl*mod.pan_r[ch];
fl*=mod.pan_l[ch];
}
outp[0]+=fl;
outp[1]+=fr;
if (!mod.channel[ch].interactiveMute && mod.channel[ch].interactiveVolume > 0) {
outp[0]+=fl*mod.channel[ch].interactiveVolume;
outp[1]+=fr*mod.channel[ch].interactiveVolume;
}

var oldpos=mod.channel[ch].samplepos;
mod.channel[ch].samplepos+=mod.channel[ch].samplespeed;
Expand Down