Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f3ff5cf
re-enables PC messages on change, when the player is running
n1LS Jan 29, 2026
06715ff
Merge branch 'master' of https://github.com/n1LS/picoTracker
n1LS Jan 29, 2026
eb7c2e2
Merge branch 'master' of https://github.com/n1LS/picoTracker
n1LS Jan 30, 2026
71b38f8
adds vibrato command
n1LS Feb 2, 2026
da480d6
Merge branch 'master' of https://github.com/n1LS/picoTracker
n1LS Feb 3, 2026
e5a443d
Merge branch 'xiphonics:master' into 627-vibrato
n1LS Feb 4, 2026
06521e3
adds VIBrato command support to the SampleInstrument
n1LS Feb 4, 2026
053f1f9
Merge branch '627-vibrato' of https://github.com/n1LS/picoTracker int…
n1LS Feb 4, 2026
1ac8d5f
Merge branch 'master' of https://github.com/n1LS/picoTracker
n1LS Feb 5, 2026
697f305
Merge branch 'master' of https://github.com/n1LS/picoTracker
n1LS Feb 10, 2026
4024e20
Merge remote-tracking branch 'upstream/master'
n1LS Feb 16, 2026
4a09c94
Merge remote-tracking branch 'upstream/master'
n1LS Feb 27, 2026
2b9006f
Merge remote-tracking branch 'upstream/master'
n1LS Mar 5, 2026
b4aa0e5
cleans up alt+play/enter handling, adds support to go up directories
n1LS Mar 9, 2026
ed736c3
Merge remote-tracking branch 'upstream/master'
n1LS Mar 12, 2026
9cd101d
fixes various character issues
n1LS Mar 12, 2026
164e453
Merge branch 'xiphonics:master' into master
n1LS Mar 19, 2026
7ff837b
Merge branch 'master' of https://github.com/n1LS/picoTracker
n1LS Mar 23, 2026
b3ff955
merges upstream/master
n1LS Mar 23, 2026
fb01c2c
Merge branch 'xiphonics:master' into master
n1LS Apr 8, 2026
ddb4016
adds vibrato command
n1LS Feb 2, 2026
0154e52
adds VIBrato command support to the SampleInstrument
n1LS Feb 4, 2026
aa7ae4a
Merge branch '627-vibrato' of https://github.com/n1LS/picoTracker int…
n1LS Apr 8, 2026
d6cdc01
expands 64 step lut to 256 steps
n1LS Apr 9, 2026
c33255b
adds reset on Start()
n1LS Apr 9, 2026
1a5060d
removes superflouos vibrato reset
n1LS Apr 10, 2026
6d8ad45
Merge remote-tracking branch 'upstream/master'
n1LS Apr 13, 2026
ef6e803
merging upstream
n1LS Apr 13, 2026
6310bb7
Merge branch 'master' into 627-vibrato
n1LS Apr 13, 2026
bcca409
adds help text to documentation and removes ticking from table to kee…
n1LS Apr 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sources/Application/Instruments/CommandList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ static FourCC _all[] = {
FourCC::InstrumentCommandTable,
FourCC::InstrumentCommandTempo,
FourCC::InstrumentCommandVelocity,
FourCC::InstrumentCommandVibrato,
FourCC::InstrumentCommandVolume,
};

Expand Down
33 changes: 33 additions & 0 deletions sources/Application/Instruments/SRPUpdaters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
*/

#include "SRPUpdaters.h"
#include "Foundation/Constants/SineTable.h"
#include "System/Console/Trace.h"
#include <math.h>

//
// Volume Ramp
//
Expand Down Expand Up @@ -298,3 +300,34 @@ void Arp::UpdateSRP(struct RUParams &rup) {
return;
rup.speedOffset_ = fp_mul(rup.speedOffset_, current_);
};

//
// Vibrato
//

void Vibrato::SetData(uint8_t rate, uint8_t depth) {
// lower 8 bits: depth, upper 8 bits: speed
depth_ = depth;
rate_ = 1 + (rate << 4);

// reset output and phase
phase_ = 0;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having reset here is likely to cause issues with cmd usage in a table, so we really want phase reset to be separate and do the phase reset only when a vibrato cmd first starts

Copy link
Copy Markdown
Contributor Author

@n1LS n1LS Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maks I moved the vibrato reset to Start() so that a vibrato always starts at 0 without any jump in frequency. A second reset might helpful when calling ARP 0000 so that a later arp command cannot start with a jump in the frequency. What are your thoughts on that?

current_ = FP_ONE;
};

void Vibrato::Trigger(bool tableTick) {
if (!enabled_)
return;

// step the lfo phase
phase_ += rate_;
// sine is i16, depth u8 -> 23 bit value, shifted down by 10 bits gives a
// range of 13 bits (~±0.26 -> four semitones)
current_ = FP_ONE + ((sine_i16_interpolated_64(phase_) * depth_) >> 10);
};

void Vibrato::UpdateSRP(struct RUParams &rup) {
if (!enabled_)
return;
rup.speedOffset_ = fp_mul(rup.speedOffset_, current_);
}
21 changes: 13 additions & 8 deletions sources/Application/Instruments/SRPUpdaters.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,19 @@ class Panner : public I_SRPUpdater {
fixed speed_;
};

