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

Comments for Animusic

Return to Animusic

mjrb4mjrb4

2009/1/8

Nice idea, but after having a look at the code, it looks like there's a bug on this line: count1 = score[place1] + score[place1+2]; (And the equivalent with count2.) After a while left running the scenario, I was proven correct :P java.lang.ArrayIndexOutOfBoundsException: 800 at Xylophone.act(Xylophone.java:90) at greenfoot.core.Simulation.runOneLoop(Simulation.java:200) at greenfoot.core.Simulation.run(Simulation.java:129) Couple of other points - you do know you can use Greenfoot.getRandomNumber rather than Math.random? It's just simpler and doesn't require all the integer casting. Oh and you could reduce a lot of code duplication by cutting your act method down into a few seperate methods ;)
Thats not a bug, it just runs out of array to use, and so it complains. This is by no means the complete algorithm, i just wanted to get the ball motion correct. Having said that, I know there still is a lot of optimization to be done, especially on the sound playing part (I'm going to have a lot of sounds!). Thanks for the random! I only knew about a different class that you had to import, and i was feeling lazy
mjrb4mjrb4

2009/1/8

Ah fair enough :) The ball motion does work nicely even if the notes appear random! Incidentally, there might be a way round uploading loads of individual sounds, I'll see if I can throw a quick demo together of what I mean and upload it.
mjrb4mjrb4

2009/1/8

http://greenfootgallery.org/scenarios/535
A new version of this scenario was uploaded on Fri Jan 09 05:07:17 UTC 2009
A new version of this scenario was uploaded on Sat Jan 10 01:50:11 UTC 2009
A new version of this scenario was uploaded on Sat Jan 10 02:31:32 UTC 2009
A new version of this scenario was uploaded on Sat Jan 10 02:33:16 UTC 2009
A new version of this scenario was uploaded on Sat Jan 10 02:39:16 UTC 2009
mjrb4mjrb4

2009/1/10

Nice, I like the movement of the cymbals when they're struck.
A new version of this scenario was uploaded on Sat Jan 10 19:21:21 UTC 2009
A new version of this scenario was uploaded on Sat Jan 10 19:22:13 UTC 2009
mjrb4mjrb4

2009/1/11

That's perfect harmony eh? ;)
keeping in mind, that here, harmony merely means playing at the same time, at the same speed. :)
A new version of this scenario was uploaded on Mon Jan 12 01:30:10 UTC 2009
mjrb4mjrb4

2009/1/12

The animation of the strings is very smooth. I look forward to the music editor! Do you play an instrument by any chance? :)
Thanks! and yes i do, I'm a percussionist.
A new version of this scenario was uploaded on Tue Jan 13 02:57:17 UTC 2009
A new version of this scenario was uploaded on Tue Jan 13 04:09:12 UTC 2009
A new version of this scenario was uploaded on Tue Jan 13 04:20:23 UTC 2009
A new version of this scenario was uploaded on Sat Jan 17 21:23:22 UTC 2009
A new version of this scenario was uploaded on Sat Jan 17 23:59:00 UTC 2009
A new version of this scenario was uploaded on Sun Jan 18 00:47:15 UTC 2009
qnanqingqnanqing

2009/1/18

wow, what the difference between percussionist and drummer ?
Drummers are usually people who play drumset, percussionists are able to play any percussion instrument.
A new version of this scenario was uploaded on Sun Jan 18 17:18:24 UTC 2009
A new version of this scenario was uploaded on Sun Jan 18 17:58:22 UTC 2009
A new version of this scenario was uploaded on Tue Jan 20 04:58:50 UTC 2009
Unfortunately, The pop up prompt thing I'm using to input the songs does not allow copying of its displayed messages, so i had to be restricted to the console... :(
A new version of this scenario was uploaded on Thu Jan 22 21:44:04 UTC 2009
A new version of this scenario was uploaded on Fri Jan 23 00:38:55 UTC 2009
KartoffelbrotKartoffelbrot

2013/7/30

Very great, but it would be nice if the pages would be automatically gone trough, if you play the music, so that you don't have to play every page in single.
You can press a to animate the music you have made :)
Entity1037Entity1037

2013/7/31

Mind = BLOWN
KartoffelbrotKartoffelbrot

2013/7/31

Ok, I've pressed space, but this is awesome.
Entity1037Entity1037

2013/10/9

I just made a cool song off the top of my head (which I accidentally wrote in 3/4 time somehow), and it wont let me output to console on the website. DX
Entity1037Entity1037

2013/10/9

I should be able to save a song with "getUserInfo()"! Seriously, now I have to re-write the song (albeit a short one) directly onto the the exact same program but in my computer... DX
Busch2207Busch2207

2013/10/9

@ Builderboy: I recognized, you wrote new Thread() { public void run() { channel[instrument].noteOn(note, volume); try { Thread.sleep(0); } catch(InterruptedException ex) {} finally { channel[instrument].noteOff(note,50); } } }.run(); in the MidiPlayer-class. May you meant '}.start();' at the end? Because this Thread is a useless created object, isn't it?