Author Topic: Saving patterns the other way... (MPTM)  (Read 3995 times)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,792
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Saving patterns the other way... (MPTM)
« on: November 15, 2008, 13:55:26 »
In his articles about his softsynth, kb/farbrausch pointed out that saving patterns row by row is just "stupid" and that saving them "channel by channel" (first downwards, then left to right) is better, e.g. for compression - redundant data can be compressed easily. So I thought that we could do that in the MPTM format as well...?
» 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.

Offline bvanoudtshoorn

  • Extreme artist
  • *****
  • Posts: 1,053
  • Gender: Male
    • Barryvan
Saving patterns the other way... (MPTM)
« Reply #1 on: November 15, 2008, 14:48:57 »
You know, I like the idea, but I have to ask... Nowadays, is a difference of, say, 300KB really that significant, especially given the amount of work that will go into this?

Personally, I think that a far more logical organisational structure would be by instrument; theoretically, this would then flow through into the pattern's organisation. Something like what was discussed in this post...

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,792
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Saving patterns the other way... (MPTM)
« Reply #2 on: November 15, 2008, 14:52:45 »
Quote
Nowadays, is a difference of, say, 300KB really that significant

I'm always optimizing for size, no matter how much it improves the size. Just because we have the resources, doesn't mean we have to waste them. And there are f.e. also compos that depend on size (32kb compos and other stuff) where you'd love to have this reduction in size.
» 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.

Offline bvanoudtshoorn

  • Extreme artist
  • *****
  • Posts: 1,053
  • Gender: Male
    • Barryvan
Saving patterns the other way... (MPTM)
« Reply #3 on: November 15, 2008, 15:02:53 »
Hmm, I see your point.

In that case, I think that you could have even *more* optimised storage by grouping instruments together, rather than channels.

Offline Harbinger

  • Extreme artist
  • *****
  • Posts: 1,142
  • Gender: Male
  • Operating System: Windows XP
Saving patterns the other way... (MPTM)
« Reply #4 on: November 15, 2008, 15:43:53 »
If i understand you correctly, this would mean a pattern would consist of one track/channel. This sounds closer to sequencing, which is how i cut my teeth. Tracking (as opposed to sequencing) seems somewhat primitive to me, and since i now use .mptm exclusively, i'm all for it. (Should we use a different extension for backward compatibility?)

Oh yeah and optimization is good too

See what you can do!! :)

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,792
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Saving patterns the other way... (MPTM)
« Reply #5 on: November 15, 2008, 15:47:34 »
it doesn't change anything with patterns, it's just a different method of storing data in files which leads to better compression. modules were stored "row by row" in the past because it was faster on the amiga and for no other reason.
» 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.

Offline Harbinger

  • Extreme artist
  • *****
  • Posts: 1,142
  • Gender: Male
  • Operating System: Windows XP
Saving patterns the other way... (MPTM)
« Reply #6 on: November 15, 2008, 16:10:42 »
I see what you mean.

But if we store it this way, wouldn't it be a short leap to ascribe one pattern per track? This would allow patterns A and B of track 1 to be played twice each while track 2 played Patterns C,D, E, and F, for example.

Of course we'd need a new pattern GUI....::)

Offline älskling

  • Workaholic artist
  • ***
  • Posts: 325
Saving patterns the other way... (MPTM)
« Reply #7 on: November 15, 2008, 16:13:31 »
I think this is a good idea when creating 4kB demos, but in general, isn't there also a good reason for many new file formats to be xml-based?

Offline Relabsoluness

  • OpenMPT Developers
  • *****
  • Posts: 709
Saving patterns the other way... (MPTM)
« Reply #8 on: November 16, 2008, 01:59:26 »
Quote from: "Jojo"
In his articles about his softsynth, kb/farbrausch pointed out that saving patterns row by row is just "stupid" and that saving them "channel by channel" (first downwards, then left to right) is better, e.g. for compression - redundant data can be compressed easily. So I thought that we could do that in the MPTM format as well...?

In IT-files pattern data is saved so that there are channel-specific flags used to control what gets written; for example if there is a channel with identical rows, it doesn't save the same row multiple times in the file.

But some new way to write pattern data seems needed at some point, for example the special (control) notes introduced in the devBranch_1_17_03 can't be saved with IT pattern data if I recall correctly.

Quote from: "Jojo"
I'm always optimizing for size, no matter how much it improves the size.

Even at the cost of performance and wasting time on something completely irrelevant?

Quote from: "Jojo"
Just because we have the resources, doesn't mean we have to waste them.

Totally agree.

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 6,792
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Saving patterns the other way... (MPTM)
« Reply #9 on: November 16, 2008, 11:19:40 »
Quote
Even at the cost of performance and wasting time on something completely irrelevant?

Well, of course I don't go that far :D But some things are easy to do and not very resource-demanding. I was maybe exaggerating a bit. :)
» 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.