Offset octave ranges

This commit is contained in:
Joseph DiMaria 2026-01-31 17:24:26 -08:00
parent 8217bc1ec2
commit 1e2a709fe8

View File

@ -16,6 +16,7 @@ namespace
{
constexpr int LANE_COUNT = 12;
constexpr int OCTAVE_COUNT = 3;
constexpr int OCTAVE_OFFSET = 48;
constexpr int MAX_GAMEPADS = 4;
constexpr int MAX_INSTRUMENT_TYPES = MAX_GAMEPADS;
constexpr float RECEPTOR_HEIGHT = 150.0f;
@ -258,7 +259,10 @@ std::vector<Glyph> chart_from_song(const Song& song, int track_override)
float time_sec = note.ticks / ticks_per_sec; // This is now the BOTTOM time
float duration_sec = note.duration_ticks / ticks_per_sec;
int lane = note.midi % LANE_COUNT;
int octave = note.midi % (LANE_COUNT * OCTAVE_COUNT);
int offset = 0;
if (note.midi >= OCTAVE_OFFSET)
offset = OCTAVE_OFFSET;
int octave = (note.midi - offset) % (LANE_COUNT * OCTAVE_COUNT);
int instrument_slot = note_index % MAX_INSTRUMENT_TYPES;
// Log original glyph timing (time is bottom, time + duration is top)