DrMarc / slab

python classes for working with sounds and conducting psychoacoustic experiments
MIT License
22 stars 7 forks source link

level parameter #30

Closed DrMarc closed 3 years ago

DrMarc commented 3 years ago

!>> the separation of level from other parameters is odd, i would expect to be able to do slab.Sound.pinknoise(duration=0.5, level=60) in addition to setting it as a property after instantiation. seems like it would be a good idea to add a **kwargs to the @staticmethods that gets passed on to the Sound init method, if eg. a level is supplied it can be set there. would make maintainability of class-level features a bit easier.

OleBialas commented 3 years ago

I agree - we are setting the level in each sound generating method anyways so it would only be a minor change. I think we should handle the level in the same way we handle the sampling rate in that it defaults to None which uses the global default level. Should I implement this?