commit 7e03416062a2f801bbfa2f5c9f2b63886921ce8b
parent 204b67ac8f617d9a18269d5fa902e293a3ca8191
Author: fundamental <mark.d.mccurry@gmail.com>
Date: Tue, 2 Jul 2013 18:06:56 -0400
Sync Code With RtOsc
- Include RtOSC submodule to prevent more out of sync commits
- Fix minor Part reallocation bug
Diffstat:
9 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -1,3 +1,6 @@
[submodule "instruments"]
path = instruments
url = git://zynaddsubfx.git.sourceforge.net/gitroot/zynaddsubfx/instruments
+[submodule "rtosc"]
+ path = rtosc
+ url = https://github.com/fundamental/rtosc
diff --git a/CMakeLists.txt b/CMakeLists.txt
@@ -3,6 +3,11 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")
project(zynaddsubfx)
set(VERSION "2.4.3")
+
+#Include RTOSC
+add_subdirectory(rtosc)
+include_directories(rtosc/include)
+
enable_testing()
include(CTestConfig.cmake)
#Currently the only directory that uses cmake
diff --git a/rtosc b/rtosc
@@ -0,0 +1 @@
+Subproject commit fd4de4b3480e4ad03e1cd5cd429c1bd3e2bed827
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
@@ -322,7 +322,7 @@ target_link_libraries(zynaddsubfx_core
${MXML_LIBRARIES}
${OS_LIBRARIES}
pthread
- rtosc)
+ rtosc rtosc-cpp)
message(STATUS "using link directories: ${AUDIO_LIBRARY_DIRS} ${ZLIB_LIBRARY_DIRS} ${FFTW_LIBRARY_DIRS} ${MXML_LIBRARY_DIRS} ${FLTK_LIBRARY_DIRS}")
diff --git a/src/Misc/Master.cpp b/src/Misc/Master.cpp
@@ -58,7 +58,7 @@ static Ports localports = {
Part *p = *(Part**)rtosc_argument(msg, 1).b.data;
int i = rtosc_argument(msg, 0).i;
m->part[i]->cloneTraits(*p);
- d.reply("/free", "sb", "Part", sizeof(void*), &p);
+ d.reply("/free", "sb", "Part", sizeof(void*), &m->part[i]);
m->part[i] = p;
printf("part %d is now pointer %p\n", i, p);}},
{"volume::c", ":'old-param':", 0,
@@ -170,7 +170,7 @@ Master::Master()
midi.error_cb = [](const char *a, const char *b)
{
- fprintf(stderr, "MIDI- got an error '%s' -- '%s'\n");
+ fprintf(stderr, "MIDI- got an error '%s' -- '%s'\n",a,b);
};
}
diff --git a/src/Misc/Master.h b/src/Misc/Master.h
@@ -168,7 +168,7 @@ class Master
//Statistics on output levels
vuData vu;
- rtosc::MidiTable<1024,64> midi;
+ rtosc::MidiTable midi;//<1024,64>
private:
bool nullRun;
float sysefxvol[NUM_SYS_EFX][NUM_MIDI_PARTS];
diff --git a/src/Params/PADnoteParameters.cpp b/src/Params/PADnoteParameters.cpp
@@ -62,9 +62,9 @@ static rtosc::Ports localPorts =
PC(bwscale),
PC(hrpos.type),
- P_C(hrpos.par1),
- P_C(hrpos.par2),
- P_C(hrpos.par3),
+ PC(hrpos.par1),
+ PC(hrpos.par2),
+ PC(hrpos.par3),
PC(quality.samplesize),
PC(quality.basenote),
@@ -77,11 +77,11 @@ static rtosc::Ports localPorts =
PC(DetuneType),
{"nhr:", "::Returns the harmonic shifts",
- NULL, [](const char *m, rtosc::RtData &d) {
+ NULL, [](const char *, rtosc::RtData &d) {
PADnoteParameters *p = ((PADnoteParameters*)d.obj);
const unsigned n = synth->oscilsize / 2;
float *tmp = new float[n];
- for(int i=1; i<n; ++i)
+ for(unsigned i=1; i<n; ++i)
tmp[i] = p->getNhr(i);
d.reply(d.loc, "b", n*sizeof(float), tmp);
delete[] tmp;}},
diff --git a/src/Params/SUBnoteParameters.cpp b/src/Params/SUBnoteParameters.cpp
@@ -25,8 +25,30 @@
#include <stdio.h>
#include <rtosc/ports.h>
+#include <rtosc/port-sugar.h>
+#define rObject SUBnoteParameters
+using namespace rtosc;
static rtosc::Ports localPorts = {
+ rToggle(Pstereo, "Stereo Enable"),
+ rParam(PVolume, "Volume"),
+ rParam(PPanning, "Left Right Panning"),
+ rParam(PAmpVelocityScaleFunction, "Amplitude Velocity Sensing function"),
+ rParamI(PDetune, "Detune in detune type units"),
+ rParamI(PCoarseDetune, "Coarse Detune"),
+ //Real values needed
+ //rOption(PDetuneType, rOptions("100 cents", "200 cents", "500 cents")),
+ rToggle(PFreqEnvelopeEnabled, "Enable for Frequency Envelope"),
+ //rRecur(FreqEnvelope, EnvelopeParams),
+ //rToggle(),//continue
+ rToggle(Pfixedfreq, "Base frequency fixed frequency enable"),
+ rParam(PfixedfreqET, "Equal temeperate control for fixed frequency operation"),
+ rParam(Pnumstages, rMap(min, 1), rMap(max, 5), "Number of filter stages"),
+ rParam(Pbandwidth, "Bandwidth of filters"),
+ rArray(Phmag, MAX_SUB_HARMONICS, "Harmonic magnitudes"),
+ rArray(Phrelbw, MAX_SUB_HARMONICS, "Relative bandwidth"),
+ rParam(Pbwscale, "Bandwidth scaling with frequency"),
+ //rOption(Pstart, rOptions("zero", "random", "ones")),
};
rtosc::Ports &SUBnoteParameters::ports = localPorts;
diff --git a/src/UI/Fl_PADnoteOvertonePosition.h b/src/UI/Fl_PADnoteOvertonePosition.h
@@ -1,4 +1,10 @@
#include <cstring>
+#include <cassert>
+#include <FL/Fl.H>
+#include <FL/Fl_Box.H>
+#include "../globals.h"
+#include "Fl_Osc_Widget.H"
+#include "Fl_Osc_Interface.h"
class PADnoteOvertonePosition: public Fl_Box, Fl_Osc_Widget
{
@@ -100,11 +106,12 @@ class PADnoteOvertonePosition: public Fl_Box, Fl_Osc_Widget
void regenerateOvertones(void)
{
const int ox=x(),oy=y(),lx=w(),ly=h();
+ (void)ox;(void)oy;(void)lx;(void)ly;
const int maxharmonic=64;
memset(spectrum, 0, lx*sizeof(float));
- for (int i=1;i<nsamples;i++){
+ for (unsigned i=1;i<nsamples;i++){
int kx=(int)(lx/(float)maxharmonic*nhr[i]);
if ((kx<0)||(kx>=lx)) continue;