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.

Pages: [1] 2 3 4 5   Go Down

Author Topic: Understanding effects processing  (Read 20643 times)

0 Members and 1 Guest are viewing this topic.

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 47
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Understanding effects processing
« on: December 27, 2023, 16:49:02 »

Hello,

I'm a retro-game developer for the old Mattel Intellivision, and I maintain a music player software library that plays tracks in a bastardized version of XM format.

I'm currently working on adding support for some (most?) FT2 effects and I need some help understanding how they should work.

Most docs suggest that when a new note is read, the note is played on the first tick, and the effect start playing on the subsequent ticks.  This sounds reasonable.  However, I would like to know how does this affect the behaviour of effects such as "note delay," "pattern delay," "jump to order," and other such effects that affect the music player's behaviour and not just the note waveform/amplitude.

For "pattern delay," do we really wait until the second tick to start counting down?  And what happens during the delay -- do we play the new note, or do we continue stretching what is already playing on the channel (i.e., the previous note)?

For "note delay," what plays while we are delaying the note?  Do we continue playing the previous note, or do we start playing the first one and just stretch it during the delay period without advancing the player state?  (I can't imagine it would just be silence ...)

For "jump to order," do we jump immediately upon reading the note/effect, or do we play the note and jump when it finishes?  (Same for "pattern loop" and "pattern break": do we break/loop immediately when signaled, on second tick, or when the note plays out?)

I apologize if these questions seem silly, but my target platform is severely constrained in resources (it's a games console from 1980!), and I wish to understand how to implement the effects in the most efficient and optimized way.

Thanks in advance!
    -dZ.
Logged
P. Machinery:
   Another hope feeds another dream...
   Another truth installed by the machine.

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 95
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #1 on: December 28, 2023, 08:54:29 »

Greetz :-)
I have good experience with XM and I can help you with my intel
Some corrections from others will be appreciated if any are needed

Pattern delay pauses the playback by the number of rows you specify. For example if you set pattern delay by 8 rows, the module will stop advancing for 8 rows equivalent of time (if you take ticks per row in mind) and continue afterwards. Note that all note playback and/or effects will persist while it's delayed.

Note delay makes the note play not on the first tick of the row, but later, depends on how many ticks are you delaying it. Make sure that it's not above the ticks per row value for your tracker. If for example your TPR is 4 and you set delay by 5, the note will simply not play when delaying, the previous note keeps playing without any stetching of sorts

Jump to order jumps the order after on the last tick of the row. Same works pattern break and pattern loop and also break to row.

Hope this helps :-)
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 47
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #2 on: December 28, 2023, 19:10:34 »

Hi, Looper,

Thank you for responding, it helps a lot.  It is similar to what I've noticed by experimenting with MilkyTracker.

Let me see how far I get with this implementation ...

    Thanks again!
   -dZ.
Logged
P. Machinery:
   Another hope feeds another dream...
   Another truth installed by the machine.

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 95
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #3 on: December 28, 2023, 19:15:37 »

Glad to help :-)
If there are any further questions, ask away
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 47
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #4 on: December 29, 2023, 14:08:24 »

Hi again,

I have a question regarding the "Portamento To Note" effect.  I'm not quite clear on how it differs from the "Portamento Up/Down" effect.

From what I read on FT2's and MilkyTracker's docs, it appears that the main difference is that the regular portamento applies to the new note, while the "portamento to note" bends the pitch of the current note towards the new.

In my mind, this means that in the following example ("Portamento Up"):
Code: [Select]
  C-4 .1 .. ...
  E-4 .1 .. 103

the note E-4 is played, and starts bending upwards, while in the following ("Portamento To Note"):
Code: [Select]
  C-4 .1 .. ...
  E-4 .1 .. 304

the note E-4 is not played, but C-4 starts bending towards E-4.  I suppose this means that once E-4 is reached (if it gets there), the pitch stops bending and the E-4 note continues.

Is this correct?

     -dZ.
Logged
P. Machinery:
   Another hope feeds another dream...
   Another truth installed by the machine.

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 95
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #5 on: December 29, 2023, 16:22:44 »

Hi again.
The note portamento works a little bit differently than portamento up or down effect. You've got the setup part correct, where you have to put that effect on the row where the note is present, so that it will start shifting pitch to that note. One important thing however is the speed. You have to also add 30x commands afterwards to keep pitching until it reaches your target note. You can also aet the speed to a high value, so it reaches the note in just one row, but generally, if you're going for a gradual portamento to a note, you need to do it like so:

Code: [Select]
C-5 01 v64 ---
D#6 01 v64 308
--- -- --- 308
--- -- --- 308
--- -- --- 308

And so on until it reaches the d#6 note
« Last Edit: December 29, 2023, 16:25:19 by looper231 »
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 47
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #6 on: December 29, 2023, 16:41:27 »

Hi again.
The note portamento works a little bit differently than portamento up or down effect. You've got the setup part correct, where you have to put that effect on the row where the note is present, so that it will start shifting pitch to that note. One important thing however is the speed. You have to also add 30x commands afterwards to keep pitching until it reaches your target note. You can also aet the speed to a high value, so it reaches the note in just one row, but generally, if you're going for a gradual portamento to a note, you need to do it like so:

Code: [Select]
C-5 01 v64 ---
D#6 01 v64 308
--- -- -- 308
--- -- -- 308
--- -- -- 308

And so on until it reaches the d#6 note

Thank you for responding.  I understand now, so the effect is applied only to the specific row on which it was set.  I believe this is the same for all (most?) other effects as well, right?

One other question on the note portamento:  What happens if it overshoots?  I mean, if I continue setting 3xx and the pitch reaches D#6 earlier?  Does it saturate at new note and stop pitching?  Or will it start pitching in the opposite direction to bend towards the note again?

I guess I'm still trying to grasp the key differences of the "port up/down" and "note port," to figure out how to implement them.

From a functional perspective, it seems that a key difference is that for regular portamento you tell it whether you want to bend up or down, along with the speed; while in note portamento you give it only the speed and the player pitches up or down depending on the relative direction of the note deltas.

What I am trying to determine now is if I need to also have the player keep track of how close it gets to the target note in order to stop when it reaches it; to start pitching in the opposite direction if it "misses" the target note; or if it is up to the musician to enter sensible speeds that "sound right."

Thanks again,

     -dZ.
Logged
P. Machinery:
   Another hope feeds another dream...
   Another truth installed by the machine.

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 95
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #7 on: December 29, 2023, 17:45:55 »

Yes. you are correct. Basically ALL commands in the tracker are only applied to the specific row. Note commands, instrument commands, volume commands, effect commands, you specifically tell the song how to manage its playback.

On note portamento, when it reaches the target note in pitching, it simply stops shifting and keeps the note you were trying to pitch to. It will start to change only when you put a different note under that effect and it will start pitching to that specific new note afterwards. It won't shift backwards or any sort of action like that. (Vibrato would be more handy for you in this case hehe)

Yes. You are also correct in your 4th statement

It is up to musician whether the note reached it's point or not. XM does not revert changes if it overshoots or some sorts... Scratch that, Tracker cannot overshoot the target note when tone portamento is used. It can only undershoot it and even then it's the fault of the composer, who didn't calculate the number of rows required to reach the target note on a certain speed.

Hope this helps
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 47
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #8 on: December 29, 2023, 18:02:12 »

Hope this helps

Yes, it helps greatly!  Thank you so much for the help.

    -dZ.
Logged
P. Machinery:
   Another hope feeds another dream...
   Another truth installed by the machine.

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 95
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #9 on: December 29, 2023, 18:56:58 »


Yes, it helps greatly!  Thank you so much for the help.

    -dZ.

I'm really glad it did, because I feel like my wording was a little twisted maybe :-)
Good luck with your progress and don't hesitate to ask about anything

Cheers
-Looper
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox
Pages: [1] 2 3 4 5   Go Up