summaryrefslogtreecommitdiff
path: root/synth/main.cpp
diff options
context:
space:
mode:
authorFlorian Jung <flo@thinkpad.(none)>2011-01-06 20:16:19 +0100
committerFlorian Jung <flo@thinkpad.(none)>2011-01-06 20:16:19 +0100
commite78131ccbbcb81da94e5992f788c6ea291a2050d (patch)
treeae15e6f8d77be250f168f1871c5a4de34c990abb /synth/main.cpp
parente8382521c1a35ad59efea5e8cebb915a67c0008e (diff)
The synthesizer can now load the compiled notes
There are still issues: - filtertest.prog.so: output_note-message which is not true - huge size of the .so (48K are too much!)
Diffstat (limited to 'synth/main.cpp')
-rw-r--r--synth/main.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/synth/main.cpp b/synth/main.cpp
index ae2e0d8..56c47b9 100644
--- a/synth/main.cpp
+++ b/synth/main.cpp
@@ -12,6 +12,7 @@
#include "programs.h"
#include "defines.h"
#include "globals.h"
+#include "note_loader.h"
using namespace std;
@@ -104,6 +105,24 @@ int main(int argc, char** argv)
try
{
program_settings[i]=parse(programfile[i]);
+
+ // try to load the appropriate .so file
+ if (access( (programfile[i]+".so").c_str(), R_OK ) == 0)
+ {
+ try
+ {
+ cout << "trying to load..."<<endl;
+ load_note_from_so(programfile[i]+".so", program_settings[i]);
+ }
+ catch (string err)
+ {
+ output_note("NOTE: could not load shared object '"+programfile[i]+".so"+"':\n"
+ " "+err+"\n"
+ " this is not fatal, the note has been loaded properly, but generic\n"
+ " unoptimized (slow) code will be used.");
+ }
+ }
+
}
catch (string err)
{
@@ -119,7 +138,9 @@ int main(int argc, char** argv)
}
}
-
+ for (i=0;i<N_WAVEFORMS;i++)
+ wave[i]=new fixed_t[WAVE_RES];
+
for (i=0;i<WAVE_RES;i++)
{
wave[0][i]=sin(i*2.0*3.141592654/WAVE_RES)*ONE;