mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 02:37:35 +00:00
Piano: Move to LibDSP's Classic synthesizer
Almost all synthesizer code in Piano is removed in favor of the LibDSP reimplementation. This causes some issues that mainly have to do with the way Piano currently handles talking to LibDSP. Additionally, the sampler is gone for now and will be reintroduced with future work.
This commit is contained in:
parent
3ca059da2d
commit
b14a64b3c8
14 changed files with 128 additions and 464 deletions
|
@ -38,48 +38,11 @@ enum Switch {
|
|||
On,
|
||||
};
|
||||
|
||||
struct RollNote {
|
||||
u32 length() const { return (off_sample - on_sample) + 1; }
|
||||
|
||||
u32 on_sample;
|
||||
u32 off_sample;
|
||||
u8 pitch;
|
||||
i8 velocity;
|
||||
};
|
||||
|
||||
enum Direction {
|
||||
Down,
|
||||
Up,
|
||||
};
|
||||
|
||||
enum Wave {
|
||||
Sine,
|
||||
Triangle,
|
||||
Square,
|
||||
Saw,
|
||||
Noise,
|
||||
RecordedSample,
|
||||
};
|
||||
|
||||
constexpr const char* wave_strings[] = {
|
||||
"Sine",
|
||||
"Triangle",
|
||||
"Square",
|
||||
"Saw",
|
||||
"Noise",
|
||||
"Frame",
|
||||
};
|
||||
|
||||
constexpr int first_wave = Sine;
|
||||
constexpr int last_wave = RecordedSample;
|
||||
|
||||
enum Envelope {
|
||||
Done,
|
||||
Attack,
|
||||
Decay,
|
||||
Release,
|
||||
};
|
||||
|
||||
enum KeyColor {
|
||||
White,
|
||||
Black,
|
||||
|
@ -142,6 +105,9 @@ const Color left_wave_colors[] = {
|
|||
},
|
||||
};
|
||||
|
||||
// HACK: make the display code shut up for now
|
||||
constexpr int RecordedSample = 5;
|
||||
|
||||
const Color right_wave_colors[] = {
|
||||
// Sine
|
||||
{
|
||||
|
@ -187,13 +153,7 @@ constexpr int black_keys_per_octave = 5;
|
|||
constexpr int octave_min = 1;
|
||||
constexpr int octave_max = 7;
|
||||
|
||||
// These values represent the user-side bounds, the application may use a different scale.
|
||||
constexpr int attack_max = 1000;
|
||||
constexpr int decay_max = 1000;
|
||||
constexpr int sustain_max = 1000;
|
||||
constexpr int release_max = 1000;
|
||||
constexpr int volume_max = 1000;
|
||||
constexpr int delay_max = 8;
|
||||
|
||||
constexpr double beats_per_minute = 60;
|
||||
constexpr int beats_per_bar = 4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue