Inbetween states. Midi nodes and config nodes use same interface now.

This commit is contained in:
Sebastian
2024-12-07 22:09:06 +01:00
parent 3b0e7e986f
commit d9c97be326
5 changed files with 341 additions and 84 deletions
+195
View File
@@ -1,5 +1,6 @@
#pragma once
#include <filesystem>
#ifdef _WIN32
#define _USE_MATH_DEFINES
#endif
@@ -86,6 +87,200 @@ namespace VISEQ::MIDI{
int number;
};
inline MidiNote operator+(const MidiNote left, const MidiNote right){
MidiNote added;
added.note = left.note + right.note;
added.channel = left.channel + right.channel;
added.gate = left.gate + right.gate;
added.velocity = left.velocity + right.velocity;
return added;
}
inline MidiCC operator+(const MidiCC left, const MidiCC right){
MidiCC added;
added.channel = left.channel + right.channel;
added.control = left.control + right.control;
added.value = left.value+ right.value;
return added;
}
inline MidiPC operator+(const MidiPC left, const MidiPC right){
MidiPC added;
added.channel = left.channel + right.channel;
added.program = left.program + right.program;
added.value = left.value+ right.value;
return added;
}
inline MidiPitchBend operator+(const MidiPitchBend left, const MidiPitchBend right){
MidiPitchBend added;
added.channel = left.channel + right.channel;
added.value = left.value+ right.value;
return added;
}
inline MidiAftertouch operator+(const MidiAftertouch left, const MidiAftertouch right){
MidiAftertouch added;
added.channel = left.channel + right.channel;
added.value = left.value+ right.value;
return added;
}
inline MidiPolyPressure operator+(const MidiPolyPressure left, const MidiPolyPressure right){
MidiPolyPressure added;
added.channel = left.channel + right.channel;
added.note = left.note + right.note;
added.value = left.value+ right.value;
return added;
}
inline MidiNote operator-(const MidiNote left, const MidiNote right){
MidiNote added;
added.note = left.note - right.note;
added.channel = left.channel - right.channel;
added.gate = left.gate - right.gate;
added.velocity = left.velocity - right.velocity;
return added;
}
inline MidiCC operator-(const MidiCC left, const MidiCC right){
MidiCC added;
added.channel = left.channel - right.channel;
added.control = left.control - right.control;
added.value = left.value- right.value;
return added;
}
inline MidiPC operator-(const MidiPC left, const MidiPC right){
MidiPC added;
added.channel = left.channel - right.channel;
added.program = left.program - right.program;
added.value = left.value- right.value;
return added;
}
inline MidiPitchBend operator-(const MidiPitchBend left, const MidiPitchBend right){
MidiPitchBend added;
added.channel = left.channel - right.channel;
added.value = left.value- right.value;
return added;
}
inline MidiAftertouch operator-(const MidiAftertouch left, const MidiAftertouch right){
MidiAftertouch added;
added.channel = left.channel - right.channel;
added.value = left.value- right.value;
return added;
}
inline MidiPolyPressure operator-(const MidiPolyPressure left, const MidiPolyPressure right){
MidiPolyPressure added;
added.channel = left.channel - right.channel;
added.note = left.note - right.note;
added.value = left.value- right.value;
return added;
}
// UNARY
inline MidiNote operator+=(const MidiNote left, const MidiNote right){
MidiNote added;
added.note = left.note + right.note;
added.channel = left.channel + right.channel;
added.gate = left.gate + right.gate;
added.velocity = left.velocity + right.velocity;
return added;
}
inline MidiCC operator+=(const MidiCC left, const MidiCC right){
MidiCC added;
added.channel = left.channel + right.channel;
added.control = left.control + right.control;
added.value = left.value+ right.value;
return added;
}
inline MidiPC operator+=(const MidiPC left, const MidiPC right){
MidiPC added;
added.channel = left.channel + right.channel;
added.program = left.program + right.program;
added.value = left.value+ right.value;
return added;
}
inline MidiPitchBend operator+=(const MidiPitchBend left, const MidiPitchBend right){
MidiPitchBend added;
added.channel = left.channel + right.channel;
added.value = left.value+ right.value;
return added;
}
inline MidiAftertouch operator+=(const MidiAftertouch left, const MidiAftertouch right){
MidiAftertouch added;
added.channel = left.channel + right.channel;
added.value = left.value+ right.value;
return added;
}
inline MidiPolyPressure operator+=(const MidiPolyPressure left, const MidiPolyPressure right){
MidiPolyPressure added;
added.channel = left.channel + right.channel;
added.note = left.note + right.note;
added.value = left.value+ right.value;
return added;
}
inline MidiNote operator-=(const MidiNote left, const MidiNote right){
MidiNote added;
added.note = left.note - right.note;
added.channel = left.channel - right.channel;
added.gate = left.gate - right.gate;
added.velocity = left.velocity - right.velocity;
return added;
}
inline MidiCC operator-=(const MidiCC left, const MidiCC right){
MidiCC added;
added.channel = left.channel - right.channel;
added.control = left.control - right.control;
added.value = left.value- right.value;
return added;
}
inline MidiPC operator-=(const MidiPC left, const MidiPC right){
MidiPC added;
added.channel = left.channel - right.channel;
added.program = left.program - right.program;
added.value = left.value- right.value;
return added;
}
inline MidiPitchBend operator-=(const MidiPitchBend left, const MidiPitchBend right){
MidiPitchBend added;
added.channel = left.channel - right.channel;
added.value = left.value- right.value;
return added;
}
inline MidiAftertouch operator-=(const MidiAftertouch left, const MidiAftertouch right){
MidiAftertouch added;
added.channel = left.channel - right.channel;
added.value = left.value- right.value;
return added;
}
inline MidiPolyPressure operator-=(const MidiPolyPressure left, const MidiPolyPressure right){
MidiPolyPressure added;
added.channel = left.channel - right.channel;
added.note = left.note - right.note;
added.value = left.value- right.value;
return added;
}
/*Vec2D<T> operator*(const Vec2D<T> left, T scalar){*/
/* return Vec2D<T>(left.x * scalar, left.y * scalar);*/
/*};*/
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MidiOut, number)
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(MidiOutPort, number, enabled)