Skip to content

Commit

Permalink
Add sigSelfZeroN in signal API. Add ciaramella.cpp with 5 crm example…
Browse files Browse the repository at this point in the history
…s converted to signal API.
  • Loading branch information
sletz committed Aug 27, 2023
1 parent 295c027 commit 2075912
Show file tree
Hide file tree
Showing 18 changed files with 1,839 additions and 1 deletion.
16 changes: 16 additions & 0 deletions architecture/faust/dsp/libfaust-signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,13 @@ LIBFAUST_API Signal sigAtan2(Signal x, Signal y);
*/
LIBFAUST_API Signal sigSelf();

/**
* Create a recursive signal inside the sigRecursion expression, without the one sample delay.
*
* @return the recursive signal.
*/
LIBFAUST_API Signal sigSelfZero();

/**
* Create a recursive signal. Use sigSelf() to refer to the
* recursive signal inside the sigRecursion expression.
Expand All @@ -492,6 +499,15 @@ LIBFAUST_API Signal sigRecursion(Signal s);
*/
LIBFAUST_API Signal sigSelfN(int id);

/**
* Create a recursive signal inside the sigRecursionN expression, without the one sample delay.
*
* @param id - the recursive signal index (starting from 0, up to the number of outputs signals in the recursive block)
*
* @return the recursive signal.
*/
LIBFAUST_API Signal sigSelfZeroN(int id);

/**
* Create a recursive block of signals. Use sigSelfN() to refer to the
* recursive signal inside the sigRecursionN expression.
Expand Down
10 changes: 10 additions & 0 deletions compiler/box_signal_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,11 @@ LIBFAUST_API Tree sigSelf()
return sigDelay1(sigProj(0, ref(1)));
}

LIBFAUST_API Tree sigSelfZero()
{
return sigDelay0(sigProj(0, ref(1)));
}

LIBFAUST_API Tree sigRecursion(Tree s)
{
return sigDelay0(sigProj(0, rec(cons(s, gGlobal->nil))));
Expand All @@ -222,6 +227,11 @@ LIBFAUST_API Tree sigSelfN(int i)
return sigDelay1(sigProj(i, ref(1)));
}

LIBFAUST_API Tree sigSelfZeroN(int i)
{
return sigDelay0(sigProj(i, ref(1)));
}

LIBFAUST_API tvec sigRecursionN(const tvec& ins)
{
Tree out = rec(listConvert(ins));
Expand Down
3 changes: 3 additions & 0 deletions tools/benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ interp-tracer: interp-tracer.cpp $(LIB)/libfaust.a
signal-tester: signal-tester.cpp $(LIB)/libfaust.a
$(CXX) $(COMPILEOPT) $(ARCHS) signal-tester.cpp -L $(LIB_FLAGS) $(LIBS) -I $(INC) $(LLVM) `pkg-config --cflags --libs jack gtk+-2.0` $(STRIP) -lz -lncurses -lpthread -o $@

ciaramella: ciaramella.cpp $(LIB)/libfaust.a
$(CXX) $(COMPILEOPT) ciaramella.cpp -L/opt/local/lib $(LIBS) -I $(INC) $(LLVM) `pkg-config --cflags --libs jack gtk+-2.0` $(STRIP) -lz -lncurses -lpthread -o $@

signal-tester-c: signal-tester.c $(LIB)/libfaust.a
$(CXX) $(COMPILEOPT1) $(ARCHS) signal-tester.c -L $(LIB_FLAGS) $(LIBS) -I $(INC) $(LLVM) $(STRIP) -lz -lncurses -lpthread -o signal-tester-c

Expand Down
Loading

0 comments on commit 2075912

Please sign in to comment.