Jetpack prop update and questions! (with very instructive alt sound discussion)

oh NOW I understand. Sorry.
The index used is the previous alt #, but the folder it’s chosen from is the current alt #.

Tested just now.
Sequence with chhum0-4 in font root or in each alt folder(same expected results):

-> Playing Starkiller1/alt000/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt001/chhum0.wav
-> Playing Starkiller1/alt001/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt002/chhum1.wav
-> Playing Starkiller1/alt002/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt003/chhum2.wav
-> Playing Starkiller1/alt003/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt004/chhum3.wav
-> Playing Starkiller1/alt004/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt000/chhum4.wav
-> Playing Starkiller1/alt000/hum.wav

Ok great - makes sense and understood, thanks.

Do we want to have altchng behave the same way to leverage expectations when building a font?
It’s currently not set with Select(), so while it does play from the {to} alt, it does not use the indexing and is randomly chosen.
Unless that’s intentional? (which is fine, just seeing if it should maybe be more uniform)

-> Playing Starkiller1/alt000/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt001/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt001/altchng4.wav
-> Playing Starkiller1/alt001/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt002/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt002/altchng0.wav
-> Playing Starkiller1/alt002/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt003/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt003/altchng1.wav
-> Playing Starkiller1/alt003/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt004/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt004/altchng4.wav
-> Playing Starkiller1/alt004/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt000/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt000/altchng0.wav
-> Playing Starkiller1/alt000/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt001/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt001/altchng2.wav
-> Playing Starkiller1/alt001/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt002/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt002/altchng3.wav
-> Playing Starkiller1/alt002/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt003/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt003/altchng0.wav
-> Playing Starkiller1/alt003/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt004/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt004/altchng2.wav
-> Playing Starkiller1/alt004/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt000/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt000/altchng3.wav
-> Playing Starkiller1/alt000/hum.wav

Modifying hybrid_font.h like this is a small change:

      case EFFECT_ALT_SOUND: {
        int previous_alternative = 0;
        if (num_alternatives) {
          previous_alternative = current_alternative;
          if (SaberBase::sound_number == -1) {
            // Next alternative
            if (++current_alternative >= num_alternatives)  current_alternative = 0;
          } else {
            // Select a specific alternative.
            current_alternative = std::min<int>(SaberBase::sound_number, num_alternatives - 1);
            // Set the sound num to -1 so that the altchng sound is random.
            SaberBase::sound_number = -1;
          }
          RestartHum(previous_alternative);
        }
        SFX_altchng.Select(previous_alternative);
        PlayCommon(&SFX_altchng);
        break;
      }

and viola

-> Playing Starkiller1/alt000/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt001/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt001/altchng0.wav
-> Playing Starkiller1/alt001/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt002/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt002/altchng1.wav
-> Playing Starkiller1/alt002/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt003/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt003/altchng2.wav
-> Playing Starkiller1/alt003/hum.wav
-> unit = 0 vol = 0.50, Playing Starkiller1/alt004/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt004/altchng3.wav
-> Playing Starkiller1/alt004/hum.wav
-> unit = 1 vol = 0.50, Playing Starkiller1/alt000/hum.wav
-> unit = 4 vol = 0.50, Playing Starkiller1/alt000/altchng4.wav
-> Playing Starkiller1/alt000/hum.wav

No, we can’t change how it behaves now for backwards compatibility reasons.

Ah.
Well obviously I’m not going to disagree with you, but I will voice my observation that I know of zero existing sound fonts that use this sound. I consider myself pretty heavily involved/invested in using ProffieOS and this is literally the first time I’ve even dabbled with it. I’m not sure exactly what it would break if there’s nothing currently using it.
I also have a very small world view, so of course I could be completely incorrect, but it is my opinion that the alt sounds feature in general isn’t even known by the vast majority (yet), and if at all, the altchng sound even less to none.
Fett263’s library supports styles that utilize alt sounds, but those use transition sounds to my understanding. Again, I’m not very familiar so I could be mistaken.

Anyway, this is the beauty of open source. If I feel like changing altchng’s behavior for my use, I can.
I guess I was thinking of it as my experience is with it (as a new feature) and since altchng and chhum are friends that are triggered the same way (but different being mono and poly) I just figured they would be chosen similarly.

Wow I really hijacked this thread. My apologies.

