summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArturs Artamonovs <arturs.artamonovs@protonmail.com>2021-07-23 18:20:00 +0100
committerArturs Artamonovs <arturs.artamonovs@protonmail.com>2021-07-23 18:20:00 +0100
commit269f63b5d8a71712f587370f1e0c54660e4c55ab (patch)
tree7605121eeb8363521d15c0603ecf33a013e9047b
parente4619445203c9b17788cbcedeac4f4918b2ac2b3 (diff)
downloadWasmAudio-269f63b5d8a71712f587370f1e0c54660e4c55ab.tar.gz
WasmAudio-269f63b5d8a71712f587370f1e0c54660e4c55ab.zip
Update code. change wasm part to match name .
-rw-r--r--Build/Makefile6
-rw-r--r--Build/index.html20
-rw-r--r--WasmAudio.xcodeproj/project.pbxproj2
-rw-r--r--WasmAudio/main.c4
4 files changed, 14 insertions, 18 deletions
diff --git a/Build/Makefile b/Build/Makefile
index 6fe2da3..338fca8 100644
--- a/Build/Makefile
+++ b/Build/Makefile
@@ -10,6 +10,12 @@ make:
emcc:
$(EMCC) $(SOURCEDIR)/main.c ../FIR/firmath.c -s WASM=1 -O3 -o index.js $(EM_LDFALGS) -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall", "cwrap"]'
+
+
+deploy:
+ scp index.html fam@main.lv:/srv/http/wasm.main.lv/wasmfir
+ scp index.js fam@main.lv:/srv/http/wasm.main.lv/wasmfir
+ scp index.wasm fam@main.lv:/srv/http/wasm.main.lv/wasmfir
web:
darkhttpd ./ --port 12345
diff --git a/Build/index.html b/Build/index.html
index a91652f..39b2251 100644
--- a/Build/index.html
+++ b/Build/index.html
@@ -28,27 +28,17 @@
</div>
<pre>
- To save right click and "Save image as ..."
+ Run r, listen with s, apply filtr with q and listen again with s
Supported keys:
- left,right,up,down - change position by 10 pixels
- r - reset the configuration
- '-' - decrease amount of levels
- '=' - increase amount of levels
- q - previous color pattern
- w - next color pattern
- a - decrease size
- s - increase size
+ r - record sound buffer
+ s - play recorded buffer
+ q - applay fir filter
</pre>
<pre>
Changelog:
- v0.3 -
- fixed help -> increase button set to '='
- v0.2 -
- fixed increase size bug, when fractal become as point
- color pattern bug when go to next color
v0.1 - initial release
</pre>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/WasmAudio.xcodeproj/project.pbxproj b/WasmAudio.xcodeproj/project.pbxproj
index f4a9f2d..4209bbc 100644
--- a/WasmAudio.xcodeproj/project.pbxproj
+++ b/WasmAudio.xcodeproj/project.pbxproj
@@ -286,6 +286,7 @@
"$(inherited)",
"$(LOCAL_LIBRARY_DIR)/Frameworks",
);
+ MACOSX_DEPLOYMENT_TARGET = 11.3;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
@@ -298,6 +299,7 @@
"$(inherited)",
"$(LOCAL_LIBRARY_DIR)/Frameworks",
);
+ MACOSX_DEPLOYMENT_TARGET = 11.3;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
diff --git a/WasmAudio/main.c b/WasmAudio/main.c
index 2ab9449..e3c094b 100644
--- a/WasmAudio/main.c
+++ b/WasmAudio/main.c
@@ -72,8 +72,6 @@ static double process_buf[process_buf_size+100];
static double process_buf2[process_buf_size+100];
uint8_t *audio_rec_buffer=NULL;
-
-
FILE *f_1,*f_2;
fir_t fir_lp;
firw_t firw_lp;
@@ -457,7 +455,7 @@ int main(int argc, const char * argv[]) {
printf("Prepare SDL2 window\n");
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 2 );
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 1 );
- window = SDL_CreateWindow("KOH", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN);
+ window = SDL_CreateWindow("WASM FIR", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
SDL_SetRenderDrawColor(renderer, 0xff, 0xaa, 0xaa, 0xaa);
SDL_GLContext gl_context = SDL_GL_CreateContext(window);