Call it a technical limitation of the way it was originally implemented. It means that the moment you stop a portamento effect, the note will go back to its base pitch. I don't see a way around it at the moment without re-writing the entire thing. :'(
This might help:
The way portamento and vibrato works in a tracker is by changing the speed of the sample played. so to tone down the note's pitch, the sample is gradually slowed down.
I should have also mentioned, but pitches in trackers work same way any sampler does in a DAW. You tune it to a specific note and then each note corresponds to a certain speed stretch of the sample.
It doesn't work that way on non-sample based trackers of course, but if you're aiming to port XM, you should keep that in mind, maybe that helps you solving the question
Thanks. The problem I have is that my tracker was never intended to replicate XM. The individual who originally developed it, based it on XM -- but stripped it to its minimum in order to fit within the platform constraints and be super fast and compact to include in our games.
I have since carried on the mantle of maintaining it, and now I'm sort of stretching its capabilities by adding support for (some) XM effects. However, I don't think I will ever be able to achieve parity -- the Intellivision is really a rather limited platform, and my tracker has carried on certain original design choices that limit its flexibility.
For instance, consider that the tracker runs on a three step cycle:
- Music Player - Counts rows, keeps track of pattern position, etc.
- Instrument Synthesizer - Runs per tick, plays note, applies envelope, etc.
- Generate tones - Post the period and volume output of the synthesizer, to the sound processor.
Step #2 is very simplistic: For each channel, it keeps track of the current note, instrument, and volume. It has a counter that it uses to advance the state of envelope (and now effects).
On every tick it does the following:
- Look up note period in table.
- Apply instrument vibrato (using lookup table)
- Apply instrument envelope (using envelope table)
- Modulate volume based on note
- Finally, update period and volume registers in sound device.
As you can see, it is sort of "stateless": the period and volume are re-computed on every tick based on the current note and instrument -- and the channel counter is used to know how much to modulate by as it progresses.
I've added a new stage between #2 and #3 to apply effects. Once the instrument synthesizer computes the period and volume for the current tick, an active effect will further modulate them.
It works, but the downside is that the moment the effect stops modulating, the instrument synthesizer will compute the pitch and volume as normal, so the note will sound
exactly as it would at that point in the pattern, had the effect not being applied.
Obviously this is not compatible with XM and other trackers. But re-engineering that is akin to starting the tracker from scratch, which seems a lot more daunting than what I'm actually doing.
I hope this makes sense. Anway, sorry for the long post.
-dZ.