1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:27:35 +00:00

Piano: Add track Volume and improve QOL

This patch implements a couple of enhancements to the synthesizer
engine:

* Each track has a volume control.
* The input and tooltips for all controls are improved.
* The noise channel is pitched, which allows for basic drum synthesis.
This commit is contained in:
kleines Filmröllchen 2021-04-21 20:32:21 +02:00 committed by Andreas Kling
parent 418bc484e4
commit d77e7e99e4
5 changed files with 87 additions and 39 deletions

View file

@ -29,7 +29,7 @@ constexpr int buffer_size = sample_count * sizeof(Sample);
constexpr double sample_rate = 44100;
constexpr double volume = 1800;
constexpr double volume_factor = 1800;
enum Switch {
Off,
@ -183,6 +183,14 @@ 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;
constexpr int notes_per_beat = 4;