Mod Archive Forums Mod Archive Forums
Advanced search  

News:

Please note: Your main modarchive.org account will not work here, you must create a forum account to post on the forums.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - DZ-Jay

Pages: [1] 2 3 4 5
1
Players / Re: Understanding effects processing
« on: April 06, 2024, 14:28:07 »
Another week, another progress report.

After going off on a tangent foolishly attempting to optimize effects processing, I hit a rather nasty brick wall.  I ended up reverting most of those changes and going back to the way I had it working.

Plus ça change ...

Anyway, I added a few more effects:  The tracker now has dynamic song speed (Fxx) and pattern delay (EEx), among other new tricks.

Below is the latest list of effects and their status:
Code: [Select]
--------------------------------                ------
Standard Effects                                Status
--------------------------------                ------
$00: 0   Arpeggio                               Done
$01: 1   Portamento Up                          Done
$02: 2   Portamento Down                        Done
$03: 3   Portamento To Note                     Done
$04: 4   Vibrato                                Done
$05: 5   Portamento To Note + Volume Slide      Done
$06: 6   Vibrato + Volume Slide                 Done
$07: 7   Tremolo                                Done
$08: 8   ---                                   
$09: 9   ---                                   
$0A: A   Volume Slide                           Done
$0B: B   Jump To Order                         
$0C: C   Set Note Volume                       
$0D: D   Pattern Break                         
$0E: E   E Sub-Commands (Dispatcher)            Done
$0F: F   Set Song Speed                         Done
$10: G   Set Global Volume                      Done (Controls volume attenuation only.)
$11: H   Global Volume Slide                    Done (Controls volume attenuation only.)
$12: I   ---                                   
$13: J   ---                                   
$14: K   ---                                   
$15: L   Set Envelope Position                 
$16: M   ---                                   
$17: N   ---                                   
$18: O   ---                                   
$19: P   ---                                   
$1A: Q   ---                                   
$1B: R   Re-trigger Note + Volume Slide         
$1C: S   ---                                   
$1D: T   Tremor                                 
$1E: U   ---                                   
$1F: V   ---                                   
$20: W   ---                                   
$21: X   X Sub-Commands                         
$22: Y   ---                                   
$23: Z   ---                                   
                                               
--------------------------------                ------
Standard Effects                                Status
--------------------------------                ------
$00: E0  ---                                   
$01: E1  Fine Portamento Up                     Done
$02: E2  Fine Portamento Down                   Done
$03: E3  ---                                   
$04: E4  Set Vibrato Waveform                   
$05: E5  ---                                   
$06: E6  Pattern Loop                           
$07: E7  Set Tremolo Waveform                   
$08: E8  ---                                   
$09: E9  Re-trigger Note                       
$0A: EA  Fine Volume Slide Up                   Done
$0B: EB  Fine Volume Slide Down                 Done
$0C: EC  Note Cut                               
$0D: ED  Note Delay                             
$0E: EE  Pattern Delay                          Done
$0F: EF  ---                                   
                                               
--------------------------------                ------
"X" Extended Sub-Command Effects               
--------------------------------                ------
$00: X0  ---                                   
$01: X1  Extra Fine Portamento Up               
$02: X2  Extra Fine Portamento Down             

Aiming for Note Delay (EDx) next and a few of the other "global" control commands like Pattern Loop (E6x), Pattern Break (Dxx), Jump To Order (Bxx), etc.

Here's hoping for a smooth ride!

   -dZ.


P.S. One of these days I will have to start tracking a song for real to make sure it all works ... Someday ...

2
Players / Re: Understanding effects processing
« on: March 17, 2024, 17:23:16 »
Progress, you ask?  Why, yes.  We have some.  :)

I fixed a bug* in which "tick-zero of a row" was confused with "first tick of a note," which caused the tick-zero handling to only be executed when a new note is started.  DOH!

(* The "bug" existed in my head as well, since I wrote the code to work that way because that is how I understood it.  Imagine my shock and surprise when I finally figured out that it was all wrong.)

We now have the following effects supported:
  • 0xy: Arpeggio
  • 1xx: Portamento Up
  • 2xx: Portamento Down
  • 3xx: Portamento To Note
  • 4xy: Vibrato
  • 5xy: Portamento To Note + Volume Slide
  • 6xy: Vibrato + Volume Slide
  • 7xy: Tremolo
  • Axy: Volume Slide
  • E1y: Fine Portamento Up
  • E2y: Fine Portamento Down
  • EAy: Fine Volume Slide Up
  • EBy: Fine Volume Slide Down
  • Gxx: Set Global Volume

That's a pretty nice roster.

All these effects have been tested and work as expected -- well, at least the way I understood them to work, based on my research, reference documents, and the feedback from this forum.

I'm quite happy with the results.  I feel now that I have a rather solid framework that handles ticks and effects correctly, so adding new effects should go smoother in the future -- I mean, what could possibly go wrong?  ;D  (Said the guy that has had to re-write his tracker engine multiple times to fix design flaws ...)

Anyway, my next step is to implement a few more of the low-hanging fruit effects, such as  Set Song Speed (Fxx), Tremor (Txx), etc., and see how it goes.

Stay tuned! (Har! Har! see what I did there?)

     -dZ.


UPDATE: Added Gxx effect.

3
Players / Re: Arpeggio processing ...
« on: March 10, 2024, 16:04:59 »
OK, never mind on this -- it seems to be a quirk of FT2, so I won't bother with it.

I found this in the MilkyTracker documentation, comparing the various implementations (FT2 description in red):

