Hello,
Sorry for the bother, but I have yet another question on the "note portamento" effect, which may apply to other effects as well.
The docs I've read suggest that effects are applied on the second tick after they are read. To me, this means that when a new row is read, the note will be played on the first tick, and the effect after that.
Except that "note portamento" does not seem to honour this.
Based on my understanding (and the hardware limitations on the platform), the algorithm I've followed for my player goes something like this:
On every tick ...
- If new row:
- Decode note and instrument data.
- Decode effect data.
- Reset channel counter
- Process note & instrument
- If channel counter > 0 (not a new row):
- Update sound device with channel data
It appears that "note portamento" (and I think a few other effects as well), are processed
before the new note is applied.
I have not had a chance to take a look at the source code of MilkyTracker or any other tracker, so I do not really know how these things are implemented there; but I have some severe physical constraints on my platform that force me to compromise certain aspects.
I thought that the "skip effect on first tick" was a very reasonable side-effect of a functional optimization: We either read/decode row event data
or we process effects; which avoids incurring the processing cost of both on the same tick.
However, it appears that this is not really the case -- at least not all the time -- so now that feature appears arbitrary to me.
I think the same thing applies to the "Note Delay" effect: I can't delay the note if I already played it on the first tick, before processing the delay effect.
Obviously I am way off in my understanding.
My apologies if this sounds confusing -- perhaps I should describe my technical design, choices, and compromises.
-dZ.