Config nodes do what they should do now. UX is still off, modifier keys do different things on MidiNodes and ConfigNodes.
This commit is contained in:
+69
-77
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#ifdef _WIN32
|
||||
#define _USE_MATH_DEFINES
|
||||
#endif
|
||||
@@ -42,10 +41,10 @@ namespace VISEQ::GRAPH{
|
||||
|
||||
namespace VISEQ::MIDI{
|
||||
struct MidiNote{
|
||||
int channel = 1;
|
||||
int note = 48;
|
||||
int velocity = 60;
|
||||
int gate = 10; // gate time in milliseconds
|
||||
int channel = 0;
|
||||
int note = 0;
|
||||
int velocity = 0;
|
||||
int gate = 0; // gate time in milliseconds
|
||||
};
|
||||
|
||||
struct MidiCC{
|
||||
@@ -87,6 +86,11 @@ namespace VISEQ::MIDI{
|
||||
int number;
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os, const MidiNote note){
|
||||
os << "note: " << note.note << " channel: " << note.channel << " velocity: " << note.velocity << " gate: " << note.gate;
|
||||
return os;
|
||||
}
|
||||
|
||||
inline MidiNote operator+(const MidiNote left, const MidiNote right){
|
||||
MidiNote added;
|
||||
added.note = left.note + right.note;
|
||||
@@ -181,102 +185,90 @@ namespace VISEQ::MIDI{
|
||||
return added;
|
||||
}
|
||||
|
||||
// UNARY
|
||||
// COMPOUND
|
||||
|
||||
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 MidiNote& operator+=(MidiNote& left, const MidiNote& right){
|
||||
left.note += right.note;
|
||||
left.channel += right.channel;
|
||||
left.gate += right.gate;
|
||||
left.velocity += right.velocity;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiCC& operator+=(MidiCC& left, const MidiCC right){
|
||||
left.channel += right.channel;
|
||||
left.control += right.control;
|
||||
left.value += right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiPC& operator+=(MidiPC& left, const MidiPC right){
|
||||
left.channel += right.channel;
|
||||
left.program += right.program;
|
||||
left.value += right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiPitchBend& operator+=(MidiPitchBend& left, const MidiPitchBend right){
|
||||
left.channel += right.channel;
|
||||
left.value += right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiAftertouch& operator+=(MidiAftertouch& left, const MidiAftertouch right){
|
||||
left.channel += right.channel;
|
||||
left.value += right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiPolyPressure& operator+=(MidiPolyPressure& left, const MidiPolyPressure right){
|
||||
left.channel += right.channel;
|
||||
left.note += right.note;
|
||||
left.value += right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiNote& operator-=(MidiNote& left, const MidiNote& right){
|
||||
left.note -= right.note;
|
||||
left.channel -= right.channel;
|
||||
left.gate -= right.gate;
|
||||
left.velocity -= right.velocity;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiCC& operator-=(MidiCC& left, const MidiCC right){
|
||||
left.channel -= right.channel;
|
||||
left.control -= right.control;
|
||||
left.value -= right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiPC& operator-=(MidiPC& left, const MidiPC right){
|
||||
left.channel -= right.channel;
|
||||
left.program -= right.program;
|
||||
left.value -= right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiPitchBend& operator-=(MidiPitchBend& left, const MidiPitchBend right){
|
||||
left.channel -= right.channel;
|
||||
left.value -= right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiAftertouch& operator-=(MidiAftertouch& left, const MidiAftertouch right){
|
||||
left.channel -= right.channel;
|
||||
left.value -= right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
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 MidiPolyPressure& operator-=(MidiPolyPressure& left, const MidiPolyPressure right){
|
||||
left.channel -= right.channel;
|
||||
left.note -= right.note;
|
||||
left.value -= right.value;
|
||||
return left;
|
||||
}
|
||||
|
||||
/*Vec2D<T> operator*(const Vec2D<T> left, T scalar){*/
|
||||
/* return Vec2D<T>(left.x * scalar, left.y * scalar);*/
|
||||
/*};*/
|
||||
|
||||
Reference in New Issue
Block a user