Not at all. No apologies needed (but if you @NoSloppy insists, then apologies accepted). This is fascinating. And most probably exactly what I need after all.
I have no idea how to make the right sounds to apply it but this is a great start.

And I still have to find a way to apply it for both “up” and “down” transitions for an engine revving at different speeds.

So thank you both for your time and explanations.

I’d think that “entering this RPM speed” as a single sound would cut it, no?
Like whether you come from 5 → 4 or 3 → 4, the “shift to 4” sound is what you want?

By using just a single chhum file in each alt folder, you can have the appropriate “shift” sound for each engine RPM level by leveraging the way chhum files use the alt folder indexing for selection , or in this case how it doesn’t use indexing if there’s only one file.

Here’s some test wavs, organized and ready to go.
You can put these in a font alone and see how it would work.
https://www.dropbox.com/scl/fo/b3ub0evl988ea1g7d2a8h/ACIHh0pUa680vLDuvoEUlEM?rlkey=7l1rgni8h3skii6iwxfzzaqyn&st=mk87r6uv&dl=0

Then this blade style code goes with them.

StylePtr<Layers<
  ColorSelect<AltF,TrInstant,Red,Green,Blue,Yellow,Cyan>,
  TransitionEffectL<TrDoEffectX<TrInstant,EFFECT_ALT_SOUND,ModF< Sum<AltF,Int<1>> , Int<5> >>,EFFECT_USER2>,
  TransitionEffectL<TrDoEffectX<TrInstant,EFFECT_ALT_SOUND,ModF< Sum<AltF,Int<-1>> , Int<5> >>,EFFECT_USER1>
>>()

You just need a button event to trigger USER1 and USER2 as the code is written, but you can change it to EFFECT_BLAST and EFFECT_CLASH or whatever, it’s just a means to cycle the alt forward and backward.

from 5 to 4 it’s a deceleration sound (tiii ii i u uu uuuw)
from 3 to 4 it’s an acceleration sound (tuuu uu u i ii iii)
I am sure you know what a jet engine accelerating and decelerating sounds like, right? It would be cool if I could play the sounds “in reverse” iii ii i u uu uuu or uuu uu u i ii iii just like audacity can do.

That I cannot visualize how it would work. So let’s say I have 5 engines settings:
20% power, 40% power, 60% power, 80% power and 100% power as my hums in Alt000 to Alt004 folders, and each are 2 seconds long and obviously playing themselves on repeat. Then I have 4 transitions: 30%, 50%, 70% & 90% as my chhums also 2 seconds long but only playing once between each “even % hums”. I think that would sound quite “jerky” while a jet engine is supposed to run smooth. But lets imagine it would sound smooth enough, where do I put chhum “30%” ? In Alt000 or Alt001 ?

If you are going to get very specific on accel and decel transitions, you should probably use tr sounds then.
The prop will need to compare current_alternative to previous_alternative, and conditionally trigger the correct tr based on whether > or <.

So, it may not be possible at all to get a smoth up/down engine sound in ProffieOS, because the proffieOS sound system works like a piano, not a trombone.

What you want is more like “play an engine sound at frequency X”, not “play engine sound X”. We have the latter, not the former.

Since ProffieOS is open-source, it’s absolutely possible to have the former, but it may require digging around in the low-level sound routines to get. Also, since revving up an engine isn’t just a matter of playing the sample faster, it is likely to require some a combination of samples at different frequencies and being able to play stamples faster and slower, or maybe just a lot of samples at different frequencies.

The alternative is to have set levels. You can have smooth transitions from any given level to any other given level, but transitioning quickly over multiple different levels will probably never sound perfectly smooth. It is possible to make some improvements though. For instance, if you know that you want to preserve the frequency during transitions, you could pre-compute the frequency at every point in every transition and use that to improve the transition states.

Let’s say you have three levels: 0 rpm, 500rpm and 1000rpm.
Then you turn the engine on by transitioning to 500rpm.
However, before the first transition is done, you switch from 500rpm to 1000rpm.
At at the time of transition you might be at 200rpm, and your pre-computed values will tell you that.
So instead of playing the 500-to-1000rpm transition, we’ll need to play the 0-to-1000rpm transition and fast-forward until we reach 200rpm, then do a quick cross-fade between the old transition (0-500) and the new (500-1000).

This is all quite possible, but requires some work to do.

1 Like