Files
BT411/engine/MUNGA_L4/L4AUDLVL.h
T
arcattackandClaude Opus 4.8 847b9b85cd Audio: target the step-intensity send at FOOTSTEP sources only (task #50)
The output-filtered broadcast still fed EVERY volume/brightness mixer -- the
always-on ambience pulse's own volume mixer got cranked to step intensity on
every stride ('a stuck button', 3/s, loud).  The send now identifies footstep
sources by authored patch (FootFallInt/Ext: bank2 37-39, bank1 106/107) through
mixer->GetTargetComponent() -> AudioSource -> PatchResource LOD bank/patch
(new accessors: GetTargetComponent, GetBankID/GetPatchID,
AudioResource::PeekAudioLevelOfDetail).

Also: step intensity curve raised (speed/25, floor 0.55 -- a mech stomp is
never subtle; it was firing at ~0.4 gain and masked under 0.9-gain layers,
heard as an unrecognizable 'orchestral hit').

Verified: FootFallInt at 0.78 gain in the live tape; the ambience pulse back
to its brief authored form (absent from 1/s snapshots).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 08:36:28 -05:00

175 lines
3.8 KiB
C++

#pragma once
#include "..\munga\audlvl.h"
#include "l4audhdw.h"
#include "openal/al.h"
enum SampleChannel
{
CHANNEL_LEFT,
CHANNEL_RIGHT,
CHANNEL_CENTER
};
enum SampleLoop
{
LoopAtWill, //Will play once or loop as desired
ForceStatic, //Plays only once even if looped
LoopAlways, //Ramp up and then down
SampleLoopMax
};
struct SAMPLEINFO
{
int bufferIndex;
bool implemented;
const char *file;
SampleChannel chan;
SampleLoop loop;
};
struct PRESETINFO
{
int sampleNum;
SAMPLEINFO samples[5];
bool is3d;
};
extern PRESETINFO allPresets[2][128];
bool PRESET_isImplemented(int bank, int preset);
int PRESET_getNumSamples(int bank, int preset);
SAMPLEINFO PRESET_getSampleInfo(int bank, int preset, int sampleInd);
void PRESET_setBufferIndex(int bank, int preset, int sampleInd, int index);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PatchLevelOfDetail ~~~~~~~~~~~~~~~~~~~~~~~~~~
typedef MIDIValue SBKPatchID;
typedef MIDIValue SBKBankID;
class PatchLevelOfDetail:
public AudioLevelOfDetail
{
public:
//
//-----------------------------------------------------------------------
// Construction, Destruction, Testing
//-----------------------------------------------------------------------
//
PatchLevelOfDetail(PlugStream *stream);
~PatchLevelOfDetail();
void PlayNote(SourceSet sourceSet);
void StopNote(SourceSet sourceSet);
Logical
TestInstance() const;
virtual AudioVoiceCount
GetVoiceCount()
{return PRESET_getNumSamples(bankID,patchID);}
// (task #50) expose the authored bank/patch so the game-side footstep
// intensity send can identify footstep sources precisely.
int GetBankID() const { return (int)bankID; }
int GetPatchID() const { return (int)patchID; }
//
//-----------------------------------------------------------------------
// BuildFromPage
//-----------------------------------------------------------------------
//
static void
BuildFromPage(
PlugStream *stream,
NameList *name_list,
ClassID class_ID,
ObjectID object_ID
);
//
//-----------------------------------------------------------------------
// Accessors
//-----------------------------------------------------------------------
//
void
SetupPatch(SourceSet sourceSet);
MIDINRPNValue
GetMaxMIDIFilterCutoff()
{return maxMIDIFilterCutoff;}
private:
//
//-----------------------------------------------------------------------
// Private data
//-----------------------------------------------------------------------
//
SBKBankID
bankID;
SBKPatchID
patchID;
MIDINRPNValue
maxMIDIFilterCutoff;
#ifdef LAB_ONLY
int
setupCount;
#endif
//
// Keep table of created patchs to verify that duplicates
// are not created
//
#if DEBUG_LEVEL>0
static TableOf<PatchLevelOfDetail*, unsigned int>
patchTableSocket;
#endif
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PatchResource ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class PatchResource:
public AudioResource
{
public:
//
//-----------------------------------------------------------------------
// Construction, Destruction, Testing
//-----------------------------------------------------------------------
//
PatchResource(PlugStream *stream);
~PatchResource();
void PlayNote(SourceSet sourceSet);
void StopNote(SourceSet sourceSet);
Logical
TestInstance() const;
//
//-----------------------------------------------------------------------
// BuildFromPage
//-----------------------------------------------------------------------
//
static void
BuildFromPage(
PlugStream *stream,
NameList *name_list,
ClassID class_ID,
ObjectID object_ID
);
//
//-----------------------------------------------------------------------
// Accessors
//-----------------------------------------------------------------------
//
void
SetupPatch(SourceSet sourceSet);
MIDINRPNValue
GetMaxMIDIFilterCutoff();
};