WYZ music file format

ページ 1/2
| 2

By aoineko

Paragon (1138)

aoineko さんの画像

17-02-2022, 13:57

I have started to integrate a WYZ replayer in my MSXgl library (https://webmsx.org/?MACHINE=MSX1J&ROM=https://github.com/aoi...) thanks to the work of mvac7, but I would like to make some modifications. If I could find the data format of the compiled WYZ files (.MUS), it would help me a lot.
Does anyone have this?

ログイン/登録して投稿

By [WYZ]

Champion (451)

[WYZ] さんの画像

17-02-2022, 15:15

@aoineko This is a very early doc. in spanish. I've to update it with changes made last years but meanwhile it can help you.

Please, take a look at the comments in the ASM code of the last Player version

I've check MSXgl library. Thanks for includding WYZ format too ;). (It seems to be swapped 50hz/60hz toggle?)

By aoineko

Paragon (1138)

aoineko さんの画像

18-02-2022, 02:16

[WYZ wrote:

]@aoineko This is a very early doc. in spanish. I've to update it with changes made last years but meanwhile it can help you.

Gracias [WYZ]!
By "early" do you mean incomplete or incorrect?
Is it likely that you will update the file format soon?
Otherwise, if you can point me to the code that generate de .MUS file from .WYZ, perhaps I can reverse engineered the actual format.

[WYZ wrote:

]Please, take a look at the comments in the ASM code of the last Player version

Is this the latest version of the player?
Is it more recent than the one available in the WYZTracker package (https://github.com/AugustoRuiz/WYZTracker/blob/master/AsmPla...) or the one used by mvac7 for its C language player (https://github.com/mvac7/SDCC_WYZplayer_Lib/blob/master/sour...) ?

[WYZ wrote:

]I've check MSXgl library. Thanks for includding WYZ format too ;). (It seems to be swapped 50hz/60hz toggle?)

Thanks to the creator of the format and the player, for sharing their work with the community. :)

For the moment, I assume that the music was made for a 50 Hz machine, so on 60 Hz ones, I skip 1 frame out of 6.
If the frequency information used to create the music is stored in the WYZ format, I could adapt my player accordingly.

By [WYZ]

Champion (451)

[WYZ] さんの画像

18-02-2022, 15:00

引用:

By "early" do you mean incomplete or incorrect?
Is it likely that you will update the file format soon?

Incomplete. This doc is related to old versions. I'll update it soonest as posible.

引用:

Is this the latest version of the player?

Yes, but not public. It includes Hybrid tempo still not selectable at tracker level. Totally compatible with 47c version available at WT webpage.

There is not information inside the mus module about clock frecuency but you can contribute to improve it. Please, reserve yourself a bit from the byte offset 1 as info 50/60hz (note that bits 3 to 0 are busy). Once you have choose your freq bit i'll inform Augusto Ruiz and he will update the tracker includding it.

;HEADER BYTE 1
;[-|-|-|-|  3-1 | 0  ]
;[-|-|-|-|FX CHN|LOOP]

Meanwhile you can use (hexedit) it internally as information for your replayer.

By aoineko

Paragon (1138)

aoineko さんの画像

18-02-2022, 23:26

I am interested in this new version. If I can get the data format, I should be able to properly rework the integration of WYZ into MSXgl.

For the frequency flag, any bit is good for me. I just advise you to keep bit #7 for a flag that you would need to read very often because it is the cheapest to test. We could use bit #6 for example.
What value have the unused bits in the header currently? If they are set to 0, it would be best to make 0 the default frequency. All the WYZ music I've listen seems to have been made to be played at 50 Hz (PAL), so we could say: 0=50 Hz, 1=60 Hz.

There is another improvement that I think is very desirable, but would require a lot more work: storing table addresses as offsets rather than absolute values.
Currently, you can't load a WYZ music anywhere in memory and have the replayer play it. We have to know in advance where the binary is going to be put or compile the music with the rest of the program. This is quite limiting.
If these tables were stored as offset from the beginning of the file (as in the VGM format), it would be enough to initialize the music with the address where it is in memory, and the addresses of the tables would be calculated at that time by adding the offset.
This is a change of format that would make the old music incompatible, but it would make this format very much easier to use.

By [WYZ]

Champion (451)

[WYZ] さんの画像

19-02-2022, 20:32

Quote:

I am interested in this new version. If I can get the data format, I should be able to properly rework the integration of WYZ into MSXgl.

I'll try to inform you this weekend.

Quote:

For the frequency flag, any bit is good for me. I just advise you to keep bit #7 for a flag that you would need to read very often because it is the cheapest to test. We could use bit #6 for example.
What value have the unused bits in the header currently? If they are set to 0, it would be best to make 0 the default frequency. All the WYZ music I've listen seems to have been made to be played at 50 Hz (PAL), so we could say: 0=50 Hz, 1=60 Hz.

Ok:

;HEADER BYTE 1
;[-|    6      |-|-|   3-1   | 0  ]
;[-|CLKFRQ|-|-|FX CHN|LOOP]

LOOP: 0=OFF / 1:ON
FX CHN 2 BITS VALUE: 1=A;2=B;3=C
CLKFRQ: 0=50HZ / 1=60HZ
Quote:

There is another improvement that I think is very desirable, but would require a lot more work: storing table addresses as offsets rather than absolute values.

Are you talking about notes values of frequency ? If so, there is a reason for this. The typical user of WP are gamedevelopers searching for saving large amounts of ROM space. WP can play all the MUS modules inside the game sharing the same set (MUS.ASM File) of instruments and notes frequencies.

Considering your interest in this I share my last tracks

By aoineko

Paragon (1138)

aoineko さんの画像

20-02-2022, 00:33

WYZ wrote:

I'll try to inform you this weekend.

Thanks. In the meantime, I have already ported the 47d version to be compiled with the SDASZ80 assembler used by SDCC.

WYZ wrote:

Are you talking about notes values of frequency ? If so, there is a reason for this. The typical user of WP are gamedevelopers searching for saving large amounts of ROM space. WP can play all the MUS modules inside the game sharing the same set (MUS.ASM File) of instruments and notes frequencies.

What I am talking about will not change the data size at all. It is just a matter of replacing addresses in absolute value (A010h for example) in offset compared to the beginning of the compiled WYZ data (start + 0010h for example). The only extra cost would be a slightly longer initialization code since the absolute addresses would have to be recalculated according to the start address of the data and the offset.

This is how the VGM format works for example. It allows to put a music anywhere in the memory space of the Z80 and to play the music by giving to the replayer only the address of the beginning of the data. All the other addresses are dynamically determined during the initialization.

It's not a big problem (especially since it already works in MSXgl ^^), but it's less convenient to have to "compile" the music to play it.

WYZ wrote:

Considering your interest in this I share my last tracks

Thanks a lot! It's awesome what you manage to achieve with only 3 channels. :)

By jltursan

Prophet (2619)

jltursan さんの画像

20-02-2022, 12:14

[WYZ wrote:

Considering your interest in this I share my last tracks

Wow, amazing!, thanks!. Am I seeing 6-channel WYZ tracks? :o

By aoineko

Paragon (1138)

aoineko さんの画像

24-02-2022, 00:37

WYZ wrote:

Please, take a look at the comments in the ASM code of the last Player version

Do you have an exemple of use of the player in assembler?

By santiontanon

Paragon (1831)

santiontanon さんの画像

24-02-2022, 05:31

There's an example of how to use the player in the GitHub page here: https://github.com/AugustoRuiz/WYZTracker/blob/master/AsmPla...

Commands are in Spanish, but they are probably easy to Google translate :)

By [WYZ]

Champion (451)

[WYZ] さんの画像

24-02-2022, 15:46

@santiontanon Thanks.
@jltursan & @aoineko yes, There is a 6-channel player. with limitations (Sawtooth is only usable in one channel of the 1st PSG)This is an example

ページ 1/2
| 2