Wohlstand / libOPNMIDI

A Software MIDI Synthesizer library with OPN2 (YM2612) emulator
GNU Lesser General Public License v3.0
96 stars 6 forks source link

add WOPN file library #58

Closed jpcima closed 6 years ago

jpcima commented 6 years ago

WOPN file library with test Some fields I have kept identical from WOPL and marked "reserved", as it's possible to make such things exist in a future time. (is a perspective of a pseudo-8op mode?)

Not integrated yet to libOPNMIDI, and bank API is not made

Wohlstand commented 6 years ago

Thanks for making this! I wanted to make this long time ago, but you did it! :fox_face: :+1: I'll check out the stuff at evening, but I'll merge the thing now...

jpcima commented 6 years ago

Yeah ! :fox_face: I want to make things necessary so I can start a synth for OPN2. I have though about a generic way which won't require me to maintain the code two times.

I've a question: since WOPN current version hasn't got a blank flag, what to do of it for the current time? What about checking both sounding delays for 0 values, for a replacement until a new version?

Wohlstand commented 6 years ago

Yeah, it does using of kon/koff values comparison to zero to identify blank flag. https://github.com/Wohlstand/OPN2BankEditor/blob/b14e61de2964286a2b7e0471d99ab6ed96d301af/src/FileFormats/format_wohlstand_opn2.cpp#L78-L83

However, it's a draft for next version: https://github.com/Wohlstand/OPN2BankEditor/blob/d8a3e0aa1c90d7c144b722fda6564129b612ce7f/Specifications/WOPN-and-OPNI-Specification-draft.txt Where let's add flags. The reason I made with silly comparison of kon/koff with zero as a quick way to escape the imperfection without of file format update.

The next WOPN version is intended to also store PCM chunks for using in Mini-WT through DAC. Feel free to modify it. Then, after release of current stuff, I'll begin work on Mini-WT thing on OPN2-BE side. (the libOPNMIDI will take Mini-WT after it will be polished on OPN2-BE).

jpcima commented 6 years ago

Hmm.. do you not think it's good to use an existing sample specification? After all, sampling specification can be more complex than it seems, because of all looping consideration, and speaking of such things as envelopes, filters.

Existing are gig, sf2, sfz.. The later is text-based as format with sound files collections. They have support libraries out of open source code (linux sampler), they have ready editors for use (polyphone), synthesizers

Me, I would not find a good idea to reinvent such models in weaker ways. I'd express such a thing as: layer this instrument with program N out of such sample file. Even if the synth is custom, it can be polished to infinity after the base is made.

Wohlstand commented 6 years ago

Using of existing instrument format would be an optional extension, but it's not for mainstream. Why? The whole purpose is to don't depend on any external things as it's much easier to able to build the bank and use it without of any external tools. Another idea: external instrument formats can be used to import existing samples and convert them into internal format on the fly. WOPN store is designing for easiest using inside of libOPNMIDI with minimal effort to prepare data for the workflow. The stuff that will be made on OPN2-BE will be designed to manipulate internal format. The first implementation would to lack envelope support to provide basic for PCM percussions, and then extend the thing with melodic stuff.