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 20774 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
Re: Understanding effects processing
« Reply #10 on: December 30, 2023, 15:09:48 »

Hello,

Sorry for the bother, but I have yet another question on the "note portamento" effect, which may apply to other effects as well.

The docs I've read suggest that effects are applied on the second tick after they are read.  To me, this means that when a new row is read, the note will be played on the first tick, and the effect after that.

Except that "note portamento" does not seem to honour this.

Based on my understanding (and the hardware limitations on the platform), the algorithm I've followed for my player goes something like this:

On every tick ...
  • If new row:
    • Decode note and instrument data.
    • Decode effect data.
    • Reset channel counter
  • Process note & instrument
  • If channel counter > 0 (not a new row):
    • Process effect.
  • Update sound device with channel data

It appears that "note portamento" (and I think a few other effects as well), are processed before the new note is applied.

I have not had a chance to take a look at the source code of MilkyTracker or any other tracker, so I do not really know how these things are implemented there; but I have some severe physical constraints on my platform that force me to compromise certain aspects.

I thought that the "skip effect on first tick" was a very reasonable side-effect of a functional optimization: We either read/decode row event data or we process effects; which avoids incurring the processing cost of both on the same tick.

However, it appears that this is not really the case -- at least not all the time -- so now that feature appears arbitrary to me. :(

I think the same thing applies to the "Note Delay" effect:  I can't delay the note if I already played it on the first tick, before processing the delay effect.

Obviously I am way off in my understanding.

My apologies if this sounds confusing -- perhaps I should describe my technical design, choices, and compromises.

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

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 100
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #11 on: December 31, 2023, 01:01:42 »

Hmm. Sorry, but it indeed sounds confusing to me. I really don't know a solution to your problem..
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 #12 on: December 31, 2023, 16:10:33 »

No worries, I was mostly rambling.  My apologies for that.

I guess my primary question can be boiled down to this:  when "note portamento" is read, does it start bending the pitch of the old (current) note on the second tick, or on the first tick?

Likewise for the "note delay": does the first tick count as part of the delay, or should the counter start on the second tick?

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

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 100
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #13 on: January 02, 2024, 12:57:25 »

No worries, I was mostly rambling.  My apologies for that.

I guess my primary question can be boiled down to this:  when "note portamento" is read, does it start bending the pitch of the old (current) note on the second tick, or on the first tick?

Likewise for the "note delay": does the first tick count as part of the delay, or should the counter start on the second tick?

    -dZ.

It all starts on the first tick
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 #14 on: January 03, 2024, 00:14:44 »

Thanks.  I have figured out my algorithm now.  I'm confident I can implement the effects.  :)

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

   -- Propaganda

looper231

  • Newbie
  • Offline Offline
  • Posts: 100
  • Casual guy
    • View Profile
    • My site
Re: Understanding effects processing
« Reply #15 on: January 03, 2024, 01:08:44 »

Interested to see progress from you!
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 #16 on: January 03, 2024, 17:08:21 »

Interested to see progress from you!

Thanks for the interest.  I'll post a WAV or MP3 file as soon as I have something to show.

Right now, I have just completed the initial infrastructure changes to my music player that will allow it to support effects -- not a trivial thing for a tracker driving an AY-8914 on a 50 year old CPU with severe RAM limitations. :)

I will start implementing what look to be the easiest ones this week -- arpeggio, portamento up/down, volume slide, and tremolo -- so stay tuned!

    -dZ.


P.S., You may want to temper your expectations ... The Intellivision hardware is not powerful enough to play PCM samples, so all instruments are square waves with software envelopes.
Logged
P. Machinery:
   Another hope feeds another dream...
   Another truth installed by the machine.

   -- Propaganda

m0d

  • Creator of Meow Meow Meow Kitty Song
  • Global Moderator
  • Top Poster
  • ****
  • Offline Offline
  • Posts: 1867
  • Original Site Admin/Designer/Coder
    • View Profile
    • Science & Art - Eindhoven.space - RedHeat Music & More
Re: Understanding effects processing
« Reply #17 on: January 03, 2024, 17:54:55 »

50 years! Bloody heck! :O
Logged
👨‍💻 Creator, Musician & HF Packet Radio Network Core
🎧 Discover great music via other member's special picks in the MFG
☕️ Get m0d a coffee via Ko-Fi.com
💬 IRC irc.rizon.net #modarchive
💬 Modarchive Discord