/*class Vibrato: public I_SRPUpdater {
class Vibrato : public I_SRPUpdater {
public:
Vibrato() {} ;
virtual ~Vibrato() {} ;
void SetData() ;
virtual void Trigger(bool tableTick) ;
virtual void UpdateSRP(struct RUParams &rup) ;
Vibrato(){};
virtual ~Vibrato(){};
void SetData(uint8_t rate, uint8_t depth);
virtual void Trigger(bool tableTick);
virtual void UpdateSRP(struct RUParams &rup);

private:
} ;
*/
fixed current_;
uint8_t depth_;
uint16_t phase_;
uint16_t rate_;
};

#endif
15 changes: 14 additions & 1 deletion sources/Application/Instruments/SampleInstrument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "SampleInstrument.h"
#include "Application/Instruments/Filters.h"
#include "Application/Model/Table.h"
#include "Application/Player/PlayerMixer.h" // For MIX_BUFFER_SIZE.. kick out pls
#include "Application/Player/SyncMaster.h"
#include "Application/Utils/fixed.h"
#include "CommandList.h"
#include "Foundation/Constants/SineTable.h"
#include "SamplePool.h"
#include "SampleVariable.h"
#include "Services/Audio/Audio.h"
Expand Down Expand Up @@ -1433,6 +1433,19 @@ void SampleInstrument::ProcessCommand(int channel, FourCC cc, ushort value) {
if (crush > 0)
rp->crush_ = crush;
}

case FourCC::InstrumentCommandVibrato: {
uint8_t rate = value >> 8;
uint8_t depth = value & 0xFF;
// setup the vibrato
rp->vibrato_.SetData(rate, depth);
if (!rp->vibrato_.Enabled()) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely not going to work well with VIB cmds in tables combined with phrases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem to cause any issues when applying a bunch of Vibrato commands from both tables and phrases simultaneously. What issue are you referring to?

// enable and add to active updaters
rp->vibrato_.Enable();
rp->activeUpdaters_.push_back(&rp->vibrato_);
}
} break;

default:
break;
};
Expand Down
1 change: 1 addition & 0 deletions sources/Application/Instruments/SampleRenderingParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ struct renderParams {
LogSpeedRamp legato_;
LogSpeedRamp pfin_;
Arp arp_;
Vibrato vibrato_;

bool couldClick_;

Expand Down
4 changes: 4 additions & 0 deletions sources/Application/Utils/HelpLegend.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ static char **getHelpLegend(FourCC command) {
result[0] = (char *)("MIDI Chord:abcd");
result[1] = (char *)("send rel notes:+a,+b,+c,+d");
break;
case FourCC::InstrumentCommandVibrato:
result[0] = (char *)("VIBrato:aabb");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not enough for this to be added to the onscreen help, it needs to be properly documented in both editions of the user manual.

result[1] = (char *)("rate aa, depth bb");
break;
default:
result[0] = result[1] = (char *)("");
break;
Expand Down
36 changes: 36 additions & 0 deletions sources/Foundation/Constants/SineTable.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 2026 xiphonics, inc.
*
* This file is part of the picoTracker firmware
*/

#pragma once

// 64-step (+ sentinel) sine wave lookup table (full cycle)
// sin(2 * pi * index / 64) * 32767
constexpr int16_t sine_i16_64[65] = {
Comment thread
n1LS marked this conversation as resolved.
Outdated
0, 3212, 6393, 9512, 12539, 15446, 18204, 20787, 23170,
25329, 27245, 28898, 30273, 31356, 32137, 32609, 32767, 32609,
32137, 31356, 30273, 28898, 27245, 25329, 23170, 20787, 18204,
15446, 12539, 9512, 6393, 3212, 0, -3212, -6393, -9512,
-12539, -15446, -18204, -20787, -23170, -25329, -27245, -28898, -30273,
-31356, -32137, -32609, -32767, -32609, -32137, -31356, -30273, -28898,
-27245, -25329, -23170, -20787, -18204, -15446, -12539, -9512, -6393,
-3212, 0,
};

// 16bit interpolation for 64-step sine table
static inline int32_t sine_i16_interpolated_64(uint16_t phase) {
// index into the table (top 6 bits) and fractional part (lower 10 bits)
uint8_t index = phase >> 10; // 0..63
int32_t frac = phase & 0x03FF; // 0..1023

// fetch table values
int32_t a = sine_i16_64[index];
int32_t b = sine_i16_64[index + 1];

// a + ((b - a) * frac) / 1024
return a + (((b - a) * frac) >> 10);
}
2 changes: 2 additions & 0 deletions sources/Foundation/Types/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ struct FourCC {
InstrumentCommandVolume = 69, // VOLM
InstrumentCommandNone = 45, // ----
InstrumentCommandMidiChord = 143,
InstrumentCommandVibrato = 73,

SampleInstrumentCrushVolume = 3,
SampleInstrumentVolume = 19,
Expand Down Expand Up @@ -292,6 +293,7 @@ struct FourCC {
ETL_ENUM_TYPE(InstrumentCommandDelay, "DLY")
ETL_ENUM_TYPE(InstrumentCommandInstrumentRetrigger, "IRT")
ETL_ENUM_TYPE(InstrumentCommandMidiChord, "MCH")
ETL_ENUM_TYPE(InstrumentCommandVibrato, "VIB")

ETL_ENUM_TYPE(VarLineOut, "LINEOUT")
ETL_ENUM_TYPE(VarMidiDevice, "MIDIDEVICE")
Expand Down