Question about Offset & Param Ext command (#xx)

Started by Harbinger, May 30, 2012, 14:10:20

Previous topic - Next topic

Harbinger

I thought i understood the Parameter Extension -- until it came time to use it. Maybe someone can explain what i'm not understanding here.

I'm currently working on a large sample that takes up 44 MB on disk, and whose MPT size in a sample slot is 11,555,711 samples (!). MPT handles playback fine and everything, but in order to create an accompanying track for it i have to use offset (Oxx), high offset (SAx), and Parameter Extension commands (#xx) to cause playback to start at different points depending on the pattern where i'm at. Okay, fine.

I set up the sample in instrument 01 and it will play at proper speed at C-5.

I discovered that one pattern plays 871 sample points of the waveform, so in the first row of the first pattern i could simply pass the command
C-5 01 ... ...
and it would start from the beginning.
When it was time for the 2nd pattern, i divided 871 by 256 = 3 with 103 left over, and then passed a High Offset and an Offset command like such:

... .. ... SA3     871 divided by 256 = 3
C-5 01 ... O67     103 leftover in hex = 67

For pattern 3 i'm up to sample 06CE:

... .. ... SA6     High Byte = 6
C-5 01 ... OCE     Low Byte = CE

All of these values are still visible in the sample display when i move the cursor over the waveform.

When i eventually get to pattern 5, the playback offset is now at $1108. Of course, the High Offset command only goes up to SAF, so i can only use this combo up to sample point 0FFF. And the Sample window will not help me out with Param Extensions. As it turns out, i discovered with some educated guesses that the proper call is thus:

... .. ... SAF     As high as the High Offset command can go
C-5 01 ... 011     I would think this would be O02
... .. ... #08     The low byte, shifted with the #xx command
... .. ... #00     Huh?

I can understand using the SAF command, but why isn't the subsequent Offset command O02, since we've already traveled up to 0F on the high byte (using SAF)?

When the last Param Ext command was omitted, playback would start at the beginning. Why? In this notation the sample should start at sample 110800 not 1108.

Am i missing some information about how MPT is interpreting this sequence?

Saga Musix

I don't think Oxx takes SAx into account when combined with #xx.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Harbinger

After thinking about it, does this mean the #xx basically replaces the SAx command? Is the extra #00 the same thing as SAF? That may explain why the #00 at the end causes the desired behavior, and the SAF command preceding it is superfluous.

Saga Musix

Quote from: Harbinger on May 30, 2012, 14:25:20After thinking about it, does this mean the #xx basically replaces the SAx command?
You can see it like that, yes.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Harbinger

That's an equivalency i never understood after all this time. I should mention this in the OHM. Thx, Jojo.