top of page
Search
  • ncampanelli0

Assignment 4

Using object oriented programming in python, I made a simple music player. The bpm is controlled by the knob and is determined by the knob's value + a baseline value. In the code itself the baseline can be manipulated when calling the function, if not it is initialized at 80. The a button is to change what plays, making use of an array to store all the "tune" variables (as of right now that is the opening of tetris and 3 beeps) and keeping track of an integer variable to use as the argument for calling the array. The b button acts as a play/stop button. One thing I learned was that you can define a boolean and set it not equal to itself (boolean != boolean), I can already see this trick being useful in future programs I write, it is much less cumbersome then using if/else statements to manipulate an integer between 0 and 1.


link to code: https://repl.it/@ncampanelli0/microbit-simple-music-player

8 views0 comments

Recent Posts

See All

Final assignment (trivia project)

How I came to this idea for a project was simple. Back when I was in high school I made a trivia style game. This game was written for Windows Command Line (.bat file). The original program was quite

Assignment 9 (drawing program)

I made a drawing program with multiple colors that can be selected (with black being used as the eraser color as the background is black). I used an array to keep track of all the colors and used a fo

Assignment 8 (bug fixes)

change log: 1. Revised collision for ball to bounce off paddles properly (instead of requiring perfect pixel alignment with a sweet spot, which was the original collision detection. I figured out it w

bottom of page