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 - LokiClock

Pages: [1] 2 3
1
MilkyTracker Support / Re: Envelope & fadeout meaning
« on: October 13, 2011, 09:20:20 »
EDIT: Nevermind --

I found chnInf->step set to 0 & iterated in PlayerSTD::triggerEnvelope & PlayerSTD::prenvelope(), though under different names.

So the whole thing executes from triggerInstrumentFX, which is not, as I feared, only an effects envelope. noteOff is set before effects are called.

triggerInstrumentFX, besides from effects commands, is called by progressRow() in tickhandler(). I assume that runs once per tick, therefore prenvelope() can, so step is the number of ticks since the note started.

While getenvval() is interpolating the envelope points, this number is subtracted from the 2nd point of the pair's amplitude, & the result is multiplied by 65536 divided by the time difference dx between the two envelope points to get t.

I'll take 65536/dx to be a conversion of units from ticks as a portion of dx to portions of the reference amplitude 65536. When that portion is close to 100%, y0 has more weight, & when it's close to 0% y1 has more weight. Since the reference amplitude isn't normalized, the result needs to be divided by the maximum possible, 65536.

amp=65536((e_1.amp-e_2.amp)(e_2.amp-tickspassed)/distance(e_1,e_2)+e_2.amp)>>16

2
MilkyTracker Support / Re: Problems porting Milkytracker
« on: October 13, 2011, 06:01:24 »
Is there a debugger for the Caanoo that you can attach to Milky? To make debugging at all quick, you need a symbolic (function names, not machine code) stack trace to know where in the program it faulted.

Otherwise, you can look at the exit routine and print numbered messages throughout to see how far it goes before it faults.

The fault might come from it trying to destruct the keyboard & mouse stuff that never initialized properly.

3
MilkyTracker Support / Re: Envelope & fadeout meaning
« on: October 13, 2011, 05:52:58 »
Partially answered for fadeout, going on milkyplay/PlayerSTD.cpp. Every tick, it lowers the amplitude by the sample fadeout value/65536. However, I don't know when that starts - When does keyOn become false? - or that the sample fadeout is exactly the same as the instrument's.

Code
------

Initial values:

Code: [Select]
void PlayerSTD::triggerInstrumentFX(TModuleChannel* chnInf)
{...
chnInf->fadevolstart = 65536;
chnInf->fadevolstep = module->smp[chnInf->smp].volfade;
...}

Values lowered:

Code: [Select]
void PlayerSTD::update()
{
mp_sint32 c;
#ifdef MILKYTRACKER
for (c=0;c<initialNumChannels;c++)
#else
for (c=0;c<numChannels;c++)
#endif
{...
if (!chnInf->keyon)
{
chnInf->fadevolstart-=chnInf->fadevolstep;
if (chnInf->fadevolstart<0) chnInf->fadevolstart=0;
}
...}

Which is called at the end of void PlayerSTD::tickhandler().
---

I may have the result for the envelope -> amplitude formula between these two pieces of code:

Code: [Select]
mp_sint32 PlayerSTD::getenvval(mp_sint32 c,TPrEnv *env,mp_sint32 n)
{
if (env->envstruc==NULL) return n;

if ((env->envstruc->type&1))
{

mp_sint32 dx = (env->envstruc->env[env->b][0]-env->envstruc->env[env->a][0]);
if (dx==0) dx=1;
mp_sint32 t = (env->envstruc->env[env->b][0]-env->step)*65536/dx;
mp_sint32 y0 = env->envstruc->env[env->a][1];
mp_sint32 y1 = env->envstruc->env[env->b][1];

mp_sint32 y = (y0*t)+(y1*(65536-t));

return y>>16;

}

else return n;
}

where env->b is the point after env->a. So far I know that if t is 0 then the result is y1, & if t is 65536 then it's y0.

Code: [Select]
mp_sint32 getvolume(mp_sint32 c,mp_sint32 nv)
{
mp_sint32 vol = (nv*getenvval(c,&chninfo[c].venv,256))>>7;
vol = (vol*chninfo[c].fadevolstart)>>16;
vol = (vol*chninfo[c].masterVol)>>8;
vol = (vol*mainVolume)>>8;
return vol;
}

I assume the mainVolume & masterVol parts are separate from the curve application, & that I can discard them. >>16 cancels the maximum value for fadevolstart, which is to be expected, since 65536 is the reference amplitude.

4
MilkyTracker Support / Re: Envelope & fadeout meaning
« on: October 07, 2011, 17:48:29 »
I just found something strange to me, which is that sample points have 5- and 6-bit precision for each coordinate, but take up two bytes. Why on Earth?

EDIT: Nevermind, I can see the time values going beyond, I wasn't thinking straight and read the block precision for the numerical precision.

5
MilkyTracker Support / Re: Envelope & fadeout meaning
« on: October 05, 2011, 14:09:21 »
The envelopes are saved in XI files, which could be processed outside milky though.

This is more what I mean. Clarified.

Quote
The smallest x-increment in the envelope editor is one tracker tick. The song Spd value controls how many ticks there are per pattern row. The BPM value sets the rate of the ticks. In other words the envelope speed is not fixed to time.

Okay, but if I use a fixed BPM & speed, how do I turn a tick into real time?

Quote
Trial and error is what I always say but I can try looking for the exact thing. In the meantime, it can be found somewhere in the source code. :)

Trial and error isn't an option, because I have no way of measuring the time precisely. :( If I get any spare time I'll go through the source, it can't be too hard to find.

6
MilkyTracker Community / Re: How are xi instruments made?
« on: October 05, 2011, 11:28:00 »
This version contains important corrections and clarifications:

http://16-bits.org/xm/

7
MilkyTracker Support / Envelope & fadeout meaning
« on: October 05, 2011, 05:23:19 »
I'm translating envelopes and have some questions.
Can you export or read off the numerical values of envelope points? I built something for this since posting, but it didn't work for all my modules.
What are the lengths of each sample distance in the envelope, i.e. the width of each square in seconds?
How do fadeout settings translate into seconds?

A for sample distance:
amp=65536((e_1.amp-e_2.amp)(e_2.amp-tickspassed)/distance(e_1,e_2)+e_2.amp)>>16
Amplitude is a function of ticks passed, & the distance b-n points is more an expression of how many ticks it takes to shift the weight of interpolation from one envelope point e_1 to the next e_2.

A for fadeout:
amp(tick)=65536-fadeout*tick.
Has points (0, 65536) & (65536/fadeout, 0).
When fadeout=0, the 0 is at never (infinity) & the amplitude is constantly 65536.

8
MilkyTracker Support / MIDI message for instrument?
« on: July 30, 2011, 09:59:11 »
I'm wondering if I can set the instrument of a note with a MIDI message.

9
MilkyTracker Community / Re: Mod help - Waveform info
« on: February 13, 2011, 21:10:14 »
Thanks for the info. GUI hacking has been a bit of a show-stopper, but only because I got sidetracked into trying to get multisample editing, which would require overhaul of the fundamental, singleton-based method of sample editing. Would you recommend creating a new FFT object or trying to extend the EQ feature?

10
I dug around in the source, and found it to be an incomplete project.

There's a commented-out line in the source that allows multichannel editing, but the change of channel occurs whether or not the present channel is empty (making it difficult to read the music), and before the sample is written (so that selecting the 1st track writes to the 2nd).

Location:
PlayerController.cpp
PlayerController::getNextRecordingChannel()
return (currentChannel+1)%module->header.channum;

Pages: [1] 2 3