salu133445 / muspy

A toolkit for symbolic music generation
https://salu133445.github.io/muspy/
MIT License
435 stars 51 forks source link

Allow to configure default values globally #30

Open salu133445 opened 3 years ago

salu133445 commented 3 years ago

Currently, setting muspy.DEFAULT_VELOCITY = 100 does not affect muspy.classes.DEFAULT_VELOCITY (still 64). As a result, a newly-created Note(time=0, pitch=60, duration=1) still has a default velocity of 64. We should find a better way to configure these default values globally. One possible way is to store the configuration in a dictionary and provide a function for the users to modify these default values at runtime, pretty much like matplotlib.rcParams (the dictionary) and matplotlib.rc (the function).

cifkao commented 3 years ago

And matplotlib.rc_context, the context manager.