portemento, adsr
This commit is contained in:
46
Source/shifter_voice.h
Normal file
46
Source/shifter_voice.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
shifter_voice.h
|
||||
Created: 25 Oct 2025 2:09:42pm
|
||||
Author: mickl
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "adsr.h"
|
||||
#include "port.h"
|
||||
#include "math.h"
|
||||
#include <juce_core/juce_core.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
class ShifterVoice {
|
||||
public:
|
||||
ShifterVoice() {}
|
||||
~ShifterVoice() {}
|
||||
void Init(float sample_rate);
|
||||
bool IsActive();
|
||||
void Trigger(int midi_note);
|
||||
void Release();
|
||||
void Process();
|
||||
float CurrentAmplitude();
|
||||
float CurrentPeriod();
|
||||
bool PeriodOverflow();
|
||||
void SetPortamentoTime(float time);
|
||||
void SetAdsrTimes(float attack, float decay, float release);
|
||||
float GetPanning(int channel) const;
|
||||
int GetMidiNote() const { return current_midi; }
|
||||
|
||||
private:
|
||||
Port portamento_;
|
||||
Adsr amplitude_envelope_;
|
||||
bool onoff_;
|
||||
bool overflow_;
|
||||
int current_midi;
|
||||
float current_period_;
|
||||
float current_amplitude;
|
||||
float period_counter;
|
||||
float panning;
|
||||
};
|
||||
Reference in New Issue
Block a user