refactor code to make final wavetable always be 256*2048 wavetable. that means removing pitch detect in the traditional sense, since it is no longer needed.
changes to make:
a_wvtbl
[x]
b_menu
[x] #34
[x] #35
[x] #36
c_upsample
[x] working
d_pitch
[x] removed
e_segment
[x] segments properly
f-sort
[x] histogram to choose mode, avg or custom: mode and avg only work if custom (on_hist_click) is commented out
[x] #37
g_choose
[x] print_segment_info returns wrong stats:
SEGMENT INFORMATION:
Target samples per wavecycle: 2048.
Valid segment range within +/-5% tolerance: 1946 to 2150 samples.
Total number of wavetable segments.....................1734
Number of segments outside the sample tolerance range..1731
Number of segments within the sample tolerance range... 3
Number of attack segments.............................. 1
Based on the overall functionality described, I'll review and provide suggestions for streamlining and removing any unnecessary steps.
Overview of the Process
Initialization: Setting global variables and initial settings.
Menu Selection: Choosing the source file.
Upsampling: Resampling the audio file to 192kHz.
Pitch Detection: Determining the frequency.
Segmentation: Identifying zero crossings and creating segments.
Sorting Segments: Categorizing segments into attack, good, and deviant.
Interpolation: Resampling segments to ensure uniform length.
Power of Two: Adjusting sample rates and lengths to fit power-of-two requirements.
Wavetable Construction: Concatenating segments and creating the final wavetable.
Interactive Selection: Providing an interface to select and save specific segments.
Streamlining Suggestions
Remove Redundant Steps:
The initial pitch detection and frequency estimation might not be necessary if you decide to use fixed frequency values.
If upsampling is always to 192kHz, then directly resampling to this rate without intermediate steps could simplify the process.
Modularize Segment Handling:
Functions for segment handling (e.g., creating, sorting, interpolating) can be further modularized and possibly combined if they share common steps.
Optimize File Operations:
Limit the number of read/write operations by processing data in memory wherever possible.
Clarify Settings:
Streamline the settings and prompt logic to reduce complexity. Ensure settings updates are only done when necessary.
Enhance Error Handling:
Include more robust error handling for file operations and user inputs
...
Summary
Remove unnecessary steps: For example, if fixed frequency is used, avoid redundant pitch detection steps.
Consolidate file operations: Limit reading and writing files by processing data in memory.
Modularize functions: Ensure each function has a single responsibility and can be reused.
This streamlined approach should help you manage the complexity and improve the efficiency of your script. Let me know if you need further assistance or specific changes!
refactor code to make final wavetable always be 256*2048 wavetable. that means removing pitch detect in the traditional sense, since it is no longer needed.
changes to make:
a_wvtbl
[x]
b_menu
c_upsample
d_pitch
e_segment
f-sort
g_choose
Overview of the Process Initialization: Setting global variables and initial settings. Menu Selection: Choosing the source file. Upsampling: Resampling the audio file to 192kHz. Pitch Detection: Determining the frequency. Segmentation: Identifying zero crossings and creating segments. Sorting Segments: Categorizing segments into attack, good, and deviant. Interpolation: Resampling segments to ensure uniform length. Power of Two: Adjusting sample rates and lengths to fit power-of-two requirements. Wavetable Construction: Concatenating segments and creating the final wavetable. Interactive Selection: Providing an interface to select and save specific segments. Streamlining Suggestions Remove Redundant Steps:
The initial pitch detection and frequency estimation might not be necessary if you decide to use fixed frequency values. If upsampling is always to 192kHz, then directly resampling to this rate without intermediate steps could simplify the process. Modularize Segment Handling:
Functions for segment handling (e.g., creating, sorting, interpolating) can be further modularized and possibly combined if they share common steps. Optimize File Operations:
Limit the number of read/write operations by processing data in memory wherever possible. Clarify Settings:
Streamline the settings and prompt logic to reduce complexity. Ensure settings updates are only done when necessary. Enhance Error Handling:
Include more robust error handling for file operations and user inputs
...
Remove unnecessary steps: For example, if fixed frequency is used, avoid redundant pitch detection steps. Consolidate file operations: Limit reading and writing files by processing data in memory. Modularize functions: Ensure each function has a single responsibility and can be reused. This streamlined approach should help you manage the complexity and improve the efficiency of your script. Let me know if you need further assistance or specific changes!