diff --git a/main.c b/main.c index 9dc1de1..4adc5fb 100644 --- a/main.c +++ b/main.c @@ -137,42 +137,6 @@ size_t detect_note_pressed(Note* note) { return is_pressed; } -//------------------------------------------------------------------------------------ -// UI -//------------------------------------------------------------------------------------ -/* -int get_zero_crossing(SynthSound* sound) { - int zero_crossing_index = 0; - for (size_t i = 1; i < sound->sample_count; i++) - { - if (sound->samples[i] >= 0.0f && sound->samples[i-1] < 0.0f) // zero-crossing - { - zero_crossing_index = i; - break; - } - } - return zero_crossing_index; -} - -Vector2* GetVisualSignal(SynthSound* sound, int zero_crossing_index) -{ - const int signal_amp = 300; - - Vector2* signal_points = malloc(sizeof(Vector2) * STREAM_BUFFER_SIZE); - - const float screen_vertical_midpoint = (WINDOW_HEIGHT/2); - for (size_t point_idx = 0; point_idx < sound->sample_count; point_idx++) - { - const int signal_idx = (point_idx + zero_crossing_index) % STREAM_BUFFER_SIZE; - signal_points[point_idx].x = (float)point_idx + WINDOW_WIDTH; - signal_points[point_idx].y = screen_vertical_midpoint + (int)(sound->samples[signal_idx] * 300); - } - - return signal_points; -} - -*/ - //------------------------------------------------------------------------------------ // Main //------------------------------------------------------------------------------------ @@ -197,7 +161,7 @@ int main(int argc, char **argv) { InitAudioDevice(); SetMasterVolume(SYNTH_VOLUME); SetAudioStreamBufferSizeDefault(STREAM_BUFFER_SIZE); - AudioStream synth_stream = LoadAudioStream(SAMPLE_RATE, sizeof(float) * 8, 1);//float*8 + AudioStream synth_stream = LoadAudioStream(SAMPLE_RATE, sizeof(float) * 8, 1); SetAudioStreamVolume(synth_stream, 0.5f); PlayAudioStream(synth_stream); @@ -263,10 +227,6 @@ int main(int argc, char **argv) { BeginDrawing(); ClearBackground(RAYWHITE); - // int zero_crossing = get_zero_crossing(&sound); - // Vector2* visual_signal = GetVisualSignal(&sound, zero_crossing); - // DrawLineStrip(visual_signal, STREAM_BUFFER_SIZE - zero_crossing, RED); - DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY); DrawFPS(0,0);