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

LibDSP: Make the note frequencies an AK::Array instead of a C array

This was a leftover from the early days of Piano, and there's no reason
to leave it that way especially if we want to use more complex
collection APIs in the future.
This commit is contained in:
kleines Filmröllchen 2022-05-11 21:59:49 +02:00 committed by Linus Groh
parent bcb331b862
commit f23aea0c4b
5 changed files with 6 additions and 7 deletions

View file

@ -84,7 +84,7 @@ struct Signal : public Variant<Sample, RollNotes> {
// We calculate note frequencies relative to A4:
// 440.0 * pow(pow(2.0, 1.0 / 12.0), N)
// Where N is the note distance from A.
constexpr double note_frequencies[] = {
constexpr Array<double, 84> note_frequencies = {
// Octave 1
32.703195662574764,
34.647828872108946,
@ -177,7 +177,6 @@ constexpr double note_frequencies[] = {
3729.3100921447249,
3951.0664100489994,
};
constexpr size_t const note_count = array_size(note_frequencies);
constexpr double const middle_c = note_frequencies[36];