mirror of
https://codeberg.org/armin/monostep.git
synced 2026-09-01 04:10:46 +02:00
Prototype
This commit is contained in:
parent
c117906a7f
commit
4271fc34bb
14 changed files with 950 additions and 169 deletions
|
|
@ -17,6 +17,7 @@ struct Step
|
|||
int semitone = 0; // -12 .. +12
|
||||
float cents = 0.0f; // -50 .. +50
|
||||
bool slide = false;
|
||||
bool accent = false;
|
||||
};
|
||||
|
||||
class StepSequencer
|
||||
|
|
@ -31,6 +32,20 @@ public:
|
|||
s = Step{};
|
||||
}
|
||||
|
||||
void shift (int dir)
|
||||
{
|
||||
if (dir == 0)
|
||||
return;
|
||||
|
||||
std::array<Step, numSteps> rotated = steps;
|
||||
|
||||
for (int i = 0; i < numSteps; ++i)
|
||||
{
|
||||
const int from = (i - dir + numSteps) % numSteps;
|
||||
steps[i] = rotated[from];
|
||||
}
|
||||
}
|
||||
|
||||
int stepsPerBeatFromRate (int rateIndex) const
|
||||
{
|
||||
// 0: 1/4, 1: 1/8, 2: 1/8T, 3: 1/16, 4: 1/32
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue