After reading a few posts I still don’t have a grasp on what makes 2 sounds be treated as gapless.
Initially I took it as sounds that are not layered over one another, but lock->endlock is not, so not sure how that’s not gapless, unless it’s because lock can be interrupted at anypoint, whereas something like in->pstoff, the in.wav is guaranteed to be played to its end?

Then I thought the clue might be in effect.h such as EFFECT2(in, pstoff); showing a linked relation of sorts, but preon->out doesnt look like that, so I’m not sure where the code does this gapless magic.

There are essentially three ways to play a new sound in proffieos: monophonic, polyphonic and gapless.

  • Polyphonic is actually the simplest one. In this case we just find a new wav player, and make it start the new sound.
  • Monophonic basically starts the same way, we find a free wav player and have it start the new sound AND we quickly fade out the currently playing hum sound. The new player becomes the new hum player, and once the current sound is done, it will play the hum using a GAPLESS transition.
  • A gapless transition can only happen at the end of one file and starting another. All looped sounds use gapless transitions to start the effect over again. Other examples of gapless transitions: preon → on/poweron, bgnlock/clas → lock, bgndrag → drag, out/poweroff → pstoff, and almost anything → hum in case of monophonic sounds.

Some of these gapless transitions are set up by using the second argument in the EFFECT2 macro, but some of them are set up in code depending on what type of sounds are available. Documenting the exact rules for this would be super helpful for font makers I would think.

1 Like

Thanks. Well, glad I partially figured it out.
In terms of “figuring out” whether the font is mono or poly, I think the TODO list might need some expediting.
Plecter based naming convention no longer means it’s definitely monophonic, as the latest font packages have poly fonts with the same ‘lockup’, ‘humM’, ‘poweron’ etc…
Maybe just an entry in the font config.ini?
Although that would make retroactively supporting font’s without that entry tough.

Since the transition to hybrid fonts, it is possible to mix monophonic and polyphonic sounds in the same font, assuming that the monophonic or polyphonic nature of the sound can be determined from it’s filename. There is a fair bit of code for this in hybrid_font.h, and it makes different decisions if Humm is present. I’ve been considering adding config entries to control this, but on a per-effect level, not for the whole font.

Ah. Yeah, looking closer now, it does seem to be a constant that the “legacy” (monophonic) fonts have hum (one M) while poly fonts use humm.