This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

kevv
kevv presents ...

2012/10/28

Lab 3 - Music is fun

Plays sound with the keys 1-7 and the mouse
Background image from Garageband for iOS
All comments are welcome, especially suggestions on how to make the code look more correct.

3661 views / 10 in the last 7 days

4 votes | 0 in the last 7 days

Tags: simulation with-source

open in greenfoot
Your browser does not support the canvas tag.
SPowerSPower

2012/10/31

You used the image from garageband for iOS....
kevvkevv

2012/11/1

Sorry if that is bad. Just googled drums and found a suitable one. I'll send an email and ask if it is ok with them. :)
militantmilitant

2012/11/1

the lower 3 are wrong though.. d snare is at at the left but u have its sound on the right, the base is in the middle but u have its sound on the snare, and d sound u have on the bass is from the one on the right.
kevvkevv

2012/11/1

I know, I added the sounds in a rush. Main goal was to do the code as required.
A new version of this scenario was uploaded on Thu Nov 01 09:18:06 UTC 2012 Opened the code
A new version of this scenario was uploaded on Fri Nov 02 09:25:42 UTC 2012
lonely.girllonely.girl

2012/12/12

Can u plz explain this part of your code for me? I understand that it's the delay for the loop but what does >0 then delay -- ??? private void delay() { if (delay > 0) { delay--; } if (delay == 0) { play(); delay = 15; } }
kevvkevv

2012/12/15

if delay is bigger than 0 it decreases by one. it keeps on doing it until delay equals 0. then the sound method plays and the value of delay is set to 15 again.

Want to leave a comment? You must first log in.

Who likes this?

davemib123 lonely.girl SSS militant