summaryrefslogtreecommitdiff
path: root/synth/note_skel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'synth/note_skel.cpp')
-rw-r--r--synth/note_skel.cpp74
1 files changed, 74 insertions, 0 deletions
diff --git a/synth/note_skel.cpp b/synth/note_skel.cpp
new file mode 100644
index 0000000..b028ca4
--- /dev/null
+++ b/synth/note_skel.cpp
@@ -0,0 +1,74 @@
+#include <cmath>
+
+#include "note_skel.h"
+#include "globals.h"
+#include "defines.h"
+
+using namespace std;
+
+NoteSkel::NoteSkel()
+{
+}
+
+NoteSkel::~NoteSkel()
+{
+
+}
+
+void NoteSkel::set_pitchbend(fixed_t pb)
+{
+ pitchbend=pb;
+}
+
+void NoteSkel::set_freq(float f)
+{
+ old_freq=freq;
+ dest_freq=f*ONE;
+ portamento_t=0;
+
+ do_ksr();
+}
+
+void NoteSkel::set_freq(float f, bool do_port)
+{
+ set_freq(f);
+
+ if (!do_port)
+ old_freq=dest_freq;
+}
+
+void NoteSkel::set_note(int n)
+{
+ note=n;
+ set_freq(440.0*pow(2.0,(float)(n-69)/12.0));
+}
+
+void NoteSkel::set_note(int n, bool do_port)
+{
+ note=n;
+ set_freq(440.0*pow(2.0,(float)(n-69)/12.0), do_port);
+}
+
+int NoteSkel::get_note()
+{
+ return note;
+}
+
+void NoteSkel::set_vel(float v)
+{
+ vel=v*ONE;
+
+ recalc_factors();
+ apply_pfactor();
+}
+
+void NoteSkel::set_portamento_frames(jack_nframes_t t)
+{
+ portamento_frames=t;
+ portamento_t=0;
+}
+
+int NoteSkel::get_program()
+{
+ return program;
+}