diff options
-rw-r--r-- | theremin.m | 9 | ||||
-rw-r--r-- | theremin_ui.mlapp | bin | 149110 -> 38823 bytes |
2 files changed, 5 insertions, 4 deletions
@@ -101,9 +101,9 @@ while gesture_count < const_frames_per_second buffer_under_flow = deviceWriter(signal(:)); - if buffer_under_flow ~= 0 - disp("Buffer ran empty!"); - end + %if buffer_under_flow ~= 0 + % disp("Buffer ran empty!"); + %end complete_signal = [complete_signal signal]; end @@ -162,10 +162,11 @@ disp('If you want to save your audio, run `audiowrite(<.wav filename>, complete_ function [sound,offset] = get_theremin_sound_bit(x, y, offset, generator) % the values used here are mostly empirical + volume = y / 1300; % How it works: % https://web.physics.ucsb.edu/~lecturedemonstrations/Composer/Pages/60.17.html - frequency = max(0.003, (x - 50) / 220) * 1000; % have at least 3Hz + frequency = max(3, (x + 155) * pi); % have at least 3Hz % here we generate the array to put into sin(), but offset it with the % the previous frames offset.. diff --git a/theremin_ui.mlapp b/theremin_ui.mlapp Binary files differindex 5f7863f..c04559a 100644 --- a/theremin_ui.mlapp +++ b/theremin_ui.mlapp |