History

initial example builds with libsndkit

Paul Batchelor committed 5 years ago

Commit 287d0a61 parent 759997e5 files · +11 −5Browse files

Unified · Split

5 files
  1. Makefile +3 −1
  2. examples/build.sh +1 −0
  3. examples/ex1.c +3 −3
  4. nodes/sine/sine.c +4 −0
  5. nodes/wavout/wavout.c +0 −1
Makefile+3−1
@@ -8,7 +8,7 @@ WORGLE_FLAGS=-g -Werror · 7 unmodified lines
88 C89?=$(CC) -std=c89
99 C99?=$(CC) -std=c99
1010
11−CFLAGS += -Ipatchwerk
11+CFLAGS += -Ipatchwerk -I.
1212 CFLAGS += -Wall
1313 CFLAGS += -O3
1414
@@ -53,6 +53,8 @@ biramp.o \ · 38 unmodified lines
5353 core.o \
5454 patchwerk/patchwerk.o
5555
56+include nodes/config.mk
57+
5658 .SUFFIX: .org .c
5759
5860 .SUFFIXES: .org .c
examples/build.sh+1−0
@@ -0,0 +1 @@
1+gcc ex1.c -L../ -I../ -lsndkit -o ex1 -I../patchwerk -I../nodes
examples/ex1.c+3−3
@@ -2,8 +2,8 @@ · 1 unmodified line
22 #include <stdio.h>
33 #include "patchwerk.h"
44 #include "core.h"
5−#include "nodes/wavout.h"
6−#include "nodes/sine.h"
5+#include "wavout/wavout.h"
6+#include "sine/sine.h"
77
88 int main(int argc, char *argv[])
99 {
@@ -11,7 +11,7 @@ int main(int argc, char *argv[]) · 1 unmodified line
1111 unsigned int n;
1212 unsigned int nblocks;
1313
14− core = sk_core_new(sr);
14+ core = sk_core_new(44100);
1515
1616 nblocks = sk_core_seconds_to_blocks(core, 10);
1717
nodes/sine/sine.c+4−0
@@ -7,6 +7,10 @@ · 6 unmodified lines
77 #include "sine.h"
88 #include "osc.h"
99
10+#ifndef M_PI
11+#define M_PI 3.14159265358979323846
12+#endif
13+
1014 struct sine_n {
1115 pw_cable *freq;
1216 pw_cable *amp;
nodes/wavout/wavout.c+0−1
@@ -65,7 +65,6 @@ int sk_node_wavout(sk_core *core, const char *filename) · 64 unmodified lines
6565 sk_param in;
6666 void *ud;
6767 struct wavout_n *wavout;
68− int sr;
6968 drwav_data_format format;
7069
7170 rc = sk_param_get(core, &in);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t