diff --git a/.gitignore b/.gitignore
index f210797..5e039ad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,29 +1,19 @@
-.deps/
.libs/
-/autom4te.cache/
-/build/
-/build-aux/
-Makefile
-/config.h
-/config.log
-/config.status
-/configure
-/libtool
+config.mk
/cli/rtbuf
-/gtk/rtbuf-gtk
-/gtk/rtbuf_gtk_resources.c
+/gtk3/rtbuf-gtk3
+/gtk3/rtbuf_gtk3_resources.c
/lib/music_type
-/lib/include/rtbuf/music_type.h
+/lib/music_type.h
/lib/portaudio_type
-/lib/include/rtbuf/portaudio_type.h
+/lib/portaudio_type.h
+/lib/reverb_type
+/lib/reverb_type.h
/lib/signal_type
-/lib/include/rtbuf/signal_type.h
+/lib/signal_type.h
/lib/sndio_type
-/lib/include/rtbuf/sndio_type.h
+/lib/sndio_type.h
/lib/synth_type
-/lib/include/rtbuf/synth_type.h
-/stamp-*
+/lib/synth_type.h
*.la
*.lo
-*.in
-*.m4
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..7a77a63
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+all: build
+
+build:
+ ${MAKE} -C librtbuf
+ ${MAKE} -C lib
+ ${MAKE} -C cli
+ ${MAKE} -C gtk3
+
+clean:
+ ${MAKE} -C librtbuf clean
+ ${MAKE} -C lib clean
+ ${MAKE} -C cli clean
+ ${MAKE} -C gtk3 clean
+
+install:
+ ${MAKE} -C librtbuf install
+ ${MAKE} -C lib install
+ ${MAKE} -C cli install
+ ${MAKE} -C gtk3 install
+
+.PHONY: all build clean install
diff --git a/config.subr b/config.subr
index 577dde2..0298559 100644
--- a/config.subr
+++ b/config.subr
@@ -1,8 +1,15 @@
#!/bin/sh
-c_lo_deps() {
- echo >> ${CONFIG_MK}
- $CC -M "$1" | sed -e 's/[.]o:/.lo:/' >> ${CONFIG_MK}
+lo_rule() {
+ $CC $CPPFLAGS -M "$1" | sed -e 's/[.]o:/.lo:/'
+}
+
+la_rule() {
+ $CC $CPPFLAGS -M "$1" | sed -e 's/[.]o:/.la:/'
+}
+
+prog_rule() {
+ $CC $CPPFLAGS -M "$1" | sed -e 's/[.]o:/:/'
}
c2prog() {
diff --git a/configure b/configure
new file mode 100755
index 0000000..7c736e6
--- /dev/null
+++ b/configure
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+. ./config.subr
+
+(cd librtbuf && ./configure)
+(cd lib && ./configure)
+(cd cli && ./configure)
+(cd gtk3 && ./configure)
+(cd test && ./configure)
diff --git a/lib/Makefile b/lib/Makefile
new file mode 100644
index 0000000..192277f
--- /dev/null
+++ b/lib/Makefile
@@ -0,0 +1,12 @@
+CLEANFILES =
+RTBUF_MODULES =
+
+all:
+ ${MAKE} ${RTBUF_MODULES}
+
+clean:
+ rm -rf .libs *.o *.lo *.la ${CLEANFILES}
+
+.PHONY: all clean
+
+.include <config.mk>
diff --git a/lib/configure b/lib/configure
new file mode 100755
index 0000000..0a0994a
--- /dev/null
+++ b/lib/configure
@@ -0,0 +1,61 @@
+#!/bin/sh
+set -e
+
+. ../config.subr
+
+TYPE_SOURCES="$(ls *_type.c | tr '\n' ' ')"
+
+SOURCES="$(ls *.c | grep -Ev '_type.c$' | tr '\n' ' ')"
+
+if test -d /usr/local/include; then
+ CPPFLAGS="-I/usr/local/include"
+fi
+CPPFLAGS="$CPPFLAGS"
+echo "CPPFLAGS = $CPPFLAGS" >> ${CONFIG_MK}
+
+if [ x"$DEBUG" = x"yes" ]; then
+ CFLAGS="-DDEBUG -O0 -ggdb"
+else
+ CFLAGS="-DNDEBUG -O3"
+fi
+CFLAGS="$CFLAGS -W -Wall -Werror -std=c89 -pedantic"
+echo "CFLAGS = $CFLAGS" >> ${CONFIG_MK}
+
+LDFLAGS=""
+echo "LDFLAGS = $LDFLAGS" >> ${CONFIG_MK}
+
+for TYPE_SRC in $TYPE_SOURCES; do
+ TYPE_PROG="$(c2prog "$TYPE_SRC")"
+ TYPE_H="${TYPE_PROG}.h"
+ echo > "$TYPE_H"
+done
+
+for TYPE_SRC in $TYPE_SOURCES; do
+ TYPE_PROG="$(c2prog "$TYPE_SRC")"
+ TYPE_H="${TYPE_PROG}.h"
+ echo >> ${CONFIG_MK}
+ prog_rule "$TYPE_SRC" >> ${CONFIG_MK}
+ echo "\t\${CC} \${CPPFLAGS} \${CFLAGS} $TYPE_SRC -o $TYPE_PROG" >> ${CONFIG_MK}
+ echo >> ${CONFIG_MK}
+ echo "${TYPE_H}: $TYPE_PROG" >> ${CONFIG_MK}
+ echo "\t./$TYPE_PROG > $TYPE_H" >> ${CONFIG_MK}
+ echo >> ${CONFIG_MK}
+ echo "CLEANFILES += $TYPE_PROG $TYPE_H" >> ${CONFIG_MK}
+done
+
+LIBDIR=/usr/local/lib
+echo "LIBDIR = $LIBDIR" >> ${CONFIG_MK}
+
+for SRC in $SOURCES; do
+ SRC_LO="$(c2lo "$SRC")"
+ echo >> ${CONFIG_MK}
+ lo_rule "$SRC" >> ${CONFIG_MK}
+ echo "\t${LIBTOOL} --tag=CC --mode=compile \${CC} \${CPPFLAGS} \${CFLAGS} -c $SRC -o $SRC_LO" >> ${CONFIG_MK}
+
+ SRC_LA="librtbuf_$(c2la "$SRC")"
+ echo >> ${CONFIG_MK}
+ echo "$SRC_LA: $SRC_LO" >> ${CONFIG_MK}
+ echo "\t${LIBTOOL} --tag=CC --mode=link \${CC} -shared \${LDFLAGS} $SRC_LO -o $SRC_LA -rpath $LIBDIR" >> ${CONFIG_MK}
+ echo >> ${CONFIG_MK}
+ echo "RTBUF_MODULES += $SRC_LA" >> ${CONFIG_MK}
+done
diff --git a/lib/dynamic.h b/lib/dynamic.h
new file mode 100644
index 0000000..f3e71e2
--- /dev/null
+++ b/lib/dynamic.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_DYNAMIC_H
+#define RTBUF_DYNAMIC_H
+
+#include <rtbuf/signal.h>
+
+enum {
+ RTBUF_DYNAMIC_LIMITER_IN_SIGNAL = 0,
+ RTBUF_DYNAMIC_LIMITER_IN_GAIN,
+ RTBUF_DYNAMIC_LIMITER_IN_TRESHOLD,
+ RTBUF_DYNAMIC_LIMITER_IN_ATTACK,
+ RTBUF_DYNAMIC_LIMITER_IN_RELEASE,
+ RTBUF_DYNAMIC_LIMITER_IN_N
+};
+
+typedef struct rtbuf_dynamic_limiter_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample ratio;
+} s_rtbuf_dynamic_limiter_data;
+
+#endif
diff --git a/lib/glfw3.h b/lib/glfw3.h
new file mode 100644
index 0000000..a2199bc
--- /dev/null
+++ b/lib/glfw3.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_GLFW3_H
+#define RTBUF_GLFW3_H
+
+#include <GLFW/glfw3.h>
+#include <rtbuf/rtbuf.h>
+#include <rtbuf/music.h>
+
+typedef struct rtbuf_glfw3_keyboard_data {
+ s_rtbuf_music_notes notes;
+ GLFWwindow *window;
+ unsigned int octave;
+} s_rtbuf_glfw3_keyboard_data;
+
+enum {
+ RTBUF_GLFW3_OSCILLOSCOPE_IN_BLACK,
+ RTBUF_GLFW3_OSCILLOSCOPE_IN_RED,
+ RTBUF_GLFW3_OSCILLOSCOPE_IN_GREEN,
+ RTBUF_GLFW3_OSCILLOSCOPE_IN_BLUE,
+ RTBUF_GLFW3_OSCILLOSCOPE_INS
+};
+
+typedef struct rtbuf_glfw3_oscilloscope_data {
+ GLFWwindow *window;
+} s_rtbuf_glfw3_oscilloscope_data;
+
+#endif
diff --git a/lib/include/rtbuf/dynamic.h b/lib/include/rtbuf/dynamic.h
deleted file mode 100644
index f3e71e2..0000000
--- a/lib/include/rtbuf/dynamic.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_DYNAMIC_H
-#define RTBUF_DYNAMIC_H
-
-#include <rtbuf/signal.h>
-
-enum {
- RTBUF_DYNAMIC_LIMITER_IN_SIGNAL = 0,
- RTBUF_DYNAMIC_LIMITER_IN_GAIN,
- RTBUF_DYNAMIC_LIMITER_IN_TRESHOLD,
- RTBUF_DYNAMIC_LIMITER_IN_ATTACK,
- RTBUF_DYNAMIC_LIMITER_IN_RELEASE,
- RTBUF_DYNAMIC_LIMITER_IN_N
-};
-
-typedef struct rtbuf_dynamic_limiter_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample ratio;
-} s_rtbuf_dynamic_limiter_data;
-
-#endif
diff --git a/lib/include/rtbuf/glfw3.h b/lib/include/rtbuf/glfw3.h
deleted file mode 100644
index a2199bc..0000000
--- a/lib/include/rtbuf/glfw3.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_GLFW3_H
-#define RTBUF_GLFW3_H
-
-#include <GLFW/glfw3.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/music.h>
-
-typedef struct rtbuf_glfw3_keyboard_data {
- s_rtbuf_music_notes notes;
- GLFWwindow *window;
- unsigned int octave;
-} s_rtbuf_glfw3_keyboard_data;
-
-enum {
- RTBUF_GLFW3_OSCILLOSCOPE_IN_BLACK,
- RTBUF_GLFW3_OSCILLOSCOPE_IN_RED,
- RTBUF_GLFW3_OSCILLOSCOPE_IN_GREEN,
- RTBUF_GLFW3_OSCILLOSCOPE_IN_BLUE,
- RTBUF_GLFW3_OSCILLOSCOPE_INS
-};
-
-typedef struct rtbuf_glfw3_oscilloscope_data {
- GLFWwindow *window;
-} s_rtbuf_glfw3_oscilloscope_data;
-
-#endif
diff --git a/lib/include/rtbuf/music.h b/lib/include/rtbuf/music.h
deleted file mode 100644
index b772f8c..0000000
--- a/lib/include/rtbuf/music.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_MUSIC_H
-#define RTBUF_MUSIC_H
-
-#include <rtbuf/signal.h>
-
-#define RTBUF_MUSIC_TUNE_A 440.0
-#define RTBUF_MUSIC_BASE_OCTAVE 4
-
-#define RTBUF_MUSIC_RELEASE_MAX 1.0
-
-#define RTBUF_MUSIC_NOTE_SIZE RTBUF_SIGNAL_SAMPLE_SIZE
-#define RTBUF_MUSIC_NOTE_TYPE "music_note"
-
-typedef struct rtbuf_music_note {
- t_rtbuf_signal_sample velocity; /* between 0.0 and 1.0 */
- t_rtbuf_signal_sample freq; /* above 0.0 */
- t_rtbuf_signal_sample start; /* time since start */
- t_rtbuf_signal_sample stop; /* time since stop, or -1.0 */
-} s_rtbuf_music_note;
-
-#define RTBUF_MUSIC_NOTE_IN(note) \
- { note "velocity", RTBUF_SIGNAL_SAMPLE_TYPE, 1.0, 0.0, 1.0, 1.0 }, \
- { note "frequency", RTBUF_SIGNAL_SAMPLE_TYPE, 220.0, 0.0, \
- RTBUF_SIGNAL_SAMPLERATE / 2.0, 1.0 }, \
- { note "start", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, DBL_MAX, 1.0 }, \
- { note "stop", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, DBL_MAX, 1.0 }
-
-#define RTBUF_MUSIC_NOTE_IN_ENUM(note) \
- note ## _VELOCITY , \
- note ## _FREQUENCY, \
- note ## _START , \
- note ## _STOP
-
-enum {
- RTBUF_MUSIC_NOTE_IN_VELOCITY = 0,
- RTBUF_MUSIC_NOTE_IN_FREQUENCY,
- RTBUF_MUSIC_NOTE_IN_START,
- RTBUF_MUSIC_NOTE_IN_STOP,
- RTBUF_MUSIC_NOTE_INS
-};
-
-#define RTBUF_MUSIC_NOTE_IN_VELOCITY(notes, i) \
- (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + \
- RTBUF_MUSIC_NOTE_IN_VELOCITY)
-#define RTBUF_MUSIC_NOTE_IN_FREQUENCY(notes, i) \
- (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + \
- RTBUF_MUSIC_NOTE_IN_FREQUENCY)
-#define RTBUF_MUSIC_NOTE_IN_START(notes, i) \
- (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + RTBUF_MUSIC_NOTE_IN_START)
-#define RTBUF_MUSIC_NOTE_IN_STOP(notes, i) \
- (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + RTBUF_MUSIC_NOTE_IN_STOP)
-
-#define RTBUF_MUSIC_NOTE_MAX 32
-
-typedef struct rtbuf_music_notes {
- unsigned int note_n;
- s_rtbuf_music_note note[RTBUF_MUSIC_NOTE_MAX];
-} s_rtbuf_music_notes;
-
-#define RTBUF_MUSIC_NOTES_SIZE sizeof(unsigned int)
-#define RTBUF_MUSIC_NOTES_TYPE "music_notes"
-
-int rtbuf_music_init ();
-void rtbuf_music_notes_init (s_rtbuf_music_notes *notes);
-int rtbuf_music_notes_new (s_rtbuf_music_notes *notes, double velocity);
-void rtbuf_music_notes_delete (s_rtbuf_music_notes *notes,
- unsigned int i);
-void rtbuf_music_notes_delete_all (s_rtbuf_music_notes *notes);
-void rtbuf_music_notes_dt (s_rtbuf_music_notes *notes, double dt);
-int rtbuf_music_note_p (s_rtbuf_music_note *note);
-void rtbuf_music_note_dt (s_rtbuf_music_note *note, double dt);
-
-s_rtbuf_music_notes * rtbuf_music_notes (s_rtbuf *rtb,
- unsigned int in);
-
-t_rtbuf_signal_sample rtbuf_music_note_frequency (unsigned int octave,
- unsigned int note);
-double rtbuf_music_frequency_note (double f);
-
-#endif
diff --git a/lib/include/rtbuf/portaudio.h b/lib/include/rtbuf/portaudio.h
deleted file mode 100644
index 74a7a61..0000000
--- a/lib/include/rtbuf/portaudio.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_PORTAUDIO_H
-#define RTBUF_PORTAUDIO_H
-
-#include <portaudio.h>
-#include <rtbuf/signal.h>
-
-enum {
- RTBUF_PORTAUDIO_LEFT = 0,
- RTBUF_PORTAUDIO_RIGHT,
- RTBUF_PORTAUDIO_CHANNELS
-};
-
-#define RTBUF_PORTAUDIO_SAMPLE_TYPE "short"
-#define RTBUF_PORTAUDIO_SAMPLES \
- (RTBUF_PORTAUDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
-
-typedef short t_rtbuf_portaudio_sample;
-typedef t_rtbuf_portaudio_sample t_rtbuf_portaudio_samples[RTBUF_PORTAUDIO_SAMPLES];
-
-typedef struct rtbuf_portaudio_input_data {
- t_rtbuf_signal signal[RTBUF_PORTAUDIO_CHANNELS];
- t_rtbuf_portaudio_samples samples;
-} s_rtbuf_portaudio_input_data;
-
-int rtbuf_portaudio_input (s_rtbuf *rtb);
-int rtbuf_portaudio_input_start (s_rtbuf *rtb);
-int rtbuf_portaudio_input_stop (s_rtbuf *rtb);
-
-typedef struct rtbuf_portaudio_output_reserved {
- PaStream *stream;
-} s_rtbuf_portaudio_output_reserved;
-
-typedef struct rtbuf_portaudio_output_data {
- t_rtbuf_portaudio_samples samples;
- s_rtbuf_portaudio_output_reserved reserved;
-} s_rtbuf_portaudio_output_data;
-
-#define RTBUF_PORTAUDIO_OUTPUT_RESERVED_SIZE \
- sizeof(s_rtbuf_portaudio_output_reserved)
-
-int rtbuf_portaudio_output (s_rtbuf *rtb);
-int rtbuf_portaudio_output_start (s_rtbuf *rtb);
-int rtbuf_portaudio_output_stop (s_rtbuf *rtb);
-
-#endif
diff --git a/lib/include/rtbuf/reverb.h b/lib/include/rtbuf/reverb.h
deleted file mode 100644
index a2f9f1f..0000000
--- a/lib/include/rtbuf/reverb.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2020 Thomas de Grivel <thoxdg@gmail.com>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_REVERB_H
-#define RTBUF_REVERB_H
-
-#include <assert.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/signal.h>
-
-/* Feedback delay network with fourth order Hadamard matrix */
-
-#define RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX \
- RTBUF_SIGNAL_SAMPLERATE
-
-typedef struct rtbuf_reverb_fdn4_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample d0[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
- t_rtbuf_signal_sample d1[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
- t_rtbuf_signal_sample d2[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
- t_rtbuf_signal_sample d3[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
- unsigned int pos;
-} s_rtbuf_reverb_fdn4_data;
-
-enum {
- RTBUF_REVERB_FDN4_IN_SIGNAL = 0,
- RTBUF_REVERB_FDN4_IN_TIME,
- RTBUF_REVERB_FDN4_IN_DRY_LEVEL,
- RTBUF_REVERB_FDN4_IN_WET_LEVEL,
- RTBUF_REVERB_FDN4_INS
-};
-
-int rtbuf_reverb_fdn4 (s_rtbuf *rtb);
-int rtbuf_reverb_fdn4_start (s_rtbuf *rtb);
-
-#endif /* RTBUF_REVERB_H */
diff --git a/lib/include/rtbuf/signal.h b/lib/include/rtbuf/signal.h
deleted file mode 100644
index cf2986b..0000000
--- a/lib/include/rtbuf/signal.h
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_SIGNAL_H
-#define RTBUF_SIGNAL_H
-
-#include <assert.h>
-#include <rtbuf/rtbuf.h>
-
-typedef double t_rtbuf_signal_sample;
-#define RTBUF_SIGNAL_SAMPLE_SIZE sizeof(t_rtbuf_signal_sample)
-#define RTBUF_SIGNAL_SAMPLE_TYPE "double"
-
-#define RTBUF_SIGNAL_SAMPLES 256
-#define RTBUF_SIGNAL_SAMPLERATE 48000
-#define RTBUF_SIGNAL_DT \
- ((double) RTBUF_SIGNAL_SAMPLES / RTBUF_SIGNAL_SAMPLERATE)
-
-typedef t_rtbuf_signal_sample t_rtbuf_signal[RTBUF_SIGNAL_SAMPLES];
-
-#define RTBUF_SIGNAL_SIZE sizeof(t_rtbuf_signal)
-
-typedef t_rtbuf_signal_sample
-f_rtbuf_signal (const t_rtbuf_signal_sample *signal,
- unsigned int sample);
-
-typedef struct rtbuf_signal_fun {
- f_rtbuf_signal *sample_fun;
- const t_rtbuf_signal_sample *signal;
-} s_rtbuf_signal_fun;
-
-void rtbuf_signal_zero (t_rtbuf_signal_sample *signal);
-t_rtbuf_signal_sample
-rtbuf_signal_sample (s_rtbuf *rtb,
- unsigned int in,
- t_rtbuf_signal_sample default_value);
-void rtbuf_signal_fun (s_rtbuf *rtb,
- unsigned int in,
- s_rtbuf_signal_fun *data);
-
-f_rtbuf_signal rtbuf_signal_sample_from_sample;
-f_rtbuf_signal rtbuf_signal_sample_from_signal;
-
-const double g_rtbuf_signal_sample_zero;
-const double g_rtbuf_signal_sample_half;
-const double g_rtbuf_signal_sample_one;
-const double g_rtbuf_signal_sample_2pi;
-const double g_rtbuf_signal_default_frequency;
-
-/* butterworth bandpass filter, second order */
-
-typedef struct rtbuf_signal_bandpass2_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample x4;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
- t_rtbuf_signal_sample y4;
-} s_rtbuf_signal_bandpass2_data;
-
-enum {
- RTBUF_SIGNAL_BANDPASS_IN_SIGNAL = 0,
- RTBUF_SIGNAL_BANDPASS_IN_CUTOFF,
- RTBUF_SIGNAL_BANDPASS_IN_QFACTOR,
- RTBUF_SIGNAL_BANDPASS_INS
-};
-
-int rtbuf_signal_bandpass2 (s_rtbuf *rtb);
-int rtbuf_signal_bandpass2_start (s_rtbuf *rtb);
-
-/* delay */
-
-#define RTBUF_SIGNAL_DELAY_MAX 10
-#define RTBUF_SIGNAL_DELAY_SAMPLES_MAX (RTBUF_SIGNAL_DELAY_MAX * \
- RTBUF_SIGNAL_SAMPLERATE)
-
-typedef struct rtbuf_signal_delay_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample in[RTBUF_SIGNAL_DELAY_SAMPLES_MAX];
- unsigned int pos;
-} s_rtbuf_signal_delay_data;
-
-enum {
- RTBUF_SIGNAL_DELAY_IN_SIGNAL = 0,
- RTBUF_SIGNAL_DELAY_IN_DELAY,
- RTBUF_SIGNAL_DELAY_IN_FEEDBACK,
- RTBUF_SIGNAL_DELAY_INS
-};
-
-int rtbuf_signal_delay (s_rtbuf *rtb);
-int rtbuf_signal_delay_start (s_rtbuf *rtb);
-
-/* butterworth second order 10 band equalizer */
-
-typedef struct rtbuf_signal_equalizer10_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal signal32;
- t_rtbuf_signal signal64;
- t_rtbuf_signal signal128;
- t_rtbuf_signal signal256;
- t_rtbuf_signal signal512;
- t_rtbuf_signal signal1k;
- t_rtbuf_signal signal2k;
- t_rtbuf_signal signal4k;
- t_rtbuf_signal signal8k;
- t_rtbuf_signal signal16k;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample x4;
- t_rtbuf_signal_sample y0_1;
- t_rtbuf_signal_sample y0_2;
- t_rtbuf_signal_sample y0_3;
- t_rtbuf_signal_sample y0_4;
- t_rtbuf_signal_sample y1_1;
- t_rtbuf_signal_sample y1_2;
- t_rtbuf_signal_sample y1_3;
- t_rtbuf_signal_sample y1_4;
- t_rtbuf_signal_sample y2_1;
- t_rtbuf_signal_sample y2_2;
- t_rtbuf_signal_sample y2_3;
- t_rtbuf_signal_sample y2_4;
- t_rtbuf_signal_sample y3_1;
- t_rtbuf_signal_sample y3_2;
- t_rtbuf_signal_sample y3_3;
- t_rtbuf_signal_sample y3_4;
- t_rtbuf_signal_sample y4_1;
- t_rtbuf_signal_sample y4_2;
- t_rtbuf_signal_sample y4_3;
- t_rtbuf_signal_sample y4_4;
- t_rtbuf_signal_sample y5_1;
- t_rtbuf_signal_sample y5_2;
- t_rtbuf_signal_sample y5_3;
- t_rtbuf_signal_sample y5_4;
- t_rtbuf_signal_sample y6_1;
- t_rtbuf_signal_sample y6_2;
- t_rtbuf_signal_sample y6_3;
- t_rtbuf_signal_sample y6_4;
- t_rtbuf_signal_sample y7_1;
- t_rtbuf_signal_sample y7_2;
- t_rtbuf_signal_sample y7_3;
- t_rtbuf_signal_sample y7_4;
- t_rtbuf_signal_sample y8_1;
- t_rtbuf_signal_sample y8_2;
- t_rtbuf_signal_sample y8_3;
- t_rtbuf_signal_sample y8_4;
- t_rtbuf_signal_sample y9_1;
- t_rtbuf_signal_sample y9_2;
- t_rtbuf_signal_sample y9_3;
- t_rtbuf_signal_sample y9_4;
-} s_rtbuf_signal_equalizer10_data;
-
-enum {
- RTBUF_SIGNAL_EQUALIZER10_IN_SIGNAL = 0,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP32,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP64,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP128,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP256,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP512,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP1K,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP2K,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP4K,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP8K,
- RTBUF_SIGNAL_EQUALIZER10_IN_AMP16K,
- RTBUF_SIGNAL_EQUALIZER10_INS
-};
-
-int rtbuf_signal_equalizer10 (s_rtbuf *rtb);
-int rtbuf_signal_equalizer10_start (s_rtbuf *rtb);
-
-/* flanger */
-
-#define RTBUF_SIGNAL_FLANGER_MAX 1
-#define RTBUF_SIGNAL_FLANGER_SAMPLES_MAX (RTBUF_SIGNAL_FLANGER_MAX * \
- RTBUF_SIGNAL_SAMPLERATE)
-
-typedef struct rtbuf_signal_flanger_data {
- t_rtbuf_signal signal;
- double phase;
- t_rtbuf_signal_sample in[RTBUF_SIGNAL_FLANGER_SAMPLES_MAX];
- unsigned int pos;
- unsigned int ds;
-} s_rtbuf_signal_flanger_data;
-
-enum {
- RTBUF_SIGNAL_FLANGER_IN_SIGNAL = 0,
- RTBUF_SIGNAL_FLANGER_IN_FREQUENCY,
- RTBUF_SIGNAL_FLANGER_IN_AMPLITUDE,
- RTBUF_SIGNAL_FLANGER_IN_DELAY,
- RTBUF_SIGNAL_FLANGER_IN_FEEDBACK,
- RTBUF_SIGNAL_FLANGER_IN_N
-};
-
-int rtbuf_signal_flanger (s_rtbuf *rtb);
-int rtbuf_signal_flanger_start (s_rtbuf *rtb);
-
-/* butterworth hipass filter, first order */
-
-typedef struct rtbuf_signal_hipass_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample y1;
-} s_rtbuf_signal_hipass_data;
-
-enum {
- RTBUF_SIGNAL_HIPASS_IN_SIGNAL = 0,
- RTBUF_SIGNAL_HIPASS_IN_CUTOFF,
- RTBUF_SIGNAL_HIPASS_INS
-};
-
-int rtbuf_signal_hipass (s_rtbuf *rtb);
-int rtbuf_signal_hipass_start (s_rtbuf *rtb);
-
-/* butterworth hipass filter, second order */
-
-typedef struct rtbuf_signal_hipass2_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
-} s_rtbuf_signal_hipass2_data;
-
-int rtbuf_signal_hipass2 (s_rtbuf *rtb);
-int rtbuf_signal_hipass2_start (s_rtbuf *rtb);
-
-/* butterworth hipass filter, third order */
-
-typedef struct rtbuf_signal_hipass3_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
-} s_rtbuf_signal_hipass3_data;
-
-int rtbuf_signal_hipass3 (s_rtbuf *rtb);
-int rtbuf_signal_hipass3_start (s_rtbuf *rtb);
-
-/* butterworth hipass filter, fourth order */
-
-typedef struct rtbuf_signal_hipass4_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample x4;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
- t_rtbuf_signal_sample y4;
-} s_rtbuf_signal_hipass4_data;
-
-int rtbuf_signal_hipass4 (s_rtbuf *rtb);
-int rtbuf_signal_hipass4_start (s_rtbuf *rtb);
-
-/* butterworth hipass filter, fifth order */
-
-typedef struct rtbuf_signal_hipass5_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample x4;
- t_rtbuf_signal_sample x5;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
- t_rtbuf_signal_sample y4;
- t_rtbuf_signal_sample y5;
-} s_rtbuf_signal_hipass5_data;
-
-int rtbuf_signal_hipass5 (s_rtbuf *rtb);
-int rtbuf_signal_hipass5_start (s_rtbuf *rtb);
-
-/* butterworth lowpass filter, first order */
-
-typedef struct rtbuf_signal_lowpass_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample y1;
-} s_rtbuf_signal_lowpass_data;
-
-enum {
- RTBUF_SIGNAL_LOWPASS_IN_SIGNAL = 0,
- RTBUF_SIGNAL_LOWPASS_IN_CUTOFF,
- RTBUF_SIGNAL_LOWPASS_INS
-};
-
-int rtbuf_signal_lowpass (s_rtbuf *rtb);
-int rtbuf_signal_lowpass_start (s_rtbuf *rtb);
-
-/* butterworth lowpass filter, second order */
-
-typedef struct rtbuf_signal_lowpass2_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
-} s_rtbuf_signal_lowpass2_data;
-
-int rtbuf_signal_lowpass2 (s_rtbuf *rtb);
-int rtbuf_signal_lowpass2_start (s_rtbuf *rtb);
-
-/* butterworth lowpass filter, third order */
-
-typedef struct rtbuf_signal_lowpass3_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
-} s_rtbuf_signal_lowpass3_data;
-
-int rtbuf_signal_lowpass3 (s_rtbuf *rtb);
-int rtbuf_signal_lowpass3_start (s_rtbuf *rtb);
-
-/* butterworth lowpass filter, fourth order */
-
-typedef struct rtbuf_signal_lowpass4_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample x4;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
- t_rtbuf_signal_sample y4;
-} s_rtbuf_signal_lowpass4_data;
-
-int rtbuf_signal_lowpass4 (s_rtbuf *rtb);
-int rtbuf_signal_lowpass4_start (s_rtbuf *rtb);
-
-/* butterworth lowpass filter, fifth order */
-
-typedef struct rtbuf_signal_lowpass5_data {
- t_rtbuf_signal signal;
- t_rtbuf_signal_sample x1;
- t_rtbuf_signal_sample x2;
- t_rtbuf_signal_sample x3;
- t_rtbuf_signal_sample x4;
- t_rtbuf_signal_sample x5;
- t_rtbuf_signal_sample y1;
- t_rtbuf_signal_sample y2;
- t_rtbuf_signal_sample y3;
- t_rtbuf_signal_sample y4;
- t_rtbuf_signal_sample y5;
-} s_rtbuf_signal_lowpass5_data;
-
-int rtbuf_signal_lowpass5 (s_rtbuf *rtb);
-int rtbuf_signal_lowpass5_start (s_rtbuf *rtb);
-
-/* sawtooth */
-
-typedef struct rtbuf_signal_sawtooth_data {
- t_rtbuf_signal signal;
- double phase;
-} s_rtbuf_signal_sawtooth_data;
-
-enum {
- RTBUF_SIGNAL_SAWTOOTH_IN_FREQUENCY = 0,
- RTBUF_SIGNAL_SAWTOOTH_IN_AMPLITUDE,
- RTBUF_SIGNAL_SAWTOOTH_IN_N
-};
-
-int rtbuf_signal_sawtooth (s_rtbuf *rtb);
-int rtbuf_signal_sawtooth_start (s_rtbuf *rtb);
-
-/* sinus */
-
-typedef struct rtbuf_signal_sinus_data {
- t_rtbuf_signal signal;
- double phase;
-} s_rtbuf_signal_sinus_data;
-
-enum {
- RTBUF_SIGNAL_SINUS_IN_FREQUENCY = 0,
- RTBUF_SIGNAL_SINUS_IN_AMPLITUDE,
- RTBUF_SIGNAL_SINUS_IN_N
-};
-
-int rtbuf_signal_sinus (s_rtbuf *rtb);
-int rtbuf_signal_sinus_start (s_rtbuf *rtb);
-
-/* square */
-
-enum {
- RTBUF_SIGNAL_SQUARE_IN_FREQUENCY = 0,
- RTBUF_SIGNAL_SQUARE_IN_AMPLITUDE,
- RTBUF_SIGNAL_SQUARE_IN_PULSE,
- RTBUF_SIGNAL_SQUARE_IN_N
-};
-
-typedef struct rtbuf_signal_square_data {
- t_rtbuf_signal signal;
- double phase;
-} s_rtbuf_signal_square_data;
-
-int rtbuf_signal_square (s_rtbuf *rtb);
-int rtbuf_signal_square_start (s_rtbuf *rtb);
-
-const double sqrt2_2;
-
-#endif /* RTBUF_SIGNAL_H */
diff --git a/lib/include/rtbuf/sndio.h b/lib/include/rtbuf/sndio.h
deleted file mode 100644
index 391ad00..0000000
--- a/lib/include/rtbuf/sndio.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_SNDIO_H
-#define RTBUF_SNDIO_H
-
-#include <sndio.h>
-#include <rtbuf/signal.h>
-
-void print_sio_par (struct sio_par *par);
-
-enum {
- RTBUF_SNDIO_LEFT = 0,
- RTBUF_SNDIO_RIGHT,
- RTBUF_SNDIO_CHANNELS
-};
-
-#define RTBUF_SNDIO_SAMPLE_TYPE "short"
-#define RTBUF_SNDIO_SAMPLES \
- (RTBUF_SNDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
-
-typedef short t_rtbuf_sndio_sample;
-typedef t_rtbuf_sndio_sample t_rtbuf_sndio_samples[RTBUF_SNDIO_SAMPLES];
-
-#pragma pack(push,1)
-typedef struct rtbuf_sndio_input_data {
- t_rtbuf_signal signal[RTBUF_SNDIO_CHANNELS];
- t_rtbuf_sndio_samples samples;
-} s_rtbuf_sndio_input_data;
-#pragma pack(pop)
-
-int rtbuf_sndio_input (s_rtbuf *rtb);
-int rtbuf_sndio_input_start (s_rtbuf *rtb);
-int rtbuf_sndio_input_stop (s_rtbuf *rtb);
-
-typedef struct rtbuf_sndio_output_reserved {
- struct sio_hdl *sio_hdl;
- struct sio_par want;
- struct sio_par have;
-} s_rtbuf_sndio_output_reserved;
-
-#pragma pack(push,1)
-typedef struct rtbuf_sndio_output_data {
- t_rtbuf_sndio_samples samples;
- s_rtbuf_sndio_output_reserved reserved;
-} s_rtbuf_sndio_output_data;
-#pragma pack(pop)
-
-#define RTBUF_SNDIO_OUTPUT_RESERVED_SIZE \
- sizeof(s_rtbuf_sndio_output_reserved)
-
-int rtbuf_sndio_output (s_rtbuf *rtb);
-int rtbuf_sndio_output_start (s_rtbuf *rtb);
-int rtbuf_sndio_output_stop (s_rtbuf *rtb);
-
-#endif
diff --git a/lib/include/rtbuf/synth.h b/lib/include/rtbuf/synth.h
deleted file mode 100644
index 1d6147e..0000000
--- a/lib/include/rtbuf/synth.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#ifndef RTBUF_SYNTH_H
-#define RTBUF_SYNTH_H
-
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/music.h>
-#include <rtbuf/music_type.h>
-#include <rtbuf/signal.h>
-#include <rtbuf/synth_type.h>
-
-/* adsr */
-
-enum {
- RTBUF_MUSIC_NOTE_IN_ENUM(RTBUF_SYNTH_ADSR_IN),
- RTBUF_SYNTH_ADSR_IN_ATTACK,
- RTBUF_SYNTH_ADSR_IN_DECAY,
- RTBUF_SYNTH_ADSR_IN_SUSTAIN,
- RTBUF_SYNTH_ADSR_IN_RELEASE,
- RTBUF_SYNTH_ADSR_IN_N
-};
-
-enum {
- RTBUF_SYNTH_ENVELOPE_STATE_NOT_STARTED = 0,
- RTBUF_SYNTH_ENVELOPE_STATE_STARTED,
- RTBUF_SYNTH_ENVELOPE_STATE_ENDED
-};
-
-typedef struct rtbuf_synth_adsr_data {
- t_rtbuf_signal signal;
- int state;
-} s_rtbuf_synth_adsr_data;
-
-int rtbuf_synth_adsr (s_rtbuf *rtb);
-int rtbuf_synth_adsr_start (s_rtbuf *rtb);
-
-/* synth */
-
-enum {
- RTBUF_SYNTH_SYNTH_IN_ENVELOPE = 0,
- RTBUF_SYNTH_SYNTH_IN_OSCILLATOR,
- RTBUF_SYNTH_SYNTH_IN_NOTES,
- RTBUF_SYNTH_NOTES_IN_ENUM(RTBUF_SYNTH_SYNTH_IN_NOTE),
- RTBUF_SYNTH_SYNTH_IN_N
-};
-
-#define RTBUF_SYNTH_SYNTH_IN_NOTE_ENVELOPE(i) \
- (RTBUF_SYNTH_SYNTH_IN_NOTE_0_ENVELOPE + 2 * i)
-
-#define RTBUF_SYNTH_SYNTH_IN_NOTE_OSCILLATOR(i) \
- (RTBUF_SYNTH_SYNTH_IN_NOTE_0_OSCILLATOR + 2 * i)
-
-typedef struct rtbuf_synth_synth_data
-{
- t_rtbuf_signal signal;
- unsigned int note_n;
-} s_rtbuf_synth_synth_data;
-
-int rtbuf_synth_synth (s_rtbuf *rtb);
-int rtbuf_synth_synth_start (s_rtbuf *rtb);
-
-#endif /* RTBUF_SYNTH_H */
diff --git a/lib/music.c b/lib/music.c
index a2fd911..f4f3806 100644
--- a/lib/music.c
+++ b/lib/music.c
@@ -17,8 +17,8 @@
#include <assert.h>
#include <math.h>
#include <stdio.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/music.h>
+#include "../librtbuf/rtbuf.h"
+#include "music.h"
int g_rtbuf_music_init = 0;
double g_rtbuf_music_tune = 0.0;
diff --git a/lib/music.h b/lib/music.h
new file mode 100644
index 0000000..82c6b7e
--- /dev/null
+++ b/lib/music.h
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_MUSIC_H
+#define RTBUF_MUSIC_H
+
+#include "signal.h"
+
+#define RTBUF_MUSIC_TUNE_A 440.0
+#define RTBUF_MUSIC_BASE_OCTAVE 4
+
+#define RTBUF_MUSIC_RELEASE_MAX 1.0
+
+#define RTBUF_MUSIC_NOTE_SIZE RTBUF_SIGNAL_SAMPLE_SIZE
+#define RTBUF_MUSIC_NOTE_TYPE "music_note"
+
+typedef struct rtbuf_music_note {
+ t_rtbuf_signal_sample velocity; /* between 0.0 and 1.0 */
+ t_rtbuf_signal_sample freq; /* above 0.0 */
+ t_rtbuf_signal_sample start; /* time since start */
+ t_rtbuf_signal_sample stop; /* time since stop, or -1.0 */
+} s_rtbuf_music_note;
+
+#define RTBUF_MUSIC_NOTE_IN(note) \
+ { note "velocity", RTBUF_SIGNAL_SAMPLE_TYPE, 1.0, 0.0, 1.0, 1.0 }, \
+ { note "frequency", RTBUF_SIGNAL_SAMPLE_TYPE, 220.0, 0.0, \
+ RTBUF_SIGNAL_SAMPLERATE / 2.0, 1.0 }, \
+ { note "start", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, DBL_MAX, 1.0 }, \
+ { note "stop", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, DBL_MAX, 1.0 }
+
+#define RTBUF_MUSIC_NOTE_IN_ENUM(note) \
+ note ## _VELOCITY , \
+ note ## _FREQUENCY, \
+ note ## _START , \
+ note ## _STOP
+
+enum {
+ RTBUF_MUSIC_NOTE_IN_VELOCITY = 0,
+ RTBUF_MUSIC_NOTE_IN_FREQUENCY,
+ RTBUF_MUSIC_NOTE_IN_START,
+ RTBUF_MUSIC_NOTE_IN_STOP,
+ RTBUF_MUSIC_NOTE_INS
+};
+
+#define RTBUF_MUSIC_NOTE_IN_VELOCITY(notes, i) \
+ (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + \
+ RTBUF_MUSIC_NOTE_IN_VELOCITY)
+#define RTBUF_MUSIC_NOTE_IN_FREQUENCY(notes, i) \
+ (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + \
+ RTBUF_MUSIC_NOTE_IN_FREQUENCY)
+#define RTBUF_MUSIC_NOTE_IN_START(notes, i) \
+ (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + RTBUF_MUSIC_NOTE_IN_START)
+#define RTBUF_MUSIC_NOTE_IN_STOP(notes, i) \
+ (notes + 1 + RTBUF_MUSIC_NOTE_INS * i + RTBUF_MUSIC_NOTE_IN_STOP)
+
+#define RTBUF_MUSIC_NOTE_MAX 32
+
+typedef struct rtbuf_music_notes {
+ unsigned int note_n;
+ s_rtbuf_music_note note[RTBUF_MUSIC_NOTE_MAX];
+} s_rtbuf_music_notes;
+
+#define RTBUF_MUSIC_NOTES_SIZE sizeof(unsigned int)
+#define RTBUF_MUSIC_NOTES_TYPE "music_notes"
+
+int rtbuf_music_init ();
+void rtbuf_music_notes_init (s_rtbuf_music_notes *notes);
+int rtbuf_music_notes_new (s_rtbuf_music_notes *notes, double velocity);
+void rtbuf_music_notes_delete (s_rtbuf_music_notes *notes,
+ unsigned int i);
+void rtbuf_music_notes_delete_all (s_rtbuf_music_notes *notes);
+void rtbuf_music_notes_dt (s_rtbuf_music_notes *notes, double dt);
+int rtbuf_music_note_p (s_rtbuf_music_note *note);
+void rtbuf_music_note_dt (s_rtbuf_music_note *note, double dt);
+
+s_rtbuf_music_notes * rtbuf_music_notes (s_rtbuf *rtb,
+ unsigned int in);
+
+t_rtbuf_signal_sample rtbuf_music_note_frequency (unsigned int octave,
+ unsigned int note);
+double rtbuf_music_frequency_note (double f);
+
+#endif
diff --git a/lib/music_type.c b/lib/music_type.c
index 782c40a..2c87b58 100644
--- a/lib/music_type.c
+++ b/lib/music_type.c
@@ -15,8 +15,8 @@
*/
#include <stdio.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/music.h>
+#include "../librtbuf/rtbuf.h"
+#include "music.h"
void notes_in ()
{
diff --git a/lib/portaudio.h b/lib/portaudio.h
new file mode 100644
index 0000000..bb99cf9
--- /dev/null
+++ b/lib/portaudio.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_PORTAUDIO_H
+#define RTBUF_PORTAUDIO_H
+
+#include <portaudio.h>
+#include "signal.h"
+
+enum {
+ RTBUF_PORTAUDIO_LEFT = 0,
+ RTBUF_PORTAUDIO_RIGHT,
+ RTBUF_PORTAUDIO_CHANNELS
+};
+
+#define RTBUF_PORTAUDIO_SAMPLE_TYPE "short"
+#define RTBUF_PORTAUDIO_SAMPLES \
+ (RTBUF_PORTAUDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
+
+typedef short t_rtbuf_portaudio_sample;
+typedef t_rtbuf_portaudio_sample t_rtbuf_portaudio_samples[RTBUF_PORTAUDIO_SAMPLES];
+
+typedef struct rtbuf_portaudio_input_data {
+ t_rtbuf_signal signal[RTBUF_PORTAUDIO_CHANNELS];
+ t_rtbuf_portaudio_samples samples;
+} s_rtbuf_portaudio_input_data;
+
+int rtbuf_portaudio_input (s_rtbuf *rtb);
+int rtbuf_portaudio_input_start (s_rtbuf *rtb);
+int rtbuf_portaudio_input_stop (s_rtbuf *rtb);
+
+typedef struct rtbuf_portaudio_output_reserved {
+ PaStream *stream;
+} s_rtbuf_portaudio_output_reserved;
+
+typedef struct rtbuf_portaudio_output_data {
+ t_rtbuf_portaudio_samples samples;
+ s_rtbuf_portaudio_output_reserved reserved;
+} s_rtbuf_portaudio_output_data;
+
+#define RTBUF_PORTAUDIO_OUTPUT_RESERVED_SIZE \
+ sizeof(s_rtbuf_portaudio_output_reserved)
+
+int rtbuf_portaudio_output (s_rtbuf *rtb);
+int rtbuf_portaudio_output_start (s_rtbuf *rtb);
+int rtbuf_portaudio_output_stop (s_rtbuf *rtb);
+
+#endif
diff --git a/lib/portaudio_type.c b/lib/portaudio_type.c
index e3f7724..e6be043 100644
--- a/lib/portaudio_type.c
+++ b/lib/portaudio_type.c
@@ -15,8 +15,8 @@
*/
#include <stdio.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/portaudio.h>
+#include "../librtbuf/rtbuf.h"
+#include "portaudio.h"
int main ()
{
diff --git a/lib/reverb.c b/lib/reverb.c
index d6d41e6..0480a40 100644
--- a/lib/reverb.c
+++ b/lib/reverb.c
@@ -17,19 +17,19 @@
#include <math.h>
#include <stdio.h>
#include <strings.h>
-#include "rtbuf.h"
-#include "rtbuf_lib.h"
-#include "rtbuf_signal.h"
-#include "rtbuf_signal_type.h"
-#include "rtbuf_reverb.h"
-#include "rtbuf_reverb_type.h"
+#include "../librtbuf/rtbuf.h"
+#include "../librtbuf/lib.h"
+#include "signal.h"
+#include "signal_type.h"
+#include "reverb.h"
+#include "reverb_type.h"
s_rtbuf_lib_proc_in g_rtbuf_reverb_fdn4_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "time", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 100.0 },
- { "dry_level", RTBUF_SIGNAL_TYPE, 0.8, 0.0, 1.0 },
- { "wet_level", RTBUF_SIGNAL_TYPE, 0.2, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+ { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 2.0 },
+ { "time", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 100.0, 10.0 },
+ { "dry_level", RTBUF_SIGNAL_TYPE, 0.8, 0.0, 1.0, 2.0 },
+ { "wet_level", RTBUF_SIGNAL_TYPE, 0.2, 0.0, 1.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 } };
s_rtbuf_lib_proc_out g_rtbuf_reverb_fdn4_out[] = {
{ "signal", RTBUF_SIGNAL_TYPE },
diff --git a/lib/reverb.h b/lib/reverb.h
new file mode 100644
index 0000000..7353c77
--- /dev/null
+++ b/lib/reverb.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2020 Thomas de Grivel <thoxdg@gmail.com>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_REVERB_H
+#define RTBUF_REVERB_H
+
+#include <assert.h>
+#include "../librtbuf/rtbuf.h"
+#include "signal.h"
+
+/* Feedback delay network with fourth order Hadamard matrix */
+
+#define RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX \
+ RTBUF_SIGNAL_SAMPLERATE
+
+typedef struct rtbuf_reverb_fdn4_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample d0[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
+ t_rtbuf_signal_sample d1[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
+ t_rtbuf_signal_sample d2[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
+ t_rtbuf_signal_sample d3[RTBUF_REVERB_FDN4_DELAY_SAMPLES_MAX];
+ unsigned int pos;
+} s_rtbuf_reverb_fdn4_data;
+
+enum {
+ RTBUF_REVERB_FDN4_IN_SIGNAL = 0,
+ RTBUF_REVERB_FDN4_IN_TIME,
+ RTBUF_REVERB_FDN4_IN_DRY_LEVEL,
+ RTBUF_REVERB_FDN4_IN_WET_LEVEL,
+ RTBUF_REVERB_FDN4_INS
+};
+
+int rtbuf_reverb_fdn4 (s_rtbuf *rtb);
+int rtbuf_reverb_fdn4_start (s_rtbuf *rtb);
+
+#endif /* RTBUF_REVERB_H */
diff --git a/lib/reverb_type.c b/lib/reverb_type.c
index 56c7122..f429816 100644
--- a/lib/reverb_type.c
+++ b/lib/reverb_type.c
@@ -15,8 +15,8 @@
*/
#include <stdio.h>
-#include "rtbuf.h"
-#include "rtbuf_reverb.h"
+#include "../librtbuf/rtbuf.h"
+#include "reverb.h"
int main ()
{
diff --git a/lib/signal.c b/lib/signal.c
index 676c76f..6089050 100644
--- a/lib/signal.c
+++ b/lib/signal.c
@@ -17,10 +17,10 @@
#include <math.h>
#include <stdio.h>
#include <strings.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/lib.h>
-#include <rtbuf/signal.h>
-#include <rtbuf/signal_type.h>
+#include "../librtbuf/rtbuf.h"
+#include "../librtbuf/lib.h"
+#include "signal.h"
+#include "signal_type.h"
const double g_rtbuf_signal_sample_zero = 0.0;
const double g_rtbuf_signal_sample_half = 0.5;
diff --git a/lib/signal.h b/lib/signal.h
new file mode 100644
index 0000000..0f90b52
--- /dev/null
+++ b/lib/signal.h
@@ -0,0 +1,425 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_SIGNAL_H
+#define RTBUF_SIGNAL_H
+
+#include <assert.h>
+#include "../librtbuf/rtbuf.h"
+
+typedef double t_rtbuf_signal_sample;
+#define RTBUF_SIGNAL_SAMPLE_SIZE sizeof(t_rtbuf_signal_sample)
+#define RTBUF_SIGNAL_SAMPLE_TYPE "double"
+
+#define RTBUF_SIGNAL_SAMPLES 256
+#define RTBUF_SIGNAL_SAMPLERATE 48000
+#define RTBUF_SIGNAL_DT \
+ ((double) RTBUF_SIGNAL_SAMPLES / RTBUF_SIGNAL_SAMPLERATE)
+
+typedef t_rtbuf_signal_sample t_rtbuf_signal[RTBUF_SIGNAL_SAMPLES];
+
+#define RTBUF_SIGNAL_SIZE sizeof(t_rtbuf_signal)
+
+typedef t_rtbuf_signal_sample
+f_rtbuf_signal (const t_rtbuf_signal_sample *signal,
+ unsigned int sample);
+
+typedef struct rtbuf_signal_fun {
+ f_rtbuf_signal *sample_fun;
+ const t_rtbuf_signal_sample *signal;
+} s_rtbuf_signal_fun;
+
+void rtbuf_signal_zero (t_rtbuf_signal_sample *signal);
+t_rtbuf_signal_sample
+rtbuf_signal_sample (s_rtbuf *rtb,
+ unsigned int in,
+ t_rtbuf_signal_sample default_value);
+void rtbuf_signal_fun (s_rtbuf *rtb,
+ unsigned int in,
+ s_rtbuf_signal_fun *data);
+
+f_rtbuf_signal rtbuf_signal_sample_from_sample;
+f_rtbuf_signal rtbuf_signal_sample_from_signal;
+
+const double g_rtbuf_signal_sample_zero;
+const double g_rtbuf_signal_sample_half;
+const double g_rtbuf_signal_sample_one;
+const double g_rtbuf_signal_sample_2pi;
+const double g_rtbuf_signal_default_frequency;
+
+/* butterworth bandpass filter, second order */
+
+typedef struct rtbuf_signal_bandpass2_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample x4;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+ t_rtbuf_signal_sample y4;
+} s_rtbuf_signal_bandpass2_data;
+
+enum {
+ RTBUF_SIGNAL_BANDPASS_IN_SIGNAL = 0,
+ RTBUF_SIGNAL_BANDPASS_IN_CUTOFF,
+ RTBUF_SIGNAL_BANDPASS_IN_QFACTOR,
+ RTBUF_SIGNAL_BANDPASS_INS
+};
+
+int rtbuf_signal_bandpass2 (s_rtbuf *rtb);
+int rtbuf_signal_bandpass2_start (s_rtbuf *rtb);
+
+/* delay */
+
+#define RTBUF_SIGNAL_DELAY_MAX 10
+#define RTBUF_SIGNAL_DELAY_SAMPLES_MAX (RTBUF_SIGNAL_DELAY_MAX * \
+ RTBUF_SIGNAL_SAMPLERATE)
+
+typedef struct rtbuf_signal_delay_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample in[RTBUF_SIGNAL_DELAY_SAMPLES_MAX];
+ unsigned int pos;
+} s_rtbuf_signal_delay_data;
+
+enum {
+ RTBUF_SIGNAL_DELAY_IN_SIGNAL = 0,
+ RTBUF_SIGNAL_DELAY_IN_DELAY,
+ RTBUF_SIGNAL_DELAY_IN_FEEDBACK,
+ RTBUF_SIGNAL_DELAY_INS
+};
+
+int rtbuf_signal_delay (s_rtbuf *rtb);
+int rtbuf_signal_delay_start (s_rtbuf *rtb);
+
+/* butterworth second order 10 band equalizer */
+
+typedef struct rtbuf_signal_equalizer10_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal signal32;
+ t_rtbuf_signal signal64;
+ t_rtbuf_signal signal128;
+ t_rtbuf_signal signal256;
+ t_rtbuf_signal signal512;
+ t_rtbuf_signal signal1k;
+ t_rtbuf_signal signal2k;
+ t_rtbuf_signal signal4k;
+ t_rtbuf_signal signal8k;
+ t_rtbuf_signal signal16k;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample x4;
+ t_rtbuf_signal_sample y0_1;
+ t_rtbuf_signal_sample y0_2;
+ t_rtbuf_signal_sample y0_3;
+ t_rtbuf_signal_sample y0_4;
+ t_rtbuf_signal_sample y1_1;
+ t_rtbuf_signal_sample y1_2;
+ t_rtbuf_signal_sample y1_3;
+ t_rtbuf_signal_sample y1_4;
+ t_rtbuf_signal_sample y2_1;
+ t_rtbuf_signal_sample y2_2;
+ t_rtbuf_signal_sample y2_3;
+ t_rtbuf_signal_sample y2_4;
+ t_rtbuf_signal_sample y3_1;
+ t_rtbuf_signal_sample y3_2;
+ t_rtbuf_signal_sample y3_3;
+ t_rtbuf_signal_sample y3_4;
+ t_rtbuf_signal_sample y4_1;
+ t_rtbuf_signal_sample y4_2;
+ t_rtbuf_signal_sample y4_3;
+ t_rtbuf_signal_sample y4_4;
+ t_rtbuf_signal_sample y5_1;
+ t_rtbuf_signal_sample y5_2;
+ t_rtbuf_signal_sample y5_3;
+ t_rtbuf_signal_sample y5_4;
+ t_rtbuf_signal_sample y6_1;
+ t_rtbuf_signal_sample y6_2;
+ t_rtbuf_signal_sample y6_3;
+ t_rtbuf_signal_sample y6_4;
+ t_rtbuf_signal_sample y7_1;
+ t_rtbuf_signal_sample y7_2;
+ t_rtbuf_signal_sample y7_3;
+ t_rtbuf_signal_sample y7_4;
+ t_rtbuf_signal_sample y8_1;
+ t_rtbuf_signal_sample y8_2;
+ t_rtbuf_signal_sample y8_3;
+ t_rtbuf_signal_sample y8_4;
+ t_rtbuf_signal_sample y9_1;
+ t_rtbuf_signal_sample y9_2;
+ t_rtbuf_signal_sample y9_3;
+ t_rtbuf_signal_sample y9_4;
+} s_rtbuf_signal_equalizer10_data;
+
+enum {
+ RTBUF_SIGNAL_EQUALIZER10_IN_SIGNAL = 0,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP32,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP64,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP128,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP256,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP512,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP1K,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP2K,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP4K,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP8K,
+ RTBUF_SIGNAL_EQUALIZER10_IN_AMP16K,
+ RTBUF_SIGNAL_EQUALIZER10_INS
+};
+
+int rtbuf_signal_equalizer10 (s_rtbuf *rtb);
+int rtbuf_signal_equalizer10_start (s_rtbuf *rtb);
+
+/* flanger */
+
+#define RTBUF_SIGNAL_FLANGER_MAX 1
+#define RTBUF_SIGNAL_FLANGER_SAMPLES_MAX (RTBUF_SIGNAL_FLANGER_MAX * \
+ RTBUF_SIGNAL_SAMPLERATE)
+
+typedef struct rtbuf_signal_flanger_data {
+ t_rtbuf_signal signal;
+ double phase;
+ t_rtbuf_signal_sample in[RTBUF_SIGNAL_FLANGER_SAMPLES_MAX];
+ unsigned int pos;
+ unsigned int ds;
+} s_rtbuf_signal_flanger_data;
+
+enum {
+ RTBUF_SIGNAL_FLANGER_IN_SIGNAL = 0,
+ RTBUF_SIGNAL_FLANGER_IN_FREQUENCY,
+ RTBUF_SIGNAL_FLANGER_IN_AMPLITUDE,
+ RTBUF_SIGNAL_FLANGER_IN_DELAY,
+ RTBUF_SIGNAL_FLANGER_IN_FEEDBACK,
+ RTBUF_SIGNAL_FLANGER_IN_N
+};
+
+int rtbuf_signal_flanger (s_rtbuf *rtb);
+int rtbuf_signal_flanger_start (s_rtbuf *rtb);
+
+/* butterworth hipass filter, first order */
+
+typedef struct rtbuf_signal_hipass_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample y1;
+} s_rtbuf_signal_hipass_data;
+
+enum {
+ RTBUF_SIGNAL_HIPASS_IN_SIGNAL = 0,
+ RTBUF_SIGNAL_HIPASS_IN_CUTOFF,
+ RTBUF_SIGNAL_HIPASS_INS
+};
+
+int rtbuf_signal_hipass (s_rtbuf *rtb);
+int rtbuf_signal_hipass_start (s_rtbuf *rtb);
+
+/* butterworth hipass filter, second order */
+
+typedef struct rtbuf_signal_hipass2_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+} s_rtbuf_signal_hipass2_data;
+
+int rtbuf_signal_hipass2 (s_rtbuf *rtb);
+int rtbuf_signal_hipass2_start (s_rtbuf *rtb);
+
+/* butterworth hipass filter, third order */
+
+typedef struct rtbuf_signal_hipass3_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+} s_rtbuf_signal_hipass3_data;
+
+int rtbuf_signal_hipass3 (s_rtbuf *rtb);
+int rtbuf_signal_hipass3_start (s_rtbuf *rtb);
+
+/* butterworth hipass filter, fourth order */
+
+typedef struct rtbuf_signal_hipass4_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample x4;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+ t_rtbuf_signal_sample y4;
+} s_rtbuf_signal_hipass4_data;
+
+int rtbuf_signal_hipass4 (s_rtbuf *rtb);
+int rtbuf_signal_hipass4_start (s_rtbuf *rtb);
+
+/* butterworth hipass filter, fifth order */
+
+typedef struct rtbuf_signal_hipass5_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample x4;
+ t_rtbuf_signal_sample x5;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+ t_rtbuf_signal_sample y4;
+ t_rtbuf_signal_sample y5;
+} s_rtbuf_signal_hipass5_data;
+
+int rtbuf_signal_hipass5 (s_rtbuf *rtb);
+int rtbuf_signal_hipass5_start (s_rtbuf *rtb);
+
+/* butterworth lowpass filter, first order */
+
+typedef struct rtbuf_signal_lowpass_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample y1;
+} s_rtbuf_signal_lowpass_data;
+
+enum {
+ RTBUF_SIGNAL_LOWPASS_IN_SIGNAL = 0,
+ RTBUF_SIGNAL_LOWPASS_IN_CUTOFF,
+ RTBUF_SIGNAL_LOWPASS_INS
+};
+
+int rtbuf_signal_lowpass (s_rtbuf *rtb);
+int rtbuf_signal_lowpass_start (s_rtbuf *rtb);
+
+/* butterworth lowpass filter, second order */
+
+typedef struct rtbuf_signal_lowpass2_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+} s_rtbuf_signal_lowpass2_data;
+
+int rtbuf_signal_lowpass2 (s_rtbuf *rtb);
+int rtbuf_signal_lowpass2_start (s_rtbuf *rtb);
+
+/* butterworth lowpass filter, third order */
+
+typedef struct rtbuf_signal_lowpass3_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+} s_rtbuf_signal_lowpass3_data;
+
+int rtbuf_signal_lowpass3 (s_rtbuf *rtb);
+int rtbuf_signal_lowpass3_start (s_rtbuf *rtb);
+
+/* butterworth lowpass filter, fourth order */
+
+typedef struct rtbuf_signal_lowpass4_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample x4;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+ t_rtbuf_signal_sample y4;
+} s_rtbuf_signal_lowpass4_data;
+
+int rtbuf_signal_lowpass4 (s_rtbuf *rtb);
+int rtbuf_signal_lowpass4_start (s_rtbuf *rtb);
+
+/* butterworth lowpass filter, fifth order */
+
+typedef struct rtbuf_signal_lowpass5_data {
+ t_rtbuf_signal signal;
+ t_rtbuf_signal_sample x1;
+ t_rtbuf_signal_sample x2;
+ t_rtbuf_signal_sample x3;
+ t_rtbuf_signal_sample x4;
+ t_rtbuf_signal_sample x5;
+ t_rtbuf_signal_sample y1;
+ t_rtbuf_signal_sample y2;
+ t_rtbuf_signal_sample y3;
+ t_rtbuf_signal_sample y4;
+ t_rtbuf_signal_sample y5;
+} s_rtbuf_signal_lowpass5_data;
+
+int rtbuf_signal_lowpass5 (s_rtbuf *rtb);
+int rtbuf_signal_lowpass5_start (s_rtbuf *rtb);
+
+/* sawtooth */
+
+typedef struct rtbuf_signal_sawtooth_data {
+ t_rtbuf_signal signal;
+ double phase;
+} s_rtbuf_signal_sawtooth_data;
+
+enum {
+ RTBUF_SIGNAL_SAWTOOTH_IN_FREQUENCY = 0,
+ RTBUF_SIGNAL_SAWTOOTH_IN_AMPLITUDE,
+ RTBUF_SIGNAL_SAWTOOTH_IN_N
+};
+
+int rtbuf_signal_sawtooth (s_rtbuf *rtb);
+int rtbuf_signal_sawtooth_start (s_rtbuf *rtb);
+
+/* sinus */
+
+typedef struct rtbuf_signal_sinus_data {
+ t_rtbuf_signal signal;
+ double phase;
+} s_rtbuf_signal_sinus_data;
+
+enum {
+ RTBUF_SIGNAL_SINUS_IN_FREQUENCY = 0,
+ RTBUF_SIGNAL_SINUS_IN_AMPLITUDE,
+ RTBUF_SIGNAL_SINUS_IN_N
+};
+
+int rtbuf_signal_sinus (s_rtbuf *rtb);
+int rtbuf_signal_sinus_start (s_rtbuf *rtb);
+
+/* square */
+
+enum {
+ RTBUF_SIGNAL_SQUARE_IN_FREQUENCY = 0,
+ RTBUF_SIGNAL_SQUARE_IN_AMPLITUDE,
+ RTBUF_SIGNAL_SQUARE_IN_PULSE,
+ RTBUF_SIGNAL_SQUARE_IN_N
+};
+
+typedef struct rtbuf_signal_square_data {
+ t_rtbuf_signal signal;
+ double phase;
+} s_rtbuf_signal_square_data;
+
+int rtbuf_signal_square (s_rtbuf *rtb);
+int rtbuf_signal_square_start (s_rtbuf *rtb);
+
+const double sqrt2_2;
+
+#endif /* RTBUF_SIGNAL_H */
diff --git a/lib/signal_type.c b/lib/signal_type.c
index f8446ee..154817e 100644
--- a/lib/signal_type.c
+++ b/lib/signal_type.c
@@ -15,8 +15,8 @@
*/
#include <stdio.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/signal.h>
+#include "../librtbuf/rtbuf.h"
+#include "signal.h"
int main ()
{
diff --git a/lib/sndio.c b/lib/sndio.c
index 44c8d5c..d6ed601 100644
--- a/lib/sndio.c
+++ b/lib/sndio.c
@@ -17,12 +17,12 @@
#include <sndio.h>
#include <stdio.h>
#include <strings.h>
-#include "rtbuf.h"
-#include "rtbuf_lib.h"
-#include "rtbuf_signal.h"
-#include "rtbuf_signal_type.h"
-#include "rtbuf_sndio.h"
-#include "rtbuf_sndio_type.h"
+#include "../librtbuf/rtbuf.h"
+#include "../librtbuf/lib.h"
+#include "signal.h"
+#include "signal_type.h"
+#include "sndio.h"
+#include "sndio_type.h"
void print_sio_par (struct sio_par *par)
{
diff --git a/lib/sndio.h b/lib/sndio.h
new file mode 100644
index 0000000..0f296fd
--- /dev/null
+++ b/lib/sndio.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_SNDIO_H
+#define RTBUF_SNDIO_H
+
+#include <sndio.h>
+#include "signal.h"
+
+void print_sio_par (struct sio_par *par);
+
+enum {
+ RTBUF_SNDIO_LEFT = 0,
+ RTBUF_SNDIO_RIGHT,
+ RTBUF_SNDIO_CHANNELS
+};
+
+#define RTBUF_SNDIO_SAMPLE_TYPE "short"
+#define RTBUF_SNDIO_SAMPLES \
+ (RTBUF_SNDIO_CHANNELS * RTBUF_SIGNAL_SAMPLES)
+
+typedef short t_rtbuf_sndio_sample;
+typedef t_rtbuf_sndio_sample t_rtbuf_sndio_samples[RTBUF_SNDIO_SAMPLES];
+
+#pragma pack(push,1)
+typedef struct rtbuf_sndio_input_data {
+ t_rtbuf_signal signal[RTBUF_SNDIO_CHANNELS];
+ t_rtbuf_sndio_samples samples;
+} s_rtbuf_sndio_input_data;
+#pragma pack(pop)
+
+int rtbuf_sndio_input (s_rtbuf *rtb);
+int rtbuf_sndio_input_start (s_rtbuf *rtb);
+int rtbuf_sndio_input_stop (s_rtbuf *rtb);
+
+typedef struct rtbuf_sndio_output_reserved {
+ struct sio_hdl *sio_hdl;
+ struct sio_par want;
+ struct sio_par have;
+} s_rtbuf_sndio_output_reserved;
+
+#pragma pack(push,1)
+typedef struct rtbuf_sndio_output_data {
+ t_rtbuf_sndio_samples samples;
+ s_rtbuf_sndio_output_reserved reserved;
+} s_rtbuf_sndio_output_data;
+#pragma pack(pop)
+
+#define RTBUF_SNDIO_OUTPUT_RESERVED_SIZE \
+ sizeof(s_rtbuf_sndio_output_reserved)
+
+int rtbuf_sndio_output (s_rtbuf *rtb);
+int rtbuf_sndio_output_start (s_rtbuf *rtb);
+int rtbuf_sndio_output_stop (s_rtbuf *rtb);
+
+#endif
diff --git a/lib/sndio_type.c b/lib/sndio_type.c
index 571e644..d6dcf44 100644
--- a/lib/sndio_type.c
+++ b/lib/sndio_type.c
@@ -15,8 +15,8 @@
*/
#include <stdio.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/sndio.h>
+#include "../librtbuf/rtbuf.h"
+#include "sndio.h"
int main ()
{
diff --git a/lib/synth.h b/lib/synth.h
new file mode 100644
index 0000000..570c68d
--- /dev/null
+++ b/lib/synth.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2018 Thomas de Grivel <thoxdg@gmail.com> +33614550127
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifndef RTBUF_SYNTH_H
+#define RTBUF_SYNTH_H
+
+#include "../librtbuf/rtbuf.h"
+#include "music.h"
+#include "music_type.h"
+#include "signal.h"
+#include "synth_type.h"
+
+/* adsr */
+
+enum {
+ RTBUF_MUSIC_NOTE_IN_ENUM(RTBUF_SYNTH_ADSR_IN),
+ RTBUF_SYNTH_ADSR_IN_ATTACK,
+ RTBUF_SYNTH_ADSR_IN_DECAY,
+ RTBUF_SYNTH_ADSR_IN_SUSTAIN,
+ RTBUF_SYNTH_ADSR_IN_RELEASE,
+ RTBUF_SYNTH_ADSR_IN_N
+};
+
+enum {
+ RTBUF_SYNTH_ENVELOPE_STATE_NOT_STARTED = 0,
+ RTBUF_SYNTH_ENVELOPE_STATE_STARTED,
+ RTBUF_SYNTH_ENVELOPE_STATE_ENDED
+};
+
+typedef struct rtbuf_synth_adsr_data {
+ t_rtbuf_signal signal;
+ int state;
+} s_rtbuf_synth_adsr_data;
+
+int rtbuf_synth_adsr (s_rtbuf *rtb);
+int rtbuf_synth_adsr_start (s_rtbuf *rtb);
+
+/* synth */
+
+enum {
+ RTBUF_SYNTH_SYNTH_IN_ENVELOPE = 0,
+ RTBUF_SYNTH_SYNTH_IN_OSCILLATOR,
+ RTBUF_SYNTH_SYNTH_IN_NOTES,
+ RTBUF_SYNTH_NOTES_IN_ENUM(RTBUF_SYNTH_SYNTH_IN_NOTE),
+ RTBUF_SYNTH_SYNTH_IN_N
+};
+
+#define RTBUF_SYNTH_SYNTH_IN_NOTE_ENVELOPE(i) \
+ (RTBUF_SYNTH_SYNTH_IN_NOTE_0_ENVELOPE + 2 * i)
+
+#define RTBUF_SYNTH_SYNTH_IN_NOTE_OSCILLATOR(i) \
+ (RTBUF_SYNTH_SYNTH_IN_NOTE_0_OSCILLATOR + 2 * i)
+
+typedef struct rtbuf_synth_synth_data
+{
+ t_rtbuf_signal signal;
+ unsigned int note_n;
+} s_rtbuf_synth_synth_data;
+
+int rtbuf_synth_synth (s_rtbuf *rtb);
+int rtbuf_synth_synth_start (s_rtbuf *rtb);
+
+#endif /* RTBUF_SYNTH_H */
diff --git a/lib/synth_type.c b/lib/synth_type.c
index 39b1b23..b82fc83 100644
--- a/lib/synth_type.c
+++ b/lib/synth_type.c
@@ -1,8 +1,8 @@
#include <stdio.h>
-#include <rtbuf/rtbuf.h>
-#include <rtbuf/music.h>
-#include <rtbuf/music_type.h>
+#include "../librtbuf/rtbuf.h"
+#include "music.h"
+#include "music_type.h"
void notes_in ()
{