gensound icon indicating copy to clipboard operation
gensound copied to clipboard

Fix tests/testTrack,testOld files

Open Quefumas opened this issue 3 years ago • 3 comments

  • fix dependencies directory structure
  • ensure things still compile

Quefumas avatar Oct 01 '20 10:10 Quefumas

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?

zivkaplan avatar Jun 25 '21 13:06 zivkaplan

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

  • Some snippets are cool and just need to be cleaned up and kept up to date (this means the sample wave needs to be renamed consistently to test_wav too).
  • Some (many?) can be removed, since they don't show any interesting functionality. For example, IIR_basic_test just isn't relevant anymore, the IIR class is official and documented, this example doesn't do anything interesting with it.
  • Some use features which are experimental and/or haven't been fully documented yet (anything to do with parametrization; the guitar amp is experimental also).

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 avatar Jun 25 '21 13:06 Quefumas

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.

Quefumas avatar Jun 25 '21 17:06 Quefumas