Synthesizer
- 2 Devlogs
- 5 Total hours
The idea behind this is project is to create a virtual synthesizer by having an .wav of a single note, in this case C Major, and with it, by scaling the pitch, creating all the other notes.
The idea behind this is project is to create a virtual synthesizer by having an .wav of a single note, in this case C Major, and with it, by scaling the pitch, creating all the other notes.
From the last devlog, I have been working on the GUI of the synthesizer. For now it looks pretty promising and I lile how it is going. I have made the synthesizer work and now you click on the notes and the sound lasts two seconds.
The high pitched sounds don’t sound like the piano though…but I’m not sure how to work that out yet.
What was the hard part from the last update wasd making the buttons change colour once clicked. Since they are not part of any class or struct, I have to draw them again in different colour once they are clicked and again in the original colour two seconds later. For that I use a matrix which serves as a memory, which works fine for now, which holds the time when the button was clicked and its position so it can be drawn again.
Currently I have imported the .mp3 file of the C major note onto python and have read it’s contents. And here is the plot of the sound itself.
One part of the code currently reads from your terminal which note you want to play, for example “A4”, and it scales the C major note to that pitch and plays it. After that there is a low-pass filter to clear the frequencies over 4500Hz, mainly to make the notes of higher octaves sound cleaner and like piano notes and not banjo.
I have started to copy the final products from a jupyter notebook to a python file because I want to create a GUI so the user can actually click the note to play, like a little piano.