Finally! Pitch Slide + Arpeggio != FAIL

This is one of those things that’s bugged me for a while.

Without wanting to go into too technical an explanation, adding arpeggios to a pitch slide on the NES is not particularly straight forward. The NES’s pitch is not linear so (unless you’ve implemented a method to create linear pitch sliding, which I haven’t in NTRQ), your pitch slides will always accelerate/decelerate the higher/lower the pitch. This is because the difference in register values are smaller the higher up the range you go (and vice versa).

The complication with adding arpeggios to this is that the arpeggio sound is built on cyclically adding semitone offsets to the current note number. A simple major triad would cycle between the root note, +4 semitones and +7 semitones. However, as you slide the root pitch, the +4/+7 semitone offsets are still adding the same amount of offset to the original pitch. In the case of, say, a slide from C4 to C5, by the time the pitch arrives at C5, the value written to the NES’s frequency registers to obtain that pitch has halved (I won’t get into why here). If your arpeggio was playing correctly at C4, by the time the root pitch reaches C5, if you’re still adding the same offset it will be adding +16/+19 effectively (and crudely oversimplified).

It’s because of this that you’ll find the combination of pitch slide and arpeggio is often messed up or disabled in many trackers. With good reason :)

There are a few ways to overcome it but most (for me) would involve more maths code (I don’t need NTRQ to be any slower!), bigger look-up tables (for note values) and/or total rewrite of note/frequency handling.

Last night though I came up with quite a neat little solution that made use of existing slide calculations in NTRQ. Basically, as the code is sliding the root pitch, it compares the current frequency to that of the note above (or below depending on direction). I’m then able to roughly track the current new “root” as the frequency of the sliding note changes. This then gives me a proper “base” from which to calculate the frequency offsets for the arpeggios and voila, sliding arpeggios :D

The only downside is that because it’s a “trick” rather than a robust solution, the slower your arpeggios, the more the trick is exposed and the worse the effect gets. This is because you start to hear the steps in between where the actual siding pitch that you hear is somewhere in between two semitones.

I’ll give it some thorough testing but I can’t see why this won’t make it into V1.0 release.

2 comments to Finally! Pitch Slide + Arpeggio != FAIL

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>