Skip to content

Commit 3d87c7b

Browse files
committed
add set engine rate command
1 parent 501fd1e commit 3d87c7b

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"files.associations": {
3+
"tracker_engine.h": "c"
4+
}
5+
}

tracker_engine/do_effects.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "../sound_engine/sound_engine_filter.h"
66
#include "tracker_engine.h"
77

8+
#include "../flizzer_tracker_hal.h"
9+
810
void do_command(
911
uint16_t opcode,
1012
TrackerEngine* tracker_engine,
@@ -427,6 +429,14 @@ void do_command(
427429
break;
428430
}
429431

432+
case TE_EFFECT_SET_RATE: {
433+
if(tick == 0 && (opcode & 0xff) > 0) {
434+
tracker_engine_set_rate(opcode & 0xff);
435+
}
436+
437+
break;
438+
}
439+
430440
case TE_EFFECT_PORTA_UP_SEMITONE: {
431441
uint32_t prev = te_channel->note;
432442

tracker_engine/tracker_engine_defs.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ typedef enum {
9090
TE_EFFECT_SET_SUSTAIN = 0x1700, // Nxx
9191
TE_EFFECT_SET_RELEASE = 0x1800, // Oxx
9292
TE_EFFECT_PROGRAM_RESTART = 0x1900, // Pxx
93-
/*
94-
TE_EFFECT_ = 0x1a00, //Qxx
95-
*/
93+
94+
TE_EFFECT_SET_RATE = 0x1a00, //Qxx
9695

9796
TE_EFFECT_SET_RING_MOD_SRC = 0x1b00, // Rxx
9897
TE_EFFECT_SET_HARD_SYNC_SRC = 0x1c00, // Sxx

view/opcode_description.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static const OpcodeDescription opcode_desc[] = {
5151
{TE_EFFECT_SET_SUSTAIN, 0x7f00, "SET ENVELOPE SUSTAIN", "ADSR S"},
5252
{TE_EFFECT_SET_RELEASE, 0x7f00, "SET ENVELOPE RELEASE", "ADSR R"},
5353
{TE_EFFECT_PROGRAM_RESTART, 0x7f00, "RESTART INSTRUMENT PROGRAM", "P.RES."},
54+
{TE_EFFECT_SET_RATE, 0x7f00, "SET TRACKER ENGINE RATE (HZ)", "E.RATE"},
5455
{TE_EFFECT_SET_RING_MOD_SRC, 0x7f00, "SET RING MODULATION SOURCE CH.", "R.SRC"},
5556
{TE_EFFECT_SET_HARD_SYNC_SRC, 0x7f00, "SET HARD SYNC SOURCE CHANNEL", "S.SRC"},
5657
{TE_EFFECT_PORTA_UP_SEMITONE, 0x7f00, "PORTAMENTO UP (SEMITONES)", "PU.SEM"},

0 commit comments

Comments
 (0)