aaronsgiles / ymfm

BSD-licensed Yamaha FM sound cores (OPM, OPN, OPL, and others)
BSD 3-Clause "New" or "Revised" License
265 stars 41 forks source link

Reface DX mode #17

Open jrmoserbaltimore opened 3 years ago

jrmoserbaltimore commented 3 years ago

Feature request for a Reface DX core. I believe this is highly similar to the DX7, but with envelope levels from 0 to 127 instead of maxing out at 99, a feedback on every operator, and a square and saw feedback mode (are these just alternate waveforms?). Needs a little more research beyond my understanding.

The Reface DX is a portable keyboard with a 4-operator synthesizer, at a $300 price point, and with what is currently considered one of the easiest FM synthesis configuration interfaces available. This makes it a good entry-level choice for people who want a physical keyboard, although it's fairly limited compared to an OPL3. Yamaha maintains an online community repository of patches. A software implementation would allow using these patches in DAWs and tracker software which implement such a feature, using ymfm as the synthesizer core.

nobuyukinyuu commented 3 years ago

There are be other differences to take into account; the most obvious one is probably the LFO, which has different defaults and specs compared to other FM chips. The lookup table for sines in YMFM is based off the OPLx decap project and are 8-bit in nature (256*4 samples per period max), whereas Reface is likely to use higher resolution LUTs for this purpose. Perhaps it would be closer in scope to request this over at Dexed?

If you're still interested in something closer to ymfm, I've adapted some of the ymfm core in PhaseEngine and with naive knowledge of the synth and info from online sources, have attempted to make the LFO and 4-op preset algorithms Reface-compatible. (I have no plans on reverse engineering the patch or sysex format used by Reface.)

jrmoserbaltimore commented 3 years ago

That's interesting. I keep forgetting about the sizes of LUTs; the pipeline for my (hardware) synthesizer (major work in progress) uses an 18-stage CORDIC pipeline instead. Not so great in software, and doesn't accurately reproduce specific chips you'd want to emulate. There are probably other complexities with implementing a Reface 4-Op synth core, notably its feedback modes are square, sine, saw, and I have no idea what that means when talking about feedback rather than the operator's waveform function.

The patch format is fully documented by way of a full listing of the MIDI sysex protocol for programming in patches, but it's up to you if you want to add whatever feature and whatnot at all; I've only raised the potential. Aside from the parameter sizes and LFO stuff, I'd expect the sysex stuff would be relevant for the application using the core, rather than the core itself, but I don't know much about these things.

ymfm is BSD licensed and I've been looking to press for better native FM synthesis support in OpenMPT, which doesn't support VST3 plug-ins (Dexed no longer provides a VST2 package). Understandably, though, the OpenMPT devs don't want to write a bunch of complex synthesizer cores, and they don't want to integrate with GPL code (OpenMPT is BSD), so I went poking about looking for reusable libraries.

It's kind of irrelevant, but much of this is less that the Reface has any special, advanced synthesizer (it doesn't) and more that I'm thinking in terms of access to audio production tools by people in low-income households. Accessibility of low-cost options such as a low-cost keyboard/synthesizer (Reface DX) or DAW (Fruity Loops is around the same price, Dexed is free and works with it), or a free tracker (OpenMPT pointedly doesn't work with Dexed) coupled with interoperability with free services providing ready-made patches is an ideological musing I decided to evaluate at a lark.

Also I'd thought the DX7 used OPZ, but I'm mistaken; it uses the OPS, which ymfm doesn't have, so similarities to that is kind of irrelevant here.

Wasn't aware of PhaseEngine. That's nifty. Looks like you have configurable algorithms in that, too.

nobuyukinyuu commented 3 years ago

It would be pretty cool if OpenMPT's FM core supported 4-op mode. I've requested that of Saga at least once or twice :)
I believe the support is there in the source iirc (through OPL3 support), there's just no UI for it currently. Completely understandable about wanting a BSD solution given OpenMPT's status (and Dexed no longer offering VST2 -- I ran into the same issue the other day when I went to update my copy 😂 ).

I believe it's the TX81z which uses the OPZ; there appears to be some support for it in ymfm. Aaron's work on bringing emulation of these chips to the BSD/MIT world has been a real blessing, and it's only been within the last year or so that the work on them have been widely available to peek at and repurpose outside copyleft or some close-knit circles. I'm sure that change happened for a reason! There will probably be plenty of developments springing from this nice work.

jrmoserbaltimore commented 3 years ago

Aaron's work on bringing emulation of these chips to the BSD/MIT world has been a real blessing

No kidding. OPL3 is a great chip, but it doesn't have non-harmonic multipliers. You can mimic the bell in Corridors of Time with two operators on the DX7 or Sega Genesis, since both have coarse/fine/detune, but it doesn't work on OPL3. OPNA or OPS would offer a lot more.