Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update GYB file format specification #86

Closed
ValleyBell opened this issue Nov 25, 2019 · 10 comments
Closed

update GYB file format specification #86

ValleyBell opened this issue Nov 25, 2019 · 10 comments
Assignees

Comments

@ValleyBell
Copy link

The current GYB file format specification was reverse-engineered.
Feel free to use the actual specification instead: http://vgmrips.net/programs/_gyb_format.txt

@Wohlstand
Copy link
Owner

Thanks for the specification, now the file should be in a correct format... Yeah, Me and my friend, @jpcima, have inspected Nineko's MIDI2VGM to get the ability to use the format here, in OPN2-BE. So, the support of the format should now be completed, not partially and guessed.

@Wohlstand
Copy link
Owner

BTW, why this file has version 2, however, at 0x105 instruments data begins and no LFO frequency value? Instruments.gyb.zip

Wohlstand added a commit that referenced this issue Nov 25, 2019
#86

TODO:
- Verify the format reader and writer
- Make support for reading and writing of GYBv3 and take some sample "bio-matherials" of GYBv3 for experiments
@ValleyBell
Copy link
Author

The value 0x0C at 0x105 is the LFO value. (for YM2612 register 0x022) The actual instruments begin at 0x106. (The first instrument's data is 71 33 0C 01 ...)

For GYB v1, the LFO value is missing and instruments begin at 0x105.

@jpcima
Copy link
Collaborator

jpcima commented Nov 28, 2019

Thanks @ValleyBell for this document, I hope to implement it sometime shortly.

Are there samples of GYBv3 in circulation currently, or some program to make them?

Under which license do you provide the source code 2612_checksum.c?
I will gladly reuse and credit you, howver I don't see license indications in there.

@ValleyBell
Copy link
Author

2612edit version 0.4 (which included with mid2smps 0.3.5) reads GYB v1 to v3 and always writes GYB v3. So you can just open an old GYB file with it, resave it and it will be v3.

Regarding 2612_checksum.c: There is no license file in the source code, sorry.
I'll go with BSD-3-Clause for it.

@jpcima
Copy link
Collaborator

jpcima commented Dec 4, 2019

GYB formats have been implemented in read and write capacity.

v1 and v2 are able to save GM only.
v3 is able to save banks with LSB:MSB.

note: since v1 and v2 lose non-GM instruments, it will be nice to implement the warning regarding saving using these formats. (like OPL3BankEditor)

Other remarks:

  • chord notes of instruments are ignored, we don't have currently an equivalent
  • the special MSB and LSB value $FF, which means fallback, is taken as 0.
    We also don't have equivalent. Our libOPNMIDI falls back by the same rules as GS or XG.

@jpcima jpcima closed this as completed Dec 4, 2019
@Wohlstand
Copy link
Owner

Wohlstand commented Dec 4, 2019

libOPNMIDI falls into 0 when requested bank is not exist, or instrument of existing bank has a "blank" flag (all instruments in WOPN files are stored in 128 sets and any instruments are absence, usually marked as "blank").

@ValleyBell
Copy link
Author

The "chord note" stuff is merely of descriptive nature.
It isn't intended to instruct the software to "play note+0 and note+7", it just says "when you play note X, it sounds like x+0 and x+7" (e.g. for a 2x2op instrument that plays a 5th chord)

I never got so far to actually implement editing it, so it's an unused feature and it's not necessary anyway.

@Wohlstand
Copy link
Owner

2x2op instrument

Do you mean something like this? #2

Or, please check my xg.wopn and "Lead 5ts", it's a regular OPN instrument that sounds like 5th chord via a small trick with operators and detunes I have picked up from one random game for it.

BTW: About OPL3 world, You may know Doom, Heretic, Raptor games and Voyetra SuperSAPI driver for Win3x, they are using dual-voice instruments in some OPL instruments and that is supported on a side of libADLMIDI and OPL3BE editor (a similar project to this but for OPL3 chip). Did you mean something like this? Anyway, I may guess, GYB-side will just play the same instrument as two notes while my feature and dual-voice on OPL3BE/libADLMIDI allows giving different voices.

@ValleyBell
Copy link
Author

I meant something like that "Lead 5th", yeah.

It's a combination between Algo 4 (output on operator 2 and 4) and the multiplicators set to 3 and 4.
You would set the chord notes to 0 and -5 semitones for it. (It's actually 5+8 and not 1+5, that would be multiplicators 2 and 3.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants