A tech question about portamento

Started by Zenon, February 16, 2016, 23:05:35

Previous topic - Next topic

Zenon

I'm actually building a tool that should convert a portamento value from linear frequency slide to amiga period table.
Basically, what I need is to know the math operations that XM does to apply always the same amount of notes; in this way maybe I could reverse the logic to get the relative mod portamento value.

To better understand what I mean, suppose an Xm with ticks=5.

Having a note of C1 and a portamento effect of 104, the note played would changed in C#1.
This doesn't happens on Mod however, because following the period table C1 note corresponds to 856 period
(see https://greg-kennedy.com/tracker/modformat.html)

So in order to reach C#1 note, the relative portamento vale is 1x0B. (I.e. (856-808) / 4).

So the main question of the thread is, how I could port a portamento value based on linear slide to mod the mod logarithmic scale and translate this stuff to a math formula?

Thank you in advance and let me know if I was unclear please  :)
Xrns2XMod converter
http://xrns2xmod.codeplex.com

Saga Musix

That's of course a somewhat difficult question / task because you cannot get an exact answer in all cases. So it would be good to know what you actually need it for, and if there can be any restriction made on the input data. If you want to make perfect XM/IT to MOD conversions - I'd say "don't even try". It cannot practically ever work correctly.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Zenon

#2
Hi jojo, thank you for your feedback :)
The fact is I'm trying to improve conversion of mod portamento of xrns2xmod
xrns2xmod.codeplex.com/

I've already thought on a simple compute that could port  a portamento value (let's say C1 to a fineportamento up of 7) to equivalent mod period matching distance between 856 (C1 period) and 808 (C#1 period) to achieve the relative portamento value.
Though is an absolutely simple and not accurate operation, if you say there's no a precise formula existing, I'll try do my best  :)
Xrns2XMod converter
http://xrns2xmod.codeplex.com

Saga Musix

Well, an XRNS converter could probably simplify things a bit... As you already know, the depth of an Amiga slide depend on the currently played note, and since (AFAIK) you cannot jump around wildly in XRNS files like you can do in classical modules, you have an easier job of tracing the current frequency/period. So what I would do is to de-duplicate all patterns that contain carried portamentos (i.e. if pattern x is used twice and contains a portamento effect at the start that continues a note from the previous pattern, create copies of this pattern). Then, "play" the module line by line and compute the linear slides as usual, and then use a LUT to translate the target of the linear slide to an Amiga slide. You could generate such a LUT by translating all possible Amiga periods to frequencies and the do a binary search on this LUT. This will get close, but won't be perfect in case a portamento is used to slide to an exact note.
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Zenon

Sounds good! thank you very much jojo  ;)
Xrns2XMod converter
http://xrns2xmod.codeplex.com