Pattern aliases

Started by Harbinger, November 04, 2010, 19:39:49

Previous topic - Next topic

Harbinger

Not sure how difficult it would be, but knowing a bit about the code, i want to enter this request for the future. If done right, it could be a feature that most other trackers don't have.

I'm envisioning a Pattern Alias, a special note in a pattern row that forces a channel to play the data from another pattern, even while playback continues in the current pattern. The Pattern Alias would look a bit like a PC event, but instead the user can enter an alias to row Z of pattern Y belonging to the sequence X, something like:

PAT 01 012 000

which means the playback pointer would play the note data starting at row 0 of Order 12 of Sequence 01. (This of course limits the aliasing for the first 1000 rows of the first 1000 patterns of the first 100 sequences).

I'm thinking it can be implemented by simply extracting the note from the given source row (or tick) in the same way it extracts the note from the current tick of the current pattern. That is, the playback pointer keeps up with where it's at for each channel, and when an alias is called, the channel's pointer finds the data from the same place in the source pattern. Then, if a note or other event is called from the current channel, the data and perhaps the sound from the aliased channel is stopped (with options to loop or fade).

An alternate version would be a channel pointer rather than a row pointer. Instead of playing row X it could play the same row (as that of the pattern alias) but at channel X. I could use both methods.

I'm not sure what's the best way of handling pointer desyncing, such as when the current pattern is, say, 32 rows but the referenced pattern might be, like, 36. Theoretically, it should continue with playing back the source pattern until THAT ends, but the playback pointer for each channel would be in different rows, which might be able to be overcome by assigning a variable or an array to keep up with where each channel's pointer is supposed to be calling. Hmm,...like:

CHANNEL           pRow      pChn       pPat      pSeq
  000              031       000        001       001
  001              031       001        001       001
  002              000       006        050       002
...

which shows that when the "global" playback pointer is at row 31 for the current Pattern 1 in Sequence 1, the playback pointer for Channel 2 has encountered an alias, and its playback pointer is in the first row of channel 6 of the given pattern 50 of Sequence 2. So, even if the source pattern (#50) has more or less rows than the current pattern, the pointers should stay in sync as long as every channel's row pointer is incremented properly. But what if the tick count is different? Or the tempo? Perhaps those of the source pattern are ignored, and those attributes of the current pattern are used.
There might also be problems with some of the other pattern FX like Pattern Break or Pattern Loop. Some limitations to their use would have to be introduced.

The result of all this would be similar to a sequencing trick of interchanging instruments using the same pattern of notes -- altho here we're not using different instruments, but it might be possible: patterns could serve as templates for note playback. By leaving the instrument designations in the source pattern blank (notes without instruments), you could call the instrument in your main channel, then call the alias to the "uninstrumented" pattern. You could do the same with volume levels and pan settings. It might also work for differing tempos and other global settings.
It would also save HD space (even though this is nowadays not a huge problem), and could make assembling and transcribing tracks a helluva lot quicker...

Sound doable?

Edit: Moved to the issue tracker

Saga Musix

Sounds pretty much like this request to me, if you agree please close the request.
» 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.

Relabsoluness


Harbinger

Quote from: Jojo on November 04, 2010, 20:23:37
Sounds pretty much like this request to me, if you agree please close the request.

Mmm, not quite the same idea. But it can be used for the same things.

My idea relies more on a refiguring where the playback pointer is at a given tick...have you thought about the difficulty of implementation, or had any ideas on how a future coder can go about putting it together? Jot them here. ;)