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

Comments for MusicVisualizer

Return to MusicVisualizer

spacebluespaceblue

2011/1/17

java.security.AccessControlException: access denied (java.io.FilePermission sound.wav read) java.lang.NullPointerException at world.act(world.java:58) at greenfoot.core.Simulation.actWorld(Simulation.java:509) at greenfoot.core.Simulation.runOneLoop(Simulation.java:452) at greenfoot.core.Simulation.runContent(Simulation.java:199) at greenfoot.core.Simulation.run(Simulation.java:187)
Aww I can't access my own files?? Hmmmmm
bournebourne

2011/1/17

Cool i will download this and see how it works :)
Doesn't seem to work on the gallery though :/ I can't figure out how to get the permissions to work
bournebourne

2011/1/17

ha I got something interesting working from what you got here. Stinks its not working on gallery.
Yeah :/ there must be a way to get around this...
So I know that I can use BufferedReaders to ready *text* from files within the Applet, but I don't know quite how to expand that to bytes...
PiRocksPiRocks

2011/1/18

int Reader.read() gets a 4 byte 2's compliment integer (also known as an "int" :) using the bitwise and operator, and then shifting, you can extract each of the four bytes such as given integer i, (i&0x00FF0000)>>>> Of course you can also just convert them normally. I'm not sure if this is as accurate though.
PiRocksPiRocks

2011/1/18

I just remebered something: getClass().getResourceAsStream("filename goes here(relative to class file)") should work on applets. The InputStream returned supports the availabe() and read(byte[]) methods that you are using
excelent! Thank you so much :D
A new version of this scenario was uploaded on Tue Jan 18 01:31:37 UTC 2011 Changed to work in the gallery
Hmmm still something is not quite working
PiRocksPiRocks

2011/1/18

hmmm 2 things: 1. how do you see the terminal 2. why are some comments big and others small? I know, they are totally unrelated...
PiRocksPiRocks

2011/1/18

never mind, I figured it out
A new version of this scenario was uploaded on Mon Jan 30 23:45:03 UTC 2012 Fixing the galler issues, as well as updating the player such that it doesn't have to preload the entire sound file into an array
Blarg, it seems RandomAccessFile doesn't work in applet form >.< Writing this without random access would be a real pain.
A new version of this scenario was uploaded on Thu Feb 02 06:24:01 UTC 2012 Working in the Gallery now hopefully!
nope not quite yet :/ Still some issues to iron out
sp33dysp33dy

2012/2/2

Looking much better! Seeing lines, although they seem to be a little out of step with the track. Where did you get the track by the way? What's it called and who by?
Yeah there is still some issues with the file reading which is causing it to get off the track under certain conditions. As for the music, it is called Earth Mover and it's by me :D
sp33dysp33dy

2012/2/2

are there no ends to your abilities??? I was going to go look for other tracks by whom ever had written it.. Lol
craigvcraigv

2012/2/2

cool, although when you pause the execution, i find the music still plays on.
Haha I can provide you with a couple high quality files of some of my other work if you like? Also yeah the music does keep playing, it is actually a bit easier that way XD The visualization should still be correct if you press play again though (if it was actually working in the Gallery in the first place that is)
A new version of this scenario was uploaded on Thu Feb 02 18:38:49 UTC 2012 Changed to a radial list based buffer to fix Gallery issues
sp33dysp33dy

2012/2/2

I might take you up on that offer later. However, to be sure you know (heading to bed). The visualiser worked for me from the Gallery!!
I'm pleased ^^ Finally got this to work after all those annoying problems >.<
b321234b321234

2012/2/5

OMG Now there's a bullet limit???? OH NOOOO (Okay)
b321234b321234

2012/2/5

Wait.... Posted at the wrong place :D I thought I clicked the nightmare game XD
Lol yep finally added ammunition in Nightmare >:D Ration your bullets!
AceticAcidAceticAcid

2012/10/6

You are not Builderboy. You must be Buildergenius!
JetLennitJetLennit

2013/4/28

Like the program, love the song!
JetLennitJetLennit

2013/4/28

^Love the program