Last active
November 10, 2023 21:09
-
-
Save theoknock/fe14875c18081b4b38e45e462c443c28 to your computer and use it in GitHub Desktop.
Used for audio processing or synthesis algorithms, where the normalized time is used to apply effects or transformations to an audio signal based on its position in time. Values returned: 0 to 1 from 0 to the number of points/samples/frames/etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AVAudioFramePosition frame = 0; | |
AVAudioFramePosition * frame_t = &frame; | |
AVAudioFrameCount frame_count = 44100; | |
simd_double1 time; | |
simd_double1 * time_t = &time; | |
typedef simd_double1 normalized_time_ref[frame_count]; | |
typeof(normalized_time_ref) normalized_time; | |
simd_double1 * normalized_time_ptr = &normalized_time[0]; | |
for (*frame_t = 0; *frame_t < frame_count; *frame_t += 1) { | |
*(time_t) = 0.0 + ((((*frame_t - 0.0) * (1.0 - 0.0))) / (~-frame_count - 0.0)); | |
*(normalized_time_ptr + *frame_t) = *(time_t); | |
printf("%d\tframes == %f == frames_t == %f\n", *frame_t, *(time_t), *(normalized_time_ptr + *frame_t)); | |
} | |
for (*frame_t = 0; *frame_t < frame_count; *frame_t += 1) { | |
printf("time == %f\n", *(normalized_time_ptr + *frame_t)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment