Mod Archive Forums

Music Production => Players => Topic started by: DZ-Jay on February 27, 2024, 20:00:05

Title: Question about Volume Slide (Axy)
Post by: DZ-Jay on February 27, 2024, 20:00:05
Hello,

Yes, I am still working on my project.  I had some major set-backs (more than before), and have to come up with a brand now way to encode the data.  That lead to a re-writing of the music player, instrument synthesizer, and the effect handlers.

The good news is that I've been looking at a C port of the FT2 source code to guide my understanding of the effects in the original XM implementation.  This has been very helpful indeed, and I have managed to implement (correctly) Portamento Up/Down, Note Portamento, Arpeggio, Vibrato, and I'm in the process of completing Volume Slide.

I do have one question on the Volume Slide (Axy) effect.  Suppose I have an instrument volume envelope enabled, does the Volume Slide effect respect it, or does it actually adjust the absolute volume of the note?

Let me give you an example.  If someone sets a volume slide to go up, and lets it go up all the way to maximum volume, does the note continue playing at maximum volume even if the envelope is in decay?

If I am reading the source code of FT2 correctly, it seems that the Volume Slide effect ignores any modulation on the volume of the note, and produces an output based on the "real" volume of the note (the one in the pattern data) modified by the slide.

I hope this question makes sense.

     -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on February 28, 2024, 08:34:19
The volume slide effect ignores the envelope and slides the sample volume value when triggered
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on February 28, 2024, 13:23:11
The volume slide effect ignores the envelope and slides the sample volume value when triggered

Hi, looper231,

Thank you for your helpful answer, as always.  That seems to jive with what I see in the source code of the FT2 port.

I have another question on the Volume Slide:  Does the updated volume after the slide remain when the effect is stopped?  I believe it does.

For example, consider the following pattern:
Code: [Select]
00 C-4 -3 0 A30     <- Start slide upwards from volume zero (fade-in)
01 --- -- - A30
02 --- -- - A30
03 --- -- - A30
04 --- -- - A30
05 --- -- - A30
06 --- -- - A30
07 --- -- - A30     <- End slide
08 --- -- - ---
09 --- -- - ---
10 --- -- - ---
11 --- -- - ---
12 --- -- - ---
13 --- -- - ---
14 --- -- - ---
15 --- -- - ---

In row #7, the effect ends.  I imagine that the note continues playing at the last volume the slide left it in.  Is this correct?

Also, at that point, would the envelope kick in again, or is it now lost until the note is re-triggered or replayed?

    -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on February 29, 2024, 06:26:56
The volume slide effects persist even after the commands, meaning that you'd have to initialize the note again to get the volume back.
The envelopes are still in effect by the way, so your note might fade out with the envelope faster than it would do with effect commands. You'll most likely never see volslide used on instruments that have the fade out. the command doesn't fully ignore the envelope however, it it still keeps track of it, so you can have a tremolo with envelopes and fade out with volume slide at the same time.
Note that the command has a 00 value, which just continues the value that was specified in the earlier row.
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on February 29, 2024, 13:26:33
The volume slide effects persist even after the commands, meaning that you'd have to initialize the note again to get the volume back.
The envelopes are still in effect by the way, so your note might fade out with the envelope faster than it would do with effect commands. You'll most likely never see volslide used on instruments that have the fade out. the command doesn't fully ignore the envelope however, it it still keeps track of it, so you can have a tremolo with envelopes and fade out with volume slide at the same time.
Note that the command has a 00 value, which just continues the value that was specified in the earlier row.

Hi, looper231,

This is very helpful indeed.  Thank you so much for the detailed response.  It sort of fits with how I would expect it to work.

I have now implemented it just like you described above.  So, if the envelope fades-out to zero before the slide, it just stays at zero.


The reason that I ask about the envelopes is that for my case, my target CPU is too slow (and the platform too limited) to play digital samples, so the only "instruments" we can use are modulated tones generated by the AY-3-8914 sound processor.  Hence, in my player, all "samples" are just square waves modulated by software-controlled envelopes.   So, it is very likely (actually, I would say practically required) for all "instruments" to have an envelope to shape its sound.

Ultimately, it is more of a "chip-tune" player than a "module player" -- but one that I hope will function close to typical XM players, at least in its effects capabilities.

   -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on February 29, 2024, 14:15:11
I have a related question about the Tremolo (7xy) effect:  The MilkyTracker documentation says that the "volume is not reset when the command is discontinued."

https://milkytracker.org/docs/MilkyTracker.html#fx7xy

However, the ported FT2 source code I am looking at (which aims to have bit-perfect parity with the output of FT2) suggests that only the output volume of the channel is modulated, but the note volume is not altered.  (This is similar to the Vibrato effect, which returns the note to normal after it is discontinued.)

This is in contrast to the Volume Slide effect, which (as we have discussed) does affect both the output volume and the note volume -- resulting in the volume being left in its final state when the effect is discontinued (and envelopes continuing).

I would expect that when I stop the tremolo, the normal volume of the note would return.

Any insights on this one?  Perhaps MilkyTracker docs are inaccurate ...

    -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on March 01, 2024, 17:42:31
Any insights on this one?  Perhaps MilkyTracker docs are inaccurate ...

Can't give any, since I haven't used Milkytracker at all... You'd have to check in practice
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 01, 2024, 21:31:34
Any insights on this one?  Perhaps MilkyTracker docs are inaccurate ...

Can't give any, since I haven't used Milkytracker at all... You'd have to check in practice

No worries.  The reason I asked is that MilkyTracker purports to reproduce the module replay experience of DOS FastTracker II and Amiga ProtTracker 2/3.  I figured those two were the model for modern trackers.

