[SUG][PLAYER] Sound For Release Rate Increase/Decrease

Started by WillLem, March 24, 2020, 09:39:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Would you like this sound to be added?

Yes, I'm in favor of this
7 (53.8%)
No, but a single quick sound upon reaching minimum / 99 is okay
0 (0%)
No, no sounds at all for RR change
2 (15.4%)
Don't care
4 (30.8%)

Total Members Voted: 13

WillLem

Quote from: namida on January 28, 2023, 07:37:37 PM
Quotewould it be possible for the skill select button sounds to also increase/decrease in pitch when scrolling left and right

This one is not going to happen. While the underlying audio library probably has support for such a feature, the code NL uses to manage / play sounds does not, and that'd be a major thing to add at this point

Fair enough. Are we still on for potentially adding sound to the release rate button though?

A simple "silent buttons" checkbox in F2 could turn all button sounds on and off, for those that prefer no sound. The audio feedback from buttons is important for a number of reasons including real-time play, speedrunning/challenge play, knowing you've skipped up to max or down to min rate without looking, and the fact it's just generally in keeping with the audio feedback elsewhere in the engine.

Note this topic that I started ages ago.

WillLem

#16
Just making a note of this here:

COMBASSFXLibrary

It's a BASS wraparound that allows deeper audio processing such as pitch shifting, etc. Not sure if BASS.dll already supports that, but this one definitely does.

There's also this one:

RubberBandLibrary

There's also BASS_fx.dll, which apparently includes a pitch-shifting component.

WillLem

This, in LemGame.pas, implements this feature (EDIT: see next message, the following isn't the best way to do it):


/// Line 6617 in SLX ///

procedure TLemmingGame.CheckAdjustSpawnInterval;
var
  NewSI: Integer;
begin
  if SpawnIntervalModifier = 0 then Exit;

  NewSI := CurrSpawnInterval + SpawnIntervalModifier;
  if CheckIfLegalSI(NewSI) then
    RecordSpawnInterval(NewSI);
    CueSoundEffect(SFX_ASSIGN_SKILL);                <------------------- {new line here}
end;


Note that it's almost certainly worth using a gentler sound effect whilst NL doesn't support pitch-shifting. I've attached one here that I'm currently using as a placeholder in SLX whilst I hunt for a better sound. Eventually, I'm hoping to use the bass_fx.dll plugin to implement pitch-shifting up and down, but this is a way off yet. I've got lots to learn about sound library programming.




EDIT: The sound plays whilst in normal speed, but not whilst paused. The reason for this isn't apparent.

WillLem

OK, there is a much better place to cue the sound effect. Previously, the sound would continue to cue (when holding the button down) even when Min/Max RR was reached.

This fixes that particular issue, but the sound still won't trigger when the game is paused:


//// line 6140 in SLX ////

procedure TLemmingGame.AdjustSpawnInterval(aSI: Integer);
begin
  if (aSI <> currSpawnInterval) and CheckIfLegalSI(aSI) then
    currSpawnInterval := aSI;

  CueSoundEffect(SFX_CHANGE_RR);             <-------------------------------------------------- new line here
end;