Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 8768 → Rev 8769

/source/audiolib/include/music.h
73,5 → 73,6
void MUSIC_Update(void);
 
extern char SF2_BankFile[BMAX_PATH];
extern int SF2_EffectSampleBlockSize;
 
#endif
/source/audiolib/src/driver_sf2.cpp
26,8 → 26,11
#include "common.h"
#include "midi.h"
 
int SF2_EffectSampleBlockSize = 16;
 
#define TSF_IMPLEMENTATION
#define TSF_NO_STDIO
#define TSF_RENDER_EFFECTSAMPLEBLOCK SF2_EffectSampleBlockSize
#define TSF_MALLOC Xmalloc
#define TSF_REALLOC Xrealloc
#define TSF_FREE Xfree
182,6 → 185,7
{
int16_t * buffer16 = (int16_t *)MV_MusicBuffer;
static float fbuf[MV_MIXBUFFERSIZE * 2];
float const fvolume = SF2_Volume * (32768.f / MIDI_MaxVolume);
 
for (int i = 0; i < MV_MIXBUFFERSIZE;)
{
196,8 → 200,7
samples = min(samples, MV_MIXBUFFERSIZE - i);
tsf_render_float(sf2_synth, fbuf, samples);
 
int const nsamples = samples * MV_Channels;
float const fvolume = SF2_Volume * (32768.f / MIDI_MaxVolume);
int const nsamples = samples * MV_Channels;
 
for (int j = 0; j < nsamples; j++)
*buffer16++ = clamp(Blrintf(fbuf[j] * fvolume), INT16_MIN, INT16_MAX);
/source/audiolib/src/fx_man.cpp
113,6 → 113,7
{ "mus_al_postamp", "controls post-synthesization OPL3 volume amplification", (void*) &AL_PostAmp, CVAR_INT, 0, 3 },
{ "mus_al_stereo", "enable/disable OPL3 stereo mode", (void*) &AL_Stereo, CVAR_BOOL | CVAR_FUNCPTR, 0, 1 },
{ "mus_sf2_bank", "SoundFont 2 (.sf2) bank filename", (void*) SF2_BankFile, CVAR_STRING, 0, sizeof(SF2_BankFile) - 1 },
{ "mus_sf2_sampleblocksize", "number of samples per effect processing block", (void*) &SF2_EffectSampleBlockSize, CVAR_INT, 1, 64 },
#ifdef _WIN32
{ "mus_mme_device", "select Windows MME MIDI output device", (void*) &WinMM_DeviceID, CVAR_INT | CVAR_FUNCPTR, -1, WinMMDrv_MIDI_GetNumDevices()-1 },
#endif