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
8C89?=$(CC) -std=c898C89?=$(CC) -std=c89
9C99?=$(CC) -std=c999C99?=$(CC) -std=c99
10 10
11CFLAGS += -Ipatchwerk11CFLAGS += -Ipatchwerk -I.
12CFLAGS += -Wall12CFLAGS += -Wall
13CFLAGS += -O313CFLAGS += -O3
14 14
@@ -53,6 +53,8 @@ biramp.o \ · 38 unmodified lines
53core.o \53core.o \
54patchwerk/patchwerk.o54patchwerk/patchwerk.o
55 55
56include nodes/config.mk
57
56.SUFFIX: .org .c58.SUFFIX: .org .c
57 59
58.SUFFIXES: .org .c60.SUFFIXES: .org .c
examples/build.sh+1−0
@@ -0,0 +1 @@
1gcc ex1.c -L../ -I../ -lsndkit -o ex1 -I../patchwerk -I../nodes
examples/ex1.c+3−3
@@ -2,8 +2,8 @@ · 1 unmodified line
2#include <stdio.h>2#include <stdio.h>
3#include "patchwerk.h"3#include "patchwerk.h"
4#include "core.h"4#include "core.h"
5#include "nodes/wavout.h"5#include "wavout/wavout.h"
6#include "nodes/sine.h"6#include "sine/sine.h"
7 7
8int main(int argc, char *argv[])8int main(int argc, char *argv[])
9{9{
@@ -11,7 +11,7 @@ int main(int argc, char *argv[]) · 1 unmodified line
11 unsigned int n;11 unsigned int n;
12 unsigned int nblocks;12 unsigned int nblocks;
13 13
14 core = sk_core_new(sr);14 core = sk_core_new(44100);
15 15
16 nblocks = sk_core_seconds_to_blocks(core, 10);16 nblocks = sk_core_seconds_to_blocks(core, 10);
17 17
nodes/sine/sine.c+4−0
@@ -7,6 +7,10 @@ · 6 unmodified lines
7#include "sine.h"7#include "sine.h"
8#include "osc.h"8#include "osc.h"
9 9
10#ifndef M_PI
11#define M_PI 3.14159265358979323846
12#endif
13
10struct sine_n {14struct sine_n {
11 pw_cable *freq;15 pw_cable *freq;
12 pw_cable *amp;16 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
65 sk_param in;65 sk_param in;
66 void *ud;66 void *ud;
67 struct wavout_n *wavout;67 struct wavout_n *wavout;
68 int sr;
69 drwav_data_format format;68 drwav_data_format format;
70 69
71 rc = sk_param_get(core, &in);70 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