Quefumas / gensound

Pythonic audio processing and generation framework
Apache License 2.0
79 stars 6 forks source link

Fix tests/testTrack,testOld files #1

Open Quefumas opened 3 years ago

Quefumas commented 3 years ago
zivkaplan commented 3 years ago

Hi, I want to help with this issue.

For a start I took testTrack.py file.

  1. Change the example wav file to Kushaura. Do you want me to find some clean guitar sample to add for the amp test? or everything can and should be done with Kushaura?

  2. Organise imports, update names and delete the unused. on that subject: LowPassBasic and Butterworth are missing in Gensound current version. Do they have new names?

  3. update as such:

    
    # --- current ---
    def IIR_basic_test():
    s = WAV(african)[10e3:20e3]
    s[5e3:] *= IIR_basic() # y(n) = 0.3*x(n) + 0.7*y(n-1)
    audio = s.mixdown(sample_rate=44100, byte_width=2, max_amplitude=0.2)
    # play_Audio(audio)
    export_test(audio, IIR_basic_test)

--- updated? ---

def IIR_general_test(): audio = WAV(kushaura)[10e3:20e3] audio[3e3:] *= IIR_general([0, -0.5,0,0], [0.25, 0.15,0.07,0.03]) audio.play(sample_rate=44100, byte_width=2, max_amplitude=0.2) export_test(audio, IIR_general_test)


Did I understand correctly?
Quefumas commented 3 years ago

I'd like to eventually migrate all of the content in tests/* to be examples in the wiki.

Probably the 1st step would be to sift through them and decide which is which, delete everything which is not relevant and start fixing the rest, later moving it into the wiki. Examples of the 3rd case would be dealt with on a case-by-case basis, I guess.

Quefumas commented 3 years ago

Also, in particular for LowPassBasic, Butterworth, these are filters that will probably be available in the future. If the examples using them are doing anything interesting then we can perhaps trade them for the filters that were added in 0.4 and keep the snippet, if it's just testing to see that the transform is working, well, we can just get rid of that.