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]   Go Down

Author Topic: Fadeout  (Read 10976 times)

0 Members and 1 Guest are viewing this topic.

sverx

  • Newbie
  • Offline Offline
  • Posts: 54
    • View Profile
Fadeout
« on: September 05, 2008, 12:53:08 »

Hi there. I'm trying to understand how fadeout on instruments (in XM modules) work.
I already understood that fadeout starts on key-off, so when the envelope enters in the release stage. What I don't know is: how the fadeout value affects volume? In the XM documentation I've read the fadeout 'full' value should be 65536 (0x10000) and this value should decrease by the instrument fadeout value every tick.
But in my tests this doesn't happen.
For example If I set in my test instrument the fadeout value to 0x100 the fadeout should be completed in 0x100 (256) ticks but actually -at least in the tracker I'm using, MilkyTracker- the volume fades to 0 way before 256 ticks, say in half of them.
Any idea? Where I'm doing wrong?

Logged

barryvan

  • I can't decide if you're adorable or creepy.
  • Newbie
  • Offline Offline
  • Posts: 130
    • View Profile
    • barryvan
Re: Fadeout
« Reply #1 on: September 05, 2008, 13:23:21 »

First check that Milkytracker's not wrong - try your test under XMPlay and, if you can, FastTracker itself.
Logged
www.barryvan.com.au - design & music

the barryvan compo - Bimonthly inspiration-based compo

barryvan  @ Last.fm

raina

  • Milkytracker Moderator
  • Great Poster
  • ***
  • Offline Offline
  • Posts: 719
    • View Profile
    • raina.kapsi.fi
Re: Fadeout
« Reply #2 on: September 08, 2008, 02:32:25 »

pailes tells me 32768 is the magic number. That's what I use to find out suitable fadeout values based on pattern rows. (32768 / spd*rows) -> hex.
« Last Edit: September 09, 2008, 11:04:38 by raina »
Logged

sverx

  • Newbie
  • Offline Offline
  • Posts: 54
    • View Profile
Re: Fadeout
« Reply #3 on: September 08, 2008, 10:55:20 »

pailes tells me 32768 is the magic number. That's what I use to find out a suitable fadeout values based on pattern rows. (32768 / spd*rows) -> hex.

So that's why it sounds like the volume fades in half the time...
Anyway I guess the envelope volume is 0-65536 (as it's written in XM format docs) but -don't know why- the values you set in the instrument will be doubled before being used, which has the same effect.
Well, ok, the most important thing is that it's not a bug I'm replicating into my libs...
Thanks :)

Logged

pailes

  • Milkytracker Moderator
  • Rising Star
  • *
  • Offline Offline
  • Posts: 287
    • View Profile
Re: Fadeout
« Reply #4 on: September 09, 2008, 11:37:19 »

First check that Milkytracker's not wrong - try your test under XMPlay and, if you can, FastTracker itself.

MilkyTracker is not wrong :P

So that's why it sounds like the volume fades in half the time...

The value in the official XM format spec (see below) is simply wrong. The only logical conclusion is 32768 instead of 65536.

Quote from: sverx
Anyway I guess the envelope volume is 0-65536 (as it's written in XM format docs) but -don't know why- the values you set in the instrument will be doubled before being used, which has the same effect.

Code: [Select]
FinalVol=(FadeOutVol/65536)*(EnvelopeVol/64)*(GlobalVol/64)*(Vol/64)*Scale;

The envelope points range from 0 to 64. Just as the volume for samples and in the pattern itself.
« Last Edit: September 09, 2008, 11:39:54 by pailes »
Logged

sverx

  • Newbie
  • Offline Offline
  • Posts: 54
    • View Profile
Re: Fadeout
« Reply #5 on: September 09, 2008, 12:07:19 »

So that's why it sounds like the volume fades in half the time...
The value in the official XM format spec (see below) is simply wrong. The only logical conclusion is 32768 instead of 65536.

I agree :) I'll stick with that now.

The envelope points range from 0 to 64. Just as the volume for samples and in the pattern itself.

Sorry, I meant fadeout volume, of course not envelope volume.

Thanks!  :)



Logged
Pages: [1]   Go Up