Revert "Add ability to set global note frequency scale"

This reverts commit de9c3c35b2.
This commit is contained in:
Agent X 2024-03-13 17:24:46 -04:00
parent 5c06085f7e
commit 58a3ed49f7
9 changed files with 1 additions and 103 deletions

View file

@ -8293,11 +8293,6 @@ function audio_stream_stop(audio)
-- ...
end
--- @return number
function smlua_audio_utils_get_note_freq_scale()
-- ...
end
--- @param sequenceId integer
--- @param bankId integer
--- @param defaultVolume integer
@ -8312,12 +8307,6 @@ function smlua_audio_utils_reset_all()
-- ...
end
--- @param freq number
--- @return nil
function smlua_audio_utils_set_note_freq_scale(freq)
-- ...
end
--- @param x number
--- @param y number
--- @param z number

View file

@ -7806,24 +7806,6 @@
<br />
## [smlua_audio_utils_get_note_freq_scale](#smlua_audio_utils_get_note_freq_scale)
### Lua Example
`local numberValue = smlua_audio_utils_get_note_freq_scale()`
### Parameters
- None
### Returns
- `number`
### C Prototype
`f32 smlua_audio_utils_get_note_freq_scale(void);`
[:arrow_up_small:](#)
<br />
## [smlua_audio_utils_replace_sequence](#smlua_audio_utils_replace_sequence)
### Lua Example
@ -7865,26 +7847,6 @@
<br />
## [smlua_audio_utils_set_note_freq_scale](#smlua_audio_utils_set_note_freq_scale)
### Lua Example
`smlua_audio_utils_set_note_freq_scale(freq)`
### Parameters
| Field | Type |
| ----- | ---- |
| freq | `number` |
### Returns
- None
### C Prototype
`void smlua_audio_utils_set_note_freq_scale(f32 freq);`
[:arrow_up_small:](#)
<br />
---
# functions from smlua_collision_utils.h

View file

@ -1550,10 +1550,8 @@
- [audio_stream_set_tempo](functions-4.md#audio_stream_set_tempo)
- [audio_stream_set_volume](functions-4.md#audio_stream_set_volume)
- [audio_stream_stop](functions-4.md#audio_stream_stop)
- [smlua_audio_utils_get_note_freq_scale](functions-4.md#smlua_audio_utils_get_note_freq_scale)
- [smlua_audio_utils_replace_sequence](functions-4.md#smlua_audio_utils_replace_sequence)
- [smlua_audio_utils_reset_all](functions-4.md#smlua_audio_utils_reset_all)
- [smlua_audio_utils_set_note_freq_scale](functions-4.md#smlua_audio_utils_set_note_freq_scale)
<br />

View file

@ -9,8 +9,6 @@
#include "effects.h"
#include "external.h"
f32 gNoteFreqScale = 1.0f;
void note_set_resampling_rate(struct Note *note, f32 resamplingRateInput);
#if defined(VERSION_EU) || defined(VERSION_SH)
@ -600,7 +598,7 @@ void process_notes(void) {
frequency = (frequency < cap ? frequency : cap);
scale *= 4.3498e-5f; // ~1 / 23000
velocity = velocity * scale * scale;
note_set_frequency(note, frequency * gNoteFreqScale);
note_set_frequency(note, frequency);
note_set_vel_pan_reverb(note, velocity, pan, reverb);
continue;
}

View file

@ -16,8 +16,6 @@
#define NOTE_ALLOC_SEQ 4
#define NOTE_ALLOC_GLOBAL_FREELIST 8
extern f32 gNoteFreqScale;
void process_notes(void);
void seq_channel_layer_note_decay(struct SequenceChannelLayer *seqLayer);
void seq_channel_layer_note_release(struct SequenceChannelLayer *seqLayer);

View file

@ -27599,21 +27599,6 @@ int smlua_func_audio_stream_stop(lua_State* L) {
return 1;
}
int smlua_func_smlua_audio_utils_get_note_freq_scale(UNUSED lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 0) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_audio_utils_get_note_freq_scale", 0, top);
return 0;
}
lua_pushnumber(L, smlua_audio_utils_get_note_freq_scale());
return 1;
}
int smlua_func_smlua_audio_utils_replace_sequence(lua_State* L) {
if (L == NULL) { return 0; }
@ -27652,23 +27637,6 @@ int smlua_func_smlua_audio_utils_reset_all(UNUSED lua_State* L) {
return 1;
}
int smlua_func_smlua_audio_utils_set_note_freq_scale(lua_State* L) {
if (L == NULL) { return 0; }
int top = lua_gettop(L);
if (top != 1) {
LOG_LUA_LINE("Improper param count for '%s': Expected %u, Received %u", "smlua_audio_utils_set_note_freq_scale", 1, top);
return 0;
}
f32 freq = smlua_to_number(L, 1);
if (!gSmLuaConvertSuccess) { LOG_LUA("Failed to convert parameter %u for function '%s'", 1, "smlua_audio_utils_set_note_freq_scale"); return 0; }
smlua_audio_utils_set_note_freq_scale(freq);
return 1;
}
/////////////////////////////
// smlua_collision_utils.h //
/////////////////////////////
@ -32958,10 +32926,8 @@ void smlua_bind_functions_autogen(void) {
smlua_bind_function(L, "audio_stream_set_tempo", smlua_func_audio_stream_set_tempo);
smlua_bind_function(L, "audio_stream_set_volume", smlua_func_audio_stream_set_volume);
smlua_bind_function(L, "audio_stream_stop", smlua_func_audio_stream_stop);
smlua_bind_function(L, "smlua_audio_utils_get_note_freq_scale", smlua_func_smlua_audio_utils_get_note_freq_scale);
smlua_bind_function(L, "smlua_audio_utils_replace_sequence", smlua_func_smlua_audio_utils_replace_sequence);
smlua_bind_function(L, "smlua_audio_utils_reset_all", smlua_func_smlua_audio_utils_reset_all);
smlua_bind_function(L, "smlua_audio_utils_set_note_freq_scale", smlua_func_smlua_audio_utils_set_note_freq_scale);
// smlua_collision_utils.h
smlua_bind_function(L, "collision_find_ceil", smlua_func_collision_find_ceil);

View file

@ -1,7 +1,6 @@
#include "types.h"
#include "seq_ids.h"
#include "audio/external.h"
#include "audio/playback.h"
#include "game/camera.h"
#include "engine/math_util.h"
#include "pc/mods/mods.h"
@ -145,14 +144,6 @@ void smlua_audio_utils_replace_sequence(u8 sequenceId, u8 bankId, u8 defaultVolu
LOG_LUA_LINE("Could not find m64 at path: %s", m64path);
}
f32 smlua_audio_utils_get_note_freq_scale(void) {
return gNoteFreqScale;
}
void smlua_audio_utils_set_note_freq_scale(f32 freq) {
gNoteFreqScale = freq;
}
//////////
// bass //
//////////

View file

@ -6,8 +6,6 @@
void smlua_audio_utils_reset_all(void);
bool smlua_audio_utils_override(u8 sequenceId, s32* bankId, void** seqData);
void smlua_audio_utils_replace_sequence(u8 sequenceId, u8 bankId, u8 defaultVolume, const char* m64Name);
f32 smlua_audio_utils_get_note_freq_scale(void);
void smlua_audio_utils_set_note_freq_scale(f32 freq);
//////////
// bass //

View file

@ -29,7 +29,6 @@
#include "menu/intro_geo.h"
#include "game/ingame_menu.h"
#include "game/first_person_cam.h"
#include "audio/playback.h"
#ifdef DISCORD_SDK
#include "pc/discord/discord.h"
@ -699,7 +698,6 @@ void network_shutdown(bool sendLeaving, bool exiting, bool popup, bool reconnect
gOverrideDialogColor = 0;
gDialogMinWidth = 0;
gOverrideAllowToxicGasCamera = FALSE;
gNoteFreqScale = 1.0f;
struct Controller* cnt = gPlayer1Controller;
cnt->rawStickX = 0;