rcrath / wvtbl

Wavetable processor
GNU General Public License v3.0
0 stars 0 forks source link

refactor code to always make 2048*256 wavetables #33

Closed rcrath closed 2 months ago

rcrath commented 4 months ago

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

f-sort

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!