### Brinstar Cover Help

Posted:

**Tue Jun 16, 2015 9:52 pm**I can't get the second frame to sound right. Can I please have help?

Page **1** of **1**

Posted: **Tue Jun 16, 2015 9:52 pm**

I can't get the second frame to sound right. Can I please have help?

Posted: **Tue Jun 16, 2015 10:18 pm**

That's because this is a straight sixteenth-note rhythm and your module is set up only for triplets. You can mess with Gxx commands to get the rhythm you want, by fitting four notes into the space of three rows using delays. I gave it a try, not quite perfect, but you can test different Gxx values and see if you find better ones.

There might be a mathematical way to do it perfectly, but if I'm correcting in assuming that at speed 8 each row takes up 9 "ticks", then 27 (3 rows) isn't perfectly divisible by 4 and thus it'll have to be an approximation. Someone tell me if I did that wrong.

There might be a mathematical way to do it perfectly, but if I'm correcting in assuming that at speed 8 each row takes up 9 "ticks", then 27 (3 rows) isn't perfectly divisible by 4 and thus it'll have to be an approximation. Someone tell me if I did that wrong.

Posted: **Wed Jun 17, 2015 4:21 am**

jaxcheese wrote:at speed 8 each row takes up 9 "ticks"

At standard tempo, which is 150 BPM in 60 Hz, each row takes exactly as many ticks as the speed value. Therefore 8 ticks are consumed in each row and the Gxx values are

Code: Select all

`ROW 00 : A-3 02 . G08`

ROW 01 : A#3 02 . G06

ROW 02 : A-3 02 . G04

ROW 03 : F-3 02 . G02

G09 becomes G08 during playing; row delay cannot delay notes for more than a row, otherwise the sound driver would need a variable-length priority queue to hold all the delayed notes. GFF is capable of safely delaying notes and effects by exactly one row, although iirc it had led to several bugs in the NSF driver around official 0.4.0.

It is possible to specify an algorithm which calculates the row offsets and Gxx parameters for any tuplet across a fixed number of rows:

Code: Select all

`var R := number of rows;`

var T := number of notes in the tuplet;

var Ticks[R + 1];

var Final[T];

Ticks[0] := 0;

for i from 0 to R - 1 do // can be implemented as a left scan

Ticks[i + 1] := Ticks[i] + number of ticks on row i; // Refresh rate * Speed * 2.5 / Tempo

for i from 0 to R - 1 do

var Pos := 0;

var Offset := Ticks[R] * i / T; // Ticks[R] is equal to the tuplet's total length in ticks

while not Ticks[Pos] <= Offset < Ticks[Pos + 1] do // can be done by floor division alone if there are no grooves

Pos := Pos + 1;

Final[i] := {Row = Pos, Gxx = Offset - Ticks[Pos]}; // requires an appropriate rounding off for Gxx

for i from 0 to T - 1 do

if Final[i].Row == Final[i + 1].Row then // resolve notes on the same row as in G08 above

if Final[i].Gxx == 0 then

Final[i].Row := Final[i].Row - 1;

Final[i].Gxx := Final[i].Gxx + number of ticks on row (i - 1); // can be 0xFF

else

return false;

for i from 0 to T - 1 do

if Final[i].Gxx > 0xFF then // may require higher values for very low BPM

return false;

return true, Final.

Feel free to implement this in any programming language. Note, however, that the number of ticks on any given row may not be uniquely defined if Fxx effects are used outside the tuplet.

The Metroid sound driver does not have the concept of meter; each note here is simply defined to have a duration of 6 ticks, which was retrieved from a lookup table for fast processing. So if one were to cover the ending theme instead, they might expect the triplet in the outro to sound "even"; however, it looks like this:

Code: Select all

`ROW 00 : C-2 00 . F07 ROW 00 : C-2 00 . F12`

ROW 01 : ... .. . ... ROW 01 : G-2 00 . ...

ROW 02 : G-2 00 . G04 ROW 02 : C-3 00 . ...

ROW 03 : ... .. . ... ROW 03 : --- .. . F02

ROW 04 : ... .. . ... ROW 04 : D-2 00 . F12

ROW 05 : C-3 00 . G01 ROW 05 : G-2 00 . ...

ROW 06 : ... .. . ... ROW 06 : C-3 00 . ...

ROW 07 : ... .. . S05 ROW 07 : --- .. . F02

ROW 08 : D-2 00 . ...

ROW 09 : ... .. . ...

ROW 0A : G-2 00 . G04

ROW 0B : ... .. . ...

ROW 0C : ... .. . ...

ROW 0D : C-3 00 . G01

ROW 0E : ... .. . ...

ROW 0F : ... .. . S05

Every note is 18 ticks long, and then a very short 2-tick note cut is applied. As the first two notes in each triplet are shorter than the expected average ticks value (7 * 8 / 3 = 18.67), one cannot locally use a single Fxx effect to represent the triplets as is. Early sound programmers permit only such constructs when the BPM value is not "smooth" enough.

Posted: **Wed Jun 17, 2015 2:16 pm**

Okay, thanks for the help! I'm wasn't exactly sure of the Gxx effect.