probonopd / MiniDexed

Dexed FM synthesizer similar to 8x DX7 (TX816/TX802) running on a bare metal Raspberry Pi (without a Linux kernel or operating system)
https://github.com/probonopd/MiniDexed/wiki
962 stars 72 forks source link

32 note polyphony on a PI 4 #623

Open diyelectromusic opened 3 months ago

diyelectromusic commented 3 months ago

This is just experimental at this stage for anyone wanting to experiment with 32-note polyphony on a Pi 4. It has been built and appears to configure 32-note polyphony correctly, but it hasn't really been tested in any significant way.

In particular the performance is currently unclear, so at present, use at your own risk.

Feedback on any experiences is welcome.

Kevin

probonopd commented 3 months ago

Please comment here if you have tested this. If there are a couple of positive feedbacks, I'd like to merge this. Thank you very much @diyelectromusic

Banana71 commented 3 months ago

My RPi 4 runs stable and reliably with 32 voices per TG.

Banana71 commented 3 months ago

Unfortunately, I found another problem that occurs with 32 polyphony :-( With Engine Type Mark I, cracking occurs after a very short playing time. I haven't tested Soundengine OPL yet. Is it possible to query the sound engine when assigning the polyphony?

#if RASPPI == 1
        static const unsigned MaxNotes = 8;             // polyphony
#elif RASPPI == 4
        static const unsigned MaxNotes = 32;
#else
        static const unsigned MaxNotes = 16;
#endif
diyelectromusic commented 3 months ago

That's interesting. Does it degrade over time then? And is it an issue regardless of how many notes are actually sounding (i.e. does the cracking sound on single notes) or is it only when you actually reach 32 notes simultaneously?

I was just going on the definition of the maximum polyphony in Synth_Dexed but it is possible that might only be suitable for a specific engine, or maybe it is a theoretical maximum not a practical one!

It might be worth trying an in-between value, say 24...

Banana71 commented 3 months ago

There are several factors that influence the triggering of the crackles. I tested with performances that use all 8 TGs.

I would very much like it if we kept the miniDexed playing with 32x polyphony on an RPi4 and Engine Type 1 (Modern). It would be great if you could set the polyphony for the RPi 4 in the code depending on the sound engine. The piano sounds in particular benefit from the increased polyphony and they actually only sound good with the Modern sound engine. The short attack times of the pianos produce cracking noises via the Mark I and OPL sound engines.

diyelectromusic commented 3 months ago

I wonder if this is all related to the discussion here https://github.com/probonopd/MiniDexed/discussions/358#discussioncomment-5392569 that was never really resolved as far as I can see?

probonopd commented 3 months ago

I'd suspect the same.

diyelectromusic commented 5 days ago

Ok, so returning to the question of polyphony and number of tone generators (see discussion here https://github.com/probonopd/MiniDexed/pull/557) I think I'm going to go with the following:

On a Pi 4 or 5 allow for a maximum of 16 tone generators and a maximum polyphony of 32, but the defaults will probably be as follows: Pi 4: 8 TGs, 24 note polyphony Pi 5: 8 TGs, 32 note polyphony

There will be configuration options for both number of TGs and polyphony but they will be limited to specific values (8 and 16 for TGs; probably 8, 16, 24, 32 for polyphony - although this isn't so critical).

The others will remain with the following settings: Pi 1: 1 TG, 8 note polyphony Pi 2+3; 8 TGs, 16 note polyphony

I don't think we should default to 16 TGs as that is just so much extra menu shuffling to do and all the performances are designed for up to 8 TGs.

The approach I'm taking is to choose sensible defaults we know pretty much work in all cases, but allow the flexibility for people to expand and tradeoff polyphony and TGs depending on the performance of their Pi.

Thoughts? Kevin

probonopd commented 5 days ago

When calculating the available processor power, let's not forget the possibility that someone might want to bring in more elaborate reverbs (think Lexicon 224), choruses (think "Dimension D", "Juno"), etc., so maybe we should leave some headroom and/or (as you suggest) make things configurable.

diyelectromusic commented 5 days ago

I think we can over think it, so I'm all for setting useful defaults, allowing for maximum options and then letting the user find a combination that works for them with what they're trying to do.