Commit 175e7134 authored by Erik Faye-Lund's avatar Erik Faye-Lund
Browse files

rename SAMPLERATE to PIMP_SAMPLERATE


Signed-off-by: default avatarErik Faye-Lund <kusmabite@gmail.com>
parent d4c29627
......@@ -11,8 +11,8 @@
/* check the sample-rate calculator at http://www.pineight.com/gba/samplerates/ for more glitch-free samplerates */
/* 0x4000100 = 0xFFFF, 0x4000102 = 0x0083 */
#define SAMPLERATE (18157.16)
/* #define SAMPLERATE (31536.12) */
#define PIMP_SAMPLERATE (18157.16)
/* #define PIMP_SAMPLERATE (31536.12) */
/* enable / disable assert */
/* #define DEBUG_PRINT_ENABLE */
......
......@@ -21,7 +21,7 @@ static struct pimp_mod_context pimp_gba_ctx EWRAM_DATA;
/* setup some constants */
#define CYCLES_PR_FRAME 280896
#define CYCLES_PR_SAMPLE ((int)((1 << 24) / ((float)SAMPLERATE)))
#define CYCLES_PR_SAMPLE ((int)((1 << 24) / ((float)PIMP_SAMPLERATE)))
#define SOUND_BUFFER_SIZE ((int)((float)CYCLES_PR_FRAME / CYCLES_PR_SAMPLE))
/* mix and playback-buffers */
......
......@@ -46,7 +46,7 @@ unsigned pimp_get_linear_period(int note, int fine_tune)
#include "linear_delta_lut.h"
unsigned pimp_get_linear_delta(unsigned period)
{
const unsigned int scale = (unsigned int)((1.0 / (SAMPLERATE)) * (1 << 3) * (1ULL << 32));
const unsigned int scale = (unsigned int)((1.0 / (PIMP_SAMPLERATE)) * (1 << 3) * (1ULL << 32));
unsigned p = (12 * 16 * 4 * 14) - period;
unsigned octave = p / (12 * 16 * 4);
......@@ -94,7 +94,7 @@ unsigned pimp_get_amiga_period(int note, int fine_tune)
#define AMIGA_DELTA_LUT_FRAC_BITS (15 - AMIGA_DELTA_LUT_LOG2_SIZE)
unsigned pimp_get_amiga_delta(unsigned period)
{
const unsigned int scale = (unsigned int)(((1.0 / (SAMPLERATE)) * (1 << 6)) * (1LL << 32));
const unsigned int scale = (unsigned int)(((1.0 / (PIMP_SAMPLERATE)) * (1 << 6)) * (1LL << 32));
int d1, d2;
unsigned int delta;
......
......@@ -142,7 +142,7 @@ void pimp_mod_context_set_next_pos(struct pimp_mod_context *ctx, int row, int or
void pimp_mod_context_set_bpm(struct pimp_mod_context *ctx, int bpm)
{
/* we're using 8 fractional-bits for the tick-length */
const int temp = (int)(((SAMPLERATE) * 5) * (1 << 8));
const int temp = (int)(((PIMP_SAMPLERATE) * 5) * (1 << 8));
ASSERT(ctx != NULL);
ASSERT(bpm > 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment