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

Piano: Add note names to RollWidget

This commit is contained in:
Peter Elliott 2020-10-10 14:06:36 -06:00 committed by Andreas Kling
parent 01bff0141e
commit 27b990ec19
2 changed files with 24 additions and 1 deletions

View file

@ -208,6 +208,21 @@ constexpr int beats_per_bar = 4;
constexpr int notes_per_beat = 4;
constexpr int roll_length = (sample_rate / (beats_per_minute / 60)) * beats_per_bar;
constexpr const char* note_names[] = {
"C",
"C#",
"D",
"D#",
"E",
"F",
"F#",
"G",
"G#",
"A",
"A#",
"B",
};
// Equal temperament, A = 440Hz
// We calculate note frequencies relative to A4:
// 440.0 * pow(pow(2.0, 1.0 / 12.0), N)