https://milkytracker.org/docs/MilkyTracker.html#fx0xy
Quote
Explanation:
Arpeggio quickly alters the note pitch between the base note (C-4) and the semitone offsets x (3 = D#4) and y (7 = G-4). Each pitch is played for the duration of 1 tick. If speed is higher than 3 (meaning there are more than 3 ticks per row), the sequence is looped.

ProTracker 2/3
Base note is played for tick 0, then the semitone offset x for tick 1, then semitone offset y for tick 2.

Fasttracker II
Base note is played for tick 0, then the semitone offset y for tick 1, then semitone offset x for tick 2.


It seems that the intention (and most common implementations) is to cycle through base, base +x, and base + y.

I do have one question, though.  Is it expected that we should skip tick zero of every row, or that we should restart counting the sequence "base, base + x, base + y" on every row?

This would make the arpeggio sound a bit irregular, depending on how many ticks there are in a row.  For instance, if the song speed is 5 ticks per row, the arpeggio would cycle like this:

Tick #semi-tone
0skipped (base)
1base
2base + x
3base + y
4base
0skipped (base)
1base
2base + x
3base + y
......

In contrast, the original way I had implemented it (and the way I thought it should work) was to process the command on every tick and always cycle through the sequence "base, base + x, base + y" for the duration of the note (or until the effect is deactivated).

For those with more experience than me, especially from the musician side of things, how do you think this effect is expected to work?

    -dZ.

4
Players / Arpeggio processing ...
« on: March 10, 2024, 14:12:12 »
I have a question about the Arpeggio (0xy) effect.

All the documentation I read on common implementations of XM (FT2, OpenMPT, MilkyTracker, etc.) state that the effect alternates between 3 semi-tones:
  • Base note
  • Base note + x param
  • Base note + y param

This makes perfect sense to me and it is how I originally implemented it.

However, I am looking at the ported FT2 code and that logic appears to be incorrect.  Unless I am completely misunderstanding something, the code works like this:
  • The effect is processed only on non-zero ticks.
  • It uses the song timer (i.e., the tick counter -- which counts down on every tick from the song speed until zero) to determine the semi-tone offset to use:  a value that cycles through 0, 1, and 2.
  • Those values are used like this:
    • 0: Base note
    • 1: Base note + x param
    • 2: Base note + y param

Essentially, the three offsets are read from a table of 16 entries, using the count-down timer as an index, so the values are read in reverse:

Arpeggio Table:
Code: [Select]
0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0

What all this means in practice is that the first tick of every row is skipped, and the countdown causes it to process the parameters in reverse.

Therefore, the ultimate product is the something like in the following table.  Consider a song speed of 8 ticks per row. 

Tick #TimerTbl ValueResult
0 (start of row)8 (timer recycled at zero of last row)SkippedBase
17arpTab[7] = 1Base + x param
26arpTab[6] = 0Base
35arpTab[5] = 2Base + y param
44arpTab[4] = 1Base + x param
53arpTab[3] = 0Base
62arpTab[2] = 2Base + y param
71arpTab[1] = 1Base + x param
08 (timer recycled at zero)SkippedBase
17arpTab[7] = 1Base + x param
26arpTab[6] = 0Base
............

Moreover, because the first tick on every row is skipped, when you use a speed number which is a multiple of 3, it will cause the base note to be played twice.

This is sort of weird to me, so perhaps someone with more experience can shed some light on how it should work in practice, or whether this is the expected behaviour.

    -dZ.

5
Players / Re: Question about Volume Slide (Axy)
« 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
Quote
Similar to 1xx, but only applies on the first tick of the row.

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.

6
Players / Re: Question about Volume Slide (Axy)
« 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.

7
Players / Re: Question about Volume Slide (Axy)
« on: March 06, 2024, 13:59:12 »
Progress update:  Ding! Dong! Tremolo (7xy) is done!!!

Effects available are now:
  • (0xy) Arpeggio
  • (1xx) Portamento Up
  • (2xx) Portamento Down
  • (3xx) Portamento To Note
  • (4xy) Vibrato
  • (5xy) Portamento To Note Plus Volume Slide
  • (6xy) Vibrato Plus Volume Slide
  • (Axy) Volume Slide

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?

8
Players / Re: Tempo, Speed, Rows, etc.
« on: March 03, 2024, 23:12:16 »
I found the following information in the OpenMPT Wiki page.  OpenMPT is an open source music tracker that includes support for older formats, such as MOD, XM, IT, etc.

https://wiki.openmpt.org/Manual:_Song_Properties#Classic_Tempo_Mode

I imagine that the description of "Classic Tempo Mode" conforms to the way that old school trackers like FT2 handle tempo (Beats Per Minute) vs. speed (ticks per row).

     -dZ.

9
Players / Re: Question about Volume Slide (Axy)
« 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:
  • (0xy) Arpeggio
  • (1xx) Portamento Up
  • (2xx) Portamento Down
  • (3xx) Portamento To Note
  • (4xy) Vibrato
  • (5xy) Portamento To Note Plus Volume Slide
  • (6xy) Vibrato Plus Volume Slide
  • (Axy) Volume Slide

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.

10
Players / Re: Question about Volume Slide (Axy)
« 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:
  • (0xy) Arpeggio
  • (1xx) Portamento Up
  • (2xx) Portamento Down
  • (3xx) Portamento To Note
  • (4xy) Vibrato
  • (5xy) Portamento To Note Plus Volume Slide
  • (6xy) Vibrato Plus Volume Slide
  • (7xy) Tremolo
  • (Axy) Volume Slide

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.

Pages: [1] 2 3 4 5