Comments (2)
This is the solution suggested by Thomas Neumann (in C#):
/********************************************************************/
/// <summary>
/// Effect L: Set envelope position
/// </summary>
/********************************************************************/
private int DoXmEffectL(ushort tick, ModuleFlag flags, Mp_Control a, Module mod, short channel)
{
byte dat = uniTrk.UniGetByte();
if ((tick == 0) && (a.Main.I != null))
{
Instrument i = a.Main.I;
Mp_Voice aOut;
if ((aOut = a.Slave) != null)
{
if (aOut.VEnv.Env != null)
SetEnvelopePosition(ref aOut.VEnv, i.VolEnv, dat);
if (aOut.PEnv.Env != null)
{
// Because of a bug in FastTracker II, only the panning envelope
// position is set if the volume sustain flag is set. Other players
// may set the panning all the time
if (((mod.Flags & ModuleFlag.Ft2Quirks) == 0) || ((i.VolFlg & EnvelopeFlag.Sustain) != 0))
SetEnvelopePosition(ref aOut.PEnv, i.PanEnv, dat);
}
}
}
return 0;
}
And you need this helper method:
/********************************************************************/
/// <summary>
/// Set the envelope tick to the position given
/// </summary>
/********************************************************************/
private void SetEnvelopePosition(ref EnvPr t, EnvPt[] p, short pos)
{
if (t.Pts > 0)
{
bool found = false;
for (ushort i = 0; i < t.Pts - 1; i++)
{
if ((pos >= p[i].Pos) && (pos < p[i + 1].Pos))
{
t.A = i;
t.B = (ushort)(i + 1);
t.P = pos;
found = true;
break;
}
}
// If position is after the last envelope point, just set
// it to the last one
if (!found)
{
t.A = (ushort)(t.Pts - 1);
t.B = t.Pts;
t.P = p[t.A].Pos;
}
}
}
I found the attached module here:
https://wiki.openmpt.org/Development:_Test_Cases/XM
I do not know if you know anybody who can test it in the real FastTracker II.
It cannot be run on Windows 10, but I found a clone, where the attached module
sounds the same as with my patch. But it is a clone, so I don't know if it can
be used as a real test. I found the clone here:
Comments? @AliceLR?
from mikmod.
from mikmod.
Related Issues (20)
- UniTrk issue HOT 1
- Envelopes with 0 points HOT 6
- IT slide issues HOT 1
- IT, Problems with NNA? HOT 1
- UniMod issues HOT 11
- Asylum loader question HOT 5
- [Feature Request] Panning law
- I created a Web Audio wrapper/example in a forked repo HOT 2
- [Feature request] Building without texinfo dependency HOT 2
- asylum loader bounds and sanity checks HOT 2
- IT release issue HOT 1
- [Feature Request] - New module formats HOT 4
- reads from uninitialized memory HOT 4
- Unable to play strange.uni in libmikmod 3.3.11 but was able to play it in libmikmod 3.3.10 HOT 7
- [Ultra Tracker] Tone portamento does not continue between patterns. HOT 1
- [IT] [XM] OOB reads in envelope code HOT 2
- [XM] OOB reads in mixer code HOT 2
- [build issue] libmikmod uses CMake-relative directories for certain files instead of project-relative, causes CMake errors HOT 7
- xm files play at double speed (double sampling?) on macOS 14.1 on Apple Silicon over bluetooth? HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mikmod.