DZ-Jay

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

50 years! Bloody heck! :O

I know!  Sounds crazy when I say it that way, but the truth is that the Intellivision is a games console released in 1980.  It has a CP-1610 processor -- one of the very firsts 16-bit microprocessors -- running at 1MHz, designed sometime in the 1970s!!! :O

The console has an on-board AY-8914 sound processor (a very early one!), and offers an expansion module that adds an extra sound chip.  Each AY has 3 square wave voices and a single noise generator which can be mixed with any of the voices.

That's it.  No filters.  No selectable waveforms.  No ring modulator.  All modulation is done in software, old school.

My goal is to make the Intellivision sing glorious chip-tunes like the best of the crop. :)

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

   -- Propaganda

DZ-Jay

  • New User
  • Offline Offline
  • Posts: 47
  • I [heart] Intellivision.
    • View Profile
    • Carol Vs. Ghost
Re: Understanding effects processing
« Reply #19 on: January 07, 2024, 23:37:49 »

HAPPY NEW YEAR!!!

I have some good news to share about my progress ...  I have managed to implement the first three effects:
  • Arpeggio
  • Portamento Up
  • Portamento Down
  • Portamento To Note

I have tested and debugged these first effects and they appear to work as expected.
Attached are three wave files generated from the emulator.  I created a simple one-track pattern for each to test the data encoding, the music player, and the effect processing.

For reference, below are the test patterns I used:
Arpeggio:
Code: [Select]
; 0xx: Arpeggio
00 C-4 -1 F 037
01 --- -- - 037
02 --- -- - 037
03 --- -- - 037
04 --- -- - 037
05 --- -- - 037
06 --- -- - 037
07 --- -- - 037
08 --- -- - 037
09 --- -- - 037
10 --- -- - 037
11 --- -- - 037
12 --- -- - 037
13 --- -- - 037
14 --- -- - 037
15 --- -- - 037

16 D-4 -- F 037
17 --- -- - 037
18 --- -- - 037
19 --- -- - 037
20 --- -- - 037
21 --- -- - 037
22 --- -- - 037
23 --- -- - 037
24 E-4 -- - 037
25 --- -- - 037
26 --- -- - 037
27 --- -- - 037
28 F-4 -- - 037
29 --- -- - 037
30 --- -- - 037
31 --- -- - 037

Portamento (Up/Down)
Code: [Select]
; 1xy: Portamento Up
; 2xy: portamento Down
00 C-4 -2 F 208
01 --- -- - 208
02 --- -- - 208
03 --- -- - 208
04 --- -- - 208
05 --- -- - 208
06 --- -- - 208
07 --- -- - 208
08 --- -- - 208
09 --- -- - 208
10 --- -- - 208
11 --- -- - 208
12 --- -- 0 ---
13 --- -- - ---
14 --- -- - ---
15 --- -- - ---

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

Portamento To Note
Code: [Select]
; 3xx: Portamento To Note
00 C-4 -2 F ---
01 E-4 -2 F 304
02 --- -- - 304
03 --- -- - 310
04 --- -- - ---
05 --- -- - ---
06 --- -- - ---
07 --- -- - ---
08 E-4 -1 - ---
09 --- -- - ---
10 --- -- - ---
11 --- -- - ---
12 --- -- - ---
13 --- -- - ---
14 --- -- - ---
15 --- -- - ---

16 E-4 -2 F ---
17 C-4 -2 F 304
18 --- -- - 304
19 --- -- - 310
20 --- -- - ---
21 --- -- - ---
22 --- -- - ---
23 --- -- - ---
24 C-4 -1 - ---
25 --- -- - ---
26 --- -- - ---
27 --- -- - ---
28 --- -- - ---
29 --- -- - ---
30 --- -- - ---
31 --- -- - ---

I am quite happy with the results and this success gives me confidence to proceed with the rest of the effects.

I have yet to implement "effects memory," but I suppose it shouldn't be a big deal.

Anyway, I just wanted to share some progress.  This is a major milestone in my project, for it included re-factoring and enhancing the music tracker, expanding the encoding structure, and implementing the effects.  :)

Thank you to looper231 for your patience.

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

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