Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
ProcessorSpectrumData.h
Go to the documentation of this file.
1/* Copyright (c) 2024-2025, Christian Ahrens
2 *
3 * This file is part of Mema <https://github.com/ChristianAhrens/Mema>
4 *
5 * This tool is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU Lesser General Public License version 3.0 as published
7 * by the Free Software Foundation.
8 *
9 * This tool is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 * details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this tool; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18#pragma once
19
21
22namespace Mema
23{
24
27{
28public:
31 {
32 enum {
33 count = 512
34 };
35
37 {
38 for (int i = 0; i < count; ++i)
39 {
40 bandsPeak[i] = 0.0f;
41 bandsHold[i] = 0.0f;
42 }
43
44 mindB = 0.0f;
45 maxdB = 0.0f;
46 minFreq = 20.0f;
47 maxFreq = 20000.0f;
49 };
50
53 float mindB;
54 float maxdB;
55 float minFreq;
56 float maxFreq;
57 float freqRes;
58 };
59
60public:
63
64 void SetSpectrum(unsigned long channel, SpectrumBands spectrum);
65 const SpectrumBands& GetSpectrum(unsigned long channel);
66
67 void SetChannelCount(unsigned long count) override;
68 unsigned long GetChannelCount() override;
69
70private:
71 std::map<unsigned long, SpectrumBands> m_spectrumsMap;
72
73};
74
75}
Base class for all data objects exchanged between the audio processor and its analyzers/visualisers.
void SetChannelCount(unsigned long count) override
Sets the number of audio channels this data object covers.
unsigned long GetChannelCount() override
Returns the number of audio channels this data object covers.
const SpectrumBands & GetSpectrum(unsigned long channel)
void SetSpectrum(unsigned long channel, SpectrumBands spectrum)
Definition Mema.cpp:27
FFT output for a single channel — 512 frequency bins with peak and hold values.