Skip to content

Commit

Permalink
Cleanup faustgen~ code.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Jul 22, 2024
1 parent cacec74 commit a8c5a3c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 45 deletions.
4 changes: 2 additions & 2 deletions compiler/generator/dag_instructions_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ ValueInst* DAGInstructionsCompiler::generateWaveform(Tree sig)
} else {
vsize = IB::genLoadLoopVar("vsize");
}
FIRIndex index1 = (FIRIndex(IB::genLoadStructVar(idx)) + vsize) % size;

FIRIndex index1 = (FIRIndex(IB::genLoadStructVar(idx)) + vsize) % size;
pushPostComputeDSPMethod(IB::genStoreStructVar(idx, index1));
FIRIndex index2 = (FIRIndex(IB::genLoadStructVar(idx)) + getCurrentLoopIndex()) % size;
return generateCacheCode(sig, IB::genLoadArrayStaticStructVar(vname, index2));
Expand Down
4 changes: 2 additions & 2 deletions compiler/interval/intervalAsin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ interval interval_algebra::Asin(const interval& x)
return empty();
}

double v = 0; // value at which the min slope is attained, zero if it is present
int sign = 1; // whether we compute the difference between f(v) and f(v+ε) or f(v-ε)
double v = 0; // value at which the min slope is attained, zero if it is present
int sign = 1; // whether we compute the difference between f(v) and f(v+ε) or f(v-ε)
if (!i.has(0)) { // if zero is not present, it's the bound closer to zero
v = minValAbs(i);
sign = signMinValAbs(i);
Expand Down
14 changes: 1 addition & 13 deletions embedded/faustgen/src/faustgen_factory.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
FAUST Architecture File
Copyright (C) 2012-2023 GRAME, Centre National de Creation Musicale
Copyright (C) 2012-2024 GRAME, Centre National de Creation Musicale
---------------------------------------------------------------------
This Architecture section is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -348,13 +348,6 @@ dsp_factory* faustgen_factory::create_factory_from_sourcecode()
*/
return factory;
} else {
// Update all instances
for (const auto& it : fInstances) {
//it->hilight_on();
}
if (fInstances.begin() != fInstances.end()) {
(*fInstances.begin())->hilight_error(error_msg);
}
post("Invalid Faust code or compile options : %s", error_msg.c_str());
return 0;
}
Expand Down Expand Up @@ -822,11 +815,6 @@ void faustgen_factory::update_sourcecode(int size, char* source_code)
// Recompile only if text has been changed
if (strcmp(source_code, *fSourceCode) != 0) {

// Update all instances
for (const auto& it : fInstances) {
//it->hilight_off();
}

// Delete the existing Faust module
free_dsp_factory();

Expand Down
2 changes: 1 addition & 1 deletion embedded/faustgen/src/faustgen_factory.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
FAUST Architecture File
Copyright (C) 2012-2023 GRAME, Centre National de Creation Musicale
Copyright (C) 2012-2024 GRAME, Centre National de Creation Musicale
---------------------------------------------------------------------
This Architecture section is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
Expand Down
23 changes: 1 addition & 22 deletions embedded/faustgen/src/faustgen~.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
FAUST Architecture File
Copyright (C) 2012-2023 GRAME, Centre National de Creation Musicale
Copyright (C) 2012-2024 GRAME, Centre National de Creation Musicale
---------------------------------------------------------------------
This Architecture section is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -664,27 +664,6 @@ void faustgen::display_libraries()
fDSPfactory->display_libraries();
}

void faustgen::hilight_on()
{
t_jrgba color;
jrgba_set(&color, 1.0, 0.0, 0.0, 1.0);
t_object* box;
object_obex_lookup((t_object*)&m_ob, gensym("#B"), &box);
jbox_set_color(box, &color);
}

void faustgen::hilight_off()
{
t_object* box;
object_obex_lookup((t_object*)&m_ob, gensym("#B"), &box);
jbox_set_color(box, &gDefaultColor);
}

void faustgen::hilight_error(const string& error)
{
object_error_obtrusive((t_object*)&m_ob, (char*)error.c_str());
}

void faustgen::init_controllers()
{
// Initialize User Interface (here connnection with controls)
Expand Down
6 changes: 1 addition & 5 deletions embedded/faustgen/src/faustgen~.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/************************************************************************
FAUST Architecture File
Copyright (C) 2012-2023 GRAME, Centre National de Creation Musicale
Copyright (C) 2012-2024 GRAME, Centre National de Creation Musicale
---------------------------------------------------------------------
This Architecture section is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -123,10 +123,6 @@ class faustgen : public MspCpp5<faustgen> {

void update_sourcecode();

void hilight_on();
void hilight_off();
void hilight_error(const std::string& error);

// Called upon deleting the object inside the patcher
~faustgen();

Expand Down

0 comments on commit a8c5a3c

Please sign in to comment.