Anyway, I hope you do not mind if I ask you a follow up question.  In your experience with other trackers, would you say that the Tremolo effect should work like the Vibrato effect, except on volume instead of period (i.e., the note volume is restore at the end of the effect)?

     -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on March 02, 2024, 13:31:06
Anyway, I hope you do not mind if I ask you a follow up question.  In your experience with other trackers, would you say that the Tremolo effect should work like the Vibrato effect, except on volume instead of period (i.e., the note volume is restore at the end of the effect)?
     -dZ.
For consistency, I'd prefer tremolo to reset to sample's volume value once it's done
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 02, 2024, 13:51:07
Anyway, I hope you do not mind if I ask you a follow up question.  In your experience with other trackers, would you say that the Tremolo effect should work like the Vibrato effect, except on volume instead of period (i.e., the note volume is restore at the end of the effect)?
     -dZ.
For consistency, I'd prefer tremolo to reset to sample's volume value once it's done

Thank you, I feel the same way.  So it shall be. :)

     -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on March 02, 2024, 14:35:46
Best of luck, brother. I may not respond from time to time, but I am still looking forward to seeing your work in practice  :angel:
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 02, 2024, 14:53:15
Best of luck, brother. I may not respond from time to time, but I am still looking forward to seeing your work in practice  :angel:

Thanks, mate.

Here is the current progress:  I have implemented a rudimentary "effects memory" to support the Note Portamento + Volume Slide (5xy) and Vibrato + Volume Slide (6xy) effects.  I aim to have these two effects ready today.

I also want to get Tremolo (7xy) ready this week-end, since it seems I can re-use most of my Vibrato (4xy) code.

That would bring the total set of available effects to:

That's a nice set of useful effects!  I then will try testing them all together by porting a few patterns from an existing XM module, and see how that goes.

It's slow going work, but the work is on-going.  I'll make sure to continue posting my progress here for those interested. :)

     -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 03, 2024, 22:42:10
Here is today's update:  I have finally implemented Note Portamento + Volume slide (5xy) and Vibrato + Volume Slide (6xy) effects.

I discovered a bug in my code which resulted in the last effect command being left on for a single tick when a new pattern starts.

It turned out to be a very pernicious bug, caused by some vestiges of legacy code from the old tracker still remaining.  I decided to eradicate the buggy code, and re-implement large chunks of the old music player.

Anyway ... that's all done now.  Phew!  The current line up of available effects is:

I did not get around to implementing Tremolo (7xy), but the night is young, so ... let's see ... :)

I've attached a copy of the algorithm I wrote describing my new music player, in case anybody out there is interested.  This is what I used as a guide when re-writing the player today.

It is written in a "C-ish" pseudo-code, so it may or may not be easy to follow.  I apologize in advance if my ugly pseudo-code burns anybody's eyes.

     -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 06, 2024, 13:59:12
Progress update:  Ding! Dong! Tremolo (7xy) is done!!!

Effects available are now:

I aim to prepare a test track this week-end with just a couple of patterns to test the effects out.

... Stay tuned!

     -dZ.


P.S. What effect should I tackle next?  I'm thinking maybe Note Delay (EDx).  I'm keen to support some nice shuffles in my tracks.  Any suggestions on a popular or more useful effect?
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on March 09, 2024, 02:55:15
You should most definitely port "Fxx" effect which is "Set speed (Ticks Per Row)" - an another essential effect command used in a majority of tracks
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 09, 2024, 04:06:19
You should most definitely port "Fxx" effect which is "Set speed (Ticks Per Row)" - an another essential effect command used in a majority of tracks

Good choice!  I'll add that one.  Right now the tracker expects the song speed to be static as part of the song header (in ROM), but I always thought that it should support varying speed.

I also, went ahead and added the Fine Volume Slide (EAx, EBx) and Fine Portamento (E1x, E2x) effects, just because they are the same as the regular effects, but played on tick zero only.

     -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on March 09, 2024, 04:50:44
I also, went ahead and added the Fine Volume Slide (EAx, EBx) and Fine Portamento (E1x, E2x) effects, just because they are the same as the regular effects, but played on tick zero only.

I assume you understand that "Fine" commands do it more slowly and gradually?
Title: Re: Question about Volume Slide (Axy)
Post by: DZ-Jay on March 09, 2024, 14:23:34
I also, went ahead and added the Fine Volume Slide (EAx, EBx) and Fine Portamento (E1x, E2x) effects, just because they are the same as the regular effects, but played on tick zero only.

I assume you understand that "Fine" commands do it more slowly and gradually?

Yes.  From what I read in some documents, it appears that the only different between the normal and the "fine" commands is that the latter is applied on tick zero only -- i.e., once per row instead of once per tick.

For example, on E1x:
https://wiki.openmpt.org/Manual:_Effect_Reference#Effect_Column_2 (https://wiki.openmpt.org/Manual:_Effect_Reference#Effect_Column_2)
Quote
Similar to 1xx, but only applies on the first tick of the row.

https://milkytracker.org/docs/MilkyTracker.html#fxE1x (https://milkytracker.org/docs/MilkyTracker.html#fxE1x)
Quote
Explanation:    
Works similarly to 1xx portamento up, only the slide is a lot finer because the effect is applied only once per row.

Also, the ported source code of FastTracker II shows that the functions that implements commands 1xx and E1x are identical -- with the only difference being when (how often) they are invoked.

Then again, my experience is exceedingly narrow, and limited mostly to what I read online.  Do you suppose that there may be a bit more nuance to it that I am missing?

    -dZ.
Title: Re: Question about Volume Slide (Axy)
Post by: looper231 on March 09, 2024, 17:51:44
No. what you've presented here is how it really is. "Fine" commands only play their command on first ever tick of the row, for a more smooth ease