gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

controllermap.h (890B)


      1 #pragma once
      2 
      3 #include <cstdint>
      4 #include <unordered_map>
      5 #include <vector>
      6 
      7 #include "parameter.h"
      8 #include "synthLib/midiTypes.h"
      9 
     10 namespace pluginLib
     11 {
     12 	class ControllerMap
     13 	{
     14 	public:
     15 		void add(synthLib::MidiStatusByte _midiStatusByte, uint8_t _cc, uint32_t _paramIndex);
     16 
     17 		const std::vector<uint32_t>& getControlledParameters(const synthLib::SMidiEvent& _ev) const;
     18 		std::vector<uint8_t> getControlChanges(synthLib::MidiStatusByte _midiStatusByte, uint32_t _paramIndex) const;
     19 
     20 	private:
     21 		std::unordered_map<uint8_t, std::unordered_map<uint8_t, std::vector<uint32_t>>> m_ccToParamIndex;	// type (control change, poly pressure) => index (modwheel, main vol, ...) => parameter index
     22 		std::unordered_map<uint8_t, std::unordered_map<uint32_t, std::vector<uint8_t>>> m_paramIndexToCC;	// type (control change, poly pressure) => parameter index => index (modwheel, main vol, ...)
     23 	};
     24 }