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 7287 times)

0 Members and 2 Guests are viewing this topic.

looper231

  • Newbie
  • Offline Offline
  • Posts: 57
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #30 on: January 08, 2024, 16:33:40 »

I suppose that for this, your comment above means that the base volume of the instrument (modulated by its envelope) is not affected, but the note in the channel is.

Is that right?
   -dZ.

Correct. the base volume of the instrument/sample isn't affected by the commands, but are instead affected on the channel where its played on. Let's just say, that whatever happens on the pattern sheet stays within that pattern sheet :-)
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #31 on: January 08, 2024, 17:01:15 »

Correct. the base volume of the instrument/sample isn't affected by the commands, but are instead affected on the channel where its played on. Let's just say, that whatever happens on the pattern sheet stays within that pattern sheet :-)

That makes sense, and I just observed that same behaviour in MilkyTracker.

I may be able to replicate that behaviour for volume, but unfortunately not for pitch-bending. :(

Call it a technical limitation of the way it was originally implemented.  It means that the moment you stop a portamento effect, the note will go back to its base pitch.  I don't see a way around it at the moment without re-writing the entire thing.  :'(

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

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 57
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #32 on: January 08, 2024, 17:09:33 »

Call it a technical limitation of the way it was originally implemented.  It means that the moment you stop a portamento effect, the note will go back to its base pitch.  I don't see a way around it at the moment without re-writing the entire thing.  :'(

This might help:
The way portamento and vibrato works in a tracker is by changing the speed of the sample played. so to tone down the note's pitch, the sample is gradually slowed down.

I should have also mentioned, but pitches in trackers work same way any sampler does in a DAW. You tune it to a specific note and then each note corresponds to a certain speed stretch of the sample.

It doesn't work that way on non-sample based trackers of course, but if you're aiming to port XM, you should keep that in mind, maybe that helps you solving the question
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #33 on: January 08, 2024, 17:46:02 »

Call it a technical limitation of the way it was originally implemented.  It means that the moment you stop a portamento effect, the note will go back to its base pitch.  I don't see a way around it at the moment without re-writing the entire thing.  :'(

This might help:
The way portamento and vibrato works in a tracker is by changing the speed of the sample played. so to tone down the note's pitch, the sample is gradually slowed down.

I should have also mentioned, but pitches in trackers work same way any sampler does in a DAW. You tune it to a specific note and then each note corresponds to a certain speed stretch of the sample.

It doesn't work that way on non-sample based trackers of course, but if you're aiming to port XM, you should keep that in mind, maybe that helps you solving the question

Thanks.  The problem I have is that my tracker was never intended to replicate XM.  The individual who originally developed it, based it on XM -- but stripped it to its minimum in order to fit within the platform constraints and be super fast and compact to include in our games.

I have since carried on the mantle of maintaining it, and now I'm sort of stretching its capabilities by adding support for (some) XM effects.  However, I don't think I will ever be able to achieve parity -- the Intellivision is really a rather limited platform, and my tracker has carried on certain original design choices that limit its flexibility.

For instance, consider that the tracker runs on a three step cycle:
  • Music Player - Counts rows, keeps track of pattern position, etc.
  • Instrument Synthesizer - Runs per tick, plays note, applies envelope, etc.
  • Generate tones - Post the period and volume output of the synthesizer, to the sound processor.

Step #2 is very simplistic:  For each channel, it keeps track of the current note, instrument, and volume.  It has a counter that it uses to advance the state of envelope (and now effects).

On every tick it does the following:
  • Look up note period in table.
  • Apply instrument vibrato (using lookup table)
  • Apply instrument envelope (using envelope table)
  • Modulate volume based on note
  • Finally, update period and volume registers in sound device.

As you can see, it is sort of "stateless":  the period and volume are re-computed on every tick based on the current note and instrument -- and the channel counter is used to know how much to modulate by as it progresses.

I've added a new stage between #2 and #3 to apply effects.  Once the instrument synthesizer computes the period and volume for the current tick, an active effect will further modulate them.

It works, but the downside is that the moment the effect stops modulating, the instrument synthesizer will compute the pitch and volume as normal, so the note will sound exactly as it would at that point in the pattern, had the effect not being applied.

Obviously this is not compatible with XM and other trackers.  But re-engineering that is akin to starting the tracker from scratch, which seems a lot more daunting than what I'm actually doing. :(

I hope this makes sense.  Anway, sorry for the long post.

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

   -- Propaganda

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #34 on: January 08, 2024, 18:30:48 »

Er ... I just took a long hot shower (what I tend to do to think and ponder) and had an epiphany -- I think I may be able to fix my pitch bending behaviour.   :o

Stay tuned!

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

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 57
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #35 on: January 08, 2024, 18:34:06 »

He's onto something. Shower thoughts always win
Logged
"Beyond the reach of human range. A bit of evil. A touch of strange" - Paradox

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #36 on: January 08, 2024, 21:07:04 »

Got something ...   :D

I made a quick and dirty test with the following pattern.  See the attached output from the emulator.

Code: [Select]
00 C-4 -3 F 210
01 --- -- - 200
02 --- -- - 208
03 --- -- - 200
04 --- -- - 204
05 --- -- - 200
06 --- -- - ---
07 --- -- - ---
08 --- -- - ---
09 --- -- - ---
10 --- -- - ---
11 --- -- - ---
12 --- -- - ---
13 --- -- - ---
14 --- -- - ---
15 --- -- - ---

16 C-3 -- F 110
17 --- -- - 100
18 --- -- - 108
19 --- -- - 100
20 --- -- - 104
21 --- -- - 100
22 --- -- - ---
23 --- -- - ---
24 --- -- - ---
25 --- -- - ---
26 --- -- - ---
27 --- -- - ---
28 --- -- - ---
29 --- -- - ---
30 --- -- - ---
31 --- -- - ---

I am now tracking the pitch delta separately and applying it the the note period for as long as the note lasts.  Portamento increments or decrements this value, depending on the case.

When the effect stops (rows #06 and #22), the delta continues being applied to the note.  On a new note, the delta is reset.

I suppose I can also use this same state variable for the "Set Fine-Tune" effect (E5x) later on.

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

   -- Propaganda

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #37 on: January 08, 2024, 22:29:13 »

I have another question:  For vibrato effect, what does the "y" parameter represent?  Is it just a period or is it an index into some table of offsets?

I know that the speed is how much to advance the position in the waveform on each tick (like I do with volume envelopes), but I'm not sure I know what to do with the depth parameter.

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

   -- Propaganda

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #38 on: January 09, 2024, 13:30:39 »

I have another question:  For vibrato effect, what does the "y" parameter represent?  Is it just a period or is it an index into some table of offsets?

I found some information here:
https://forum.openmpt.org/index.php?topic=6835.0

Quote
The pattern effect (4xy) has a resolution of 1/8th of a semitone in linear slides mode, so at the maximum depth (15) it spans approximately +/-2 semitones.

Seems reasonable.  Now I have to figure out how to modulate that with the various waveforms.  My tracker uses a static triangle waveform for instrument auto-vibrato (a simple linear ramp up and down dividing the peak amplitude by powers of 2), so I can't re-use that one.

I suppose I could limit my implementation to a single waveform.  If so, which would you recommend?  Triangle is linear and straightforward, but sine is the XM default ... Any suggestions?

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

   -- Propaganda

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 42
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #39 on: January 20, 2024, 16:16:41 »

Just a minor update -- I'm still working on this project, I just ran out of Christmas vacation days so I have mostly the week-ends to work on it.

I had a rather major set-back due to the way I implemented the pitch bending effects -- when the effect runs out, the original tone was being reset, which is not correct.  It wasn't really a bug, more like a design flaw.  This was particularly bad in the Note Portamento:  if the effect ran out before reaching the new note, the period would be reset to the new note anyway!

In any case -- I came up with a different approach, and now I am happy to say that I have finally slay that dragon for good!  Portamento Up/Down and Note Portamento behave correctly.  :D

Now, on to Vibrato.  It's going to be tricky because my target CPU (GI CP-1610) does not have instructions for multiplication or division -- heck, it doesn't even have a logical OR instruction! -- so scaling amplitudes and tone periods is expensive.

Nevertheless, I think I see a way out ... stay tuned!

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

   -- Propaganda
Pages: 1 2 3 [4] 5   Go Up