diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-03 07:39:54 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-03 07:39:54 +0100 |
| commit | 5fc0517ffed67411ce5ca529742a2142acc2b5dc (patch) | |
| tree | 262c18c8f66be6878ef431b9c3ecab29ee522824 /src/main.cc | |
| parent | 4174f84f6b505d57dcf37847f0338724568d49f1 (diff) | |
feat: Finalize tracker asset-sample integration with unified pasting strategy
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/main.cc b/src/main.cc index 97732da..7114460 100644 --- a/src/main.cc +++ b/src/main.cc @@ -19,30 +19,6 @@ #define SPEC_FRAMES 16 -struct SpecHeader { - char magic[4]; - int32_t version; - int32_t dct_size; - int32_t num_frames; -}; - -int register_spec_asset(AssetId id) { - size_t size; - const uint8_t* data = GetAsset(id, &size); - if (!data || size < sizeof(SpecHeader)) - return -1; - - const SpecHeader* header = (const SpecHeader*)data; - const float* spectral_data = (const float*)(data + sizeof(SpecHeader)); - - Spectrogram spec; - spec.spectral_data_a = spectral_data; - spec.spectral_data_b = spectral_data; // No double-buffer for static assets - spec.num_frames = header->num_frames; - - return synth_register_spectrogram(&spec); -} - static float* g_spec_buffer_a[SPEC_FRAMES * DCT_SIZE] = {0}; static float* g_spec_buffer_b[SPEC_FRAMES * DCT_SIZE] = {0}; @@ -107,10 +83,6 @@ int main(int argc, char** argv) { synth_init(); tracker_init(); - int kick_id = register_spec_asset(AssetId::ASSET_KICK_1); - int snare_id = register_spec_asset(AssetId::ASSET_SNARE_1); - int hihat_id = register_spec_asset(AssetId::ASSET_HIHAT_1); - // Still keep the dynamic tone for bass (can be integrated into tracker too) const float* g_spec_buffer_a = generate_tone(nullptr, 110.0f); // A2 const float* g_spec_buffer_b = generate_tone(nullptr, 110.0f); @@ -130,21 +102,6 @@ int main(int argc, char** argv) { const int step = beat_count % 16; - // Kick on 1, 9, 11, 14... - if (step == 0 || step == 8 || step == 10 || step == 13) { - synth_trigger_voice(kick_id, 0.6f, 0.0f); - } - - // Snare on 4, 12 - if (step == 4 || step == 12) { - synth_trigger_voice(snare_id, 0.48f, step & 8 ? -1.0f : 1.0f); - } - - // Hihat on every offbeat - if (step % 2 == 1) { - synth_trigger_voice(hihat_id, 0.3f, 0.3f); - } - // Bass pattern if (step % 4 == 0) { float* back_buffer = synth_begin_update(bass_id); |
