Nice! And here I thought all it played was music, not video games from the dawn of creation! Just joking...I don't play piano very well but I can pick stuff out, if I get enough tries.
Oldschooler2 - There are no arrays in Scratch the way there are in most other languages. So in this project I'm storing the data on the screen, you can see it as a bunch of little black dots in the lower left corner, after you play some notes. Then, when you ask it to play back the notes, I read the dots and convert them back into numbers and use those to play the note. You work with what you have...
I simply love the idea of broadcasting certain patterns to "store data". Perhaps you could create invisible "patterns" to store data. Would you like to join my "sensing and broadcasting" club?
I agree. Storing arrayed data on screen is almost like handling the mouse pointer as a "sprite" in the graphics memory in the olden days..., It was cool back then, and still is!
Thanks, Jens. Screen array, huh? That's a pretty good term, I like it. It's pretty much the only way to store array data that I've been able to come up with. Maybe someday they will implement variable arrays. I'm kind of torn on that...it's good to keep the language simple for the beginners. But it's also nice to be able to do more complicated things. The best of both worlds would be to have the more complicated features hidden, maybe accessed by a "turn on advanced features" option in the extras menu.
This is a rewrite of my Recording Piano project with more structured code and new features including the ability to manually tweak note duration.
A piano that can play back what you just played (up to about 480 notes!). When you press a key, the note duration and pitch are coded in binary and written to the bottom of the screen. When you play it back, that information is read by a sprite and converted back to the original numbers.
Thanks to Kevin_Karplus for the keyboard sprite and key reading logic.
Comments
You need to be logged in to post comments
Add a Comment
no not funny
(view all replies)Comment Reply
Never thought I could play Mortal Kombat on an online piano
(view all replies)Comment Reply
Nice! And here I thought all it played was music, not video games from the dawn of creation! Just joking...I don't play piano very well but I can pick stuff out, if I get enough tries.
(view all replies)Comment Reply
THERE ARE 26 VARIABLES!!!
(view all replies)Comment Reply
I play piano, so I played the Entertainer and the Can-Can
(view all replies)Comment Reply
That was pretty good i dont think that i could ever make something like that!
(view all replies)Comment Reply
thats great! i love it!
(view all replies)Comment Reply
Oops, I meant to say a similar way of storing and retrieving data.
(view all replies)Comment Reply
I used a similar format in the make-a-maze application at: (link to project) to draw out the maze based off of what was drawn on the grid.
(view all replies)Comment Reply
can u make me a game please please please please. i gotta make a game n i dnt knw how to do it please
(view all replies)Comment Reply
Sick nasty!
(view all replies)Comment Reply
:) this program really likes me :) congratulations, very sharp, and easy to play
(view all replies)Comment Reply
Oldschooler2 - There are no arrays in Scratch the way there are in most other languages. So in this project I'm storing the data on the screen, you can see it as a bunch of little black dots in the lower left corner, after you play some notes. Then, when you ask it to play back the notes, I read the dots and convert them back into numbers and use those to play the note. You work with what you have...
(view all replies)Comment Reply
this must use arrays to store data, right?
(view all replies)Comment Reply
I simply love the idea of broadcasting certain patterns to "store data". Perhaps you could create invisible "patterns" to store data. Would you like to join my "sensing and broadcasting" club?
(view all replies)Comment Reply
Gr8 idea! So cool!
(view all replies)Comment Reply
Cool Paddle2See! I agree with Jens comment.
(view all replies)Comment Reply
I agree. Storing arrayed data on screen is almost like handling the mouse pointer as a "sprite" in the graphics memory in the olden days..., It was cool back then, and still is!
(view all replies)Comment Reply
Thanks, Jens. Screen array, huh? That's a pretty good term, I like it. It's pretty much the only way to store array data that I've been able to come up with. Maybe someday they will implement variable arrays. I'm kind of torn on that...it's good to keep the language simple for the beginners. But it's also nice to be able to do more complicated things. The best of both worlds would be to have the more complicated features hidden, maybe accessed by a "turn on advanced features" option in the extras menu.
(view all replies)Comment Reply
Excellent and very useful implementation of a screen-array in Scratch!
(view all replies)Comment Reply