Skip to content

Commit

Permalink
Merge pull request #225 from shorepine/webup
Browse files Browse the repository at this point in the history
need to reset total_samples for web
  • Loading branch information
bwhitman authored Sep 25, 2024
2 parents 371fc25 + 6733484 commit ce25e66
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ CFLAGS += -DAMY_DEBUG
# -Wdouble-promotion
EMSCRIPTEN_OPTIONS = -s WASM=1 \
-DMA_ENABLE_AUDIO_WORKLETS -sAUDIO_WORKLET=1 -sWASM_WORKERS=1 -sASYNCIFY -sASSERTIONS \
-s INITIAL_MEMORY=128mb \
-s TOTAL_STACK=64mb \
-s ALLOW_MEMORY_GROWTH=1 \
-sMODULARIZE -s 'EXPORT_NAME="amyModule"' \
-s EXPORTED_RUNTIME_METHODS="['cwrap','ccall']" \
-s EXPORTED_FUNCTIONS="['_amy_play_message', '_amy_live_start', '_amy_start', '_malloc', '_free']"
-s EXPORTED_FUNCTIONS="['_amy_play_message', '_amy_reset_sysclock', '_amy_live_start', '_amy_start', '_malloc', '_free']"

PYTHON = python3

Expand Down
4 changes: 2 additions & 2 deletions docs/amy.js

Large diffs are not rendered by default.

Binary file modified docs/amy.wasm
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/amy.ww.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/amy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1870,6 +1870,10 @@ struct event amy_parse_message(char * message) {
return amy_default_event();
}

void amy_reset_sysclock() {
total_samples = 0;
}

// given a string play / schedule the event directly
void amy_play_message(char *message) {
//fprintf(stderr, "amy_play_message: %s\n", message);
Expand Down
2 changes: 2 additions & 0 deletions src/amy.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ void amy_live_stop();
void amy_reset_oscs();
void amy_print_devices();
void amy_set_custom(struct custom_oscillator* custom);
void amy_reset_sysclock();

extern int parse_int_list_message(char *message, int16_t *vals, int max_num_vals, int16_t skipped_val);
extern void reset_osc(uint16_t i );

Expand Down

0 comments on commit ce25e66

Please sign in to comment.