I'm making a little program to help me practice pitch matching.
The idea is to present a note for 4 seconds and count the time until I sing it in pitch.
I'm producing the note like this:
from mingus.containers import Note, Bar
from mingus.midi.fluidsynth import play_Bar
from mingus.midi.fluidsynth import init as initialize_synthesizer
sf2_file = '/usr/share/sounds/sf2/FluidR3_GM.sf2'
sound_device = 'alsa'
initialize_synthesizer(sf2_file, sound_device)
def main():
note = Note("C-3",
velocity=127)
bar = Bar()
bar.place_notes(notes=note,
duration=1)
play_Bar(bar=bar,
bpm=60)
if __name__ == '__main__':
main()
The problem is that the note's volume decreases with time. As it will be used as reference, the volume would ideally be constant. Is there a way to do it?