PicoWaveTracker/TrackerTypes.h
2026-03-07 21:31:17 +01:00

68 lines
1.3 KiB
C

#ifndef TRACKER_TYPES_H
#define TRACKER_TYPES_H
#include <stdint.h>
#include "config.h"
struct Step {
int8_t note; // MIDI Note (0-127), -1 for OFF
bool accent;
bool tie;
};
struct ChordStep {
int8_t rootOffset; // Semitones relative to key
int8_t scaleType; // Scale type index
uint8_t repeats; // Number of repetitions
};
#define MAX_PROG_STEPS 12
struct ChordProgression {
const char* name;
int length;
ChordStep steps[MAX_PROG_STEPS]; // Max 12 steps
};
enum ProgressionOrder {
PROG_ORDER_SEQUENCE,
PROG_ORDER_RANDOM
};
enum PlayMode {
MODE_MONO,
MODE_POLY
};
enum UIState {
UI_MENU_MAIN,
UI_SETUP_CHANNEL_EDIT,
UI_EDIT_TEMPO,
UI_EDIT_STEPS,
UI_EDIT_FLAVOUR,
UI_EDIT_INTENSITY,
UI_EDIT_CHANCE,
UI_SETUP_PLAYMODE_EDIT,
UI_RANDOMIZE_TRACK_EDIT,
UI_EDIT_ROOT,
UI_EDIT_PROG_ORDER,
UI_EDIT_PROG_TEMPLATE,
UI_EDIT_PROG_LENGTH,
UI_EDIT_PROG_STEP_ROOT,
UI_EDIT_PROG_STEP_TYPE,
UI_EDIT_PROG_STEP_REPS
};
inline void sortArray(int arr[], int size) {
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
int temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
}
}
}
}
#endif