>>> def myFunc(): ... print "myFunc prints!" ... >>> def execFunc(function): ... function() ... >>> execFunc(myFunc) myFunc prints! >>>
Archive for the ‘Computers’ Category
Posted by Gasten on May 22, 2008
Posted by Gasten on March 8, 2008
minute/1000 => dur mm;
<<<mm/second>>>; // 0.060000
There you go.
Who said ChucK can’t be used for anything important?
Posted by Gasten on January 17, 2008
I’m reading this book, Singularity Sky by Charles Stross (Great book. Read it!). It’s a Hard Sci-fi set in a distant future.
Stross have mentioned a number of brands, scientists and organizations that we have today – Einstein, IBM, Dion, the UN to name a few.
Today I stumbled upon a passage that indicated to the reader that one of the main characters were some sort of member or supporter of a organization called “Free Hardware Foundation” and were GNU Couturier number 15.6.
Apparently the software is free, and the FSF is unnecessary. They are still working on free hardware, though. Actually, in the beginning of the book, the Chief Engineer is a bit worried about a couple of black boxes that he isn’t allowed to take apart which’s being installed on his ship.
On the frist page you can read that the author got a grad in Computer science and have been working as a software engineer, so it’s not all that unlikely that he is a bit of a free software guy. Nice.
Posted by Gasten on January 1, 2008
After discovering Fluxus, I’ve become more and more interested in 3D-graphics, been takin’ Blender for a spin and so on. This comes as quiet a surprise for me, since I’ve always thought that 3D was way hard (3 dimensions?! I’m struggling with only two!), and to use it, you had to implement garbage collection in C. Not my cup of tea, no.
Very well, I had some ideas that I wanted to try out that would be a bit inconvenient to do in Fluxus (bigger games), so I started to look for tools that could help me do what I wanted in Python, which is one of the only languages I feel really comfortable with, even if my biggest problem is that I haven’t worked with enough libraries yet.
After looking at python-wrappers for C-libraries like PyOpenGL and PyOGRE I found out about Soya. Absolutely amazing. I mean, Man…
You can do a simple 3d game in less than 300 lines of code. You can probably do a fun game in under 1 000. And when your project hits 10 000 lines, it still won’t feels scrambled and obfuscated (I believe – haven’t tried).
For those who think PyGame is easy – try soya. it’s way less difficult and focuses much less on boring things like micro management and rendering (It’s true!).
I took 15 minutes of my time to mod the “basic-5.py” tutorial to use my game controller instead of the keyboard. I really love my gamepad. The only thing I’m annoyed about is the lack of joystick standardness. Every application have to recreate some kind of joystick reconfiguration.
Oh well, I changed CaterpillarHead.begin_round() to:
for event in soya.process_event(): # Check for joystick axis events. if event == soya.sdlconst.JOYAXISMOTION: if event == 1: self.speed.z = event / 160000.0 # Up/Down elif event == 4: self.rotation_y_speed = -event / 6000.0 # Left/right # Pressing the escape or 'q' key will exit the main_loop mainloop, and thus terminate # the program. soya.MAIN_LOOP.stop() is the right way to end your application, and # causes the MainLoop.main_loop() method to return. elif event == soya.sdlconst.JOYBUTTONDOWN and event == 16: soya.MAIN_LOOP.stop() elif event == soya.sdlconst.KEYDOWN: if event == soya.sdlconst.K_q: soya.MAIN_LOOP.stop() elif event == soya.sdlconst.K_ESCAPE: soya.MAIN_LOOP.stop() elif event == soya.sdlconst.QUIT: soya.MAIN_LOOP.stop() # Do the rotation. self.rotate_y(self.rotation_y_speed)
By the way, round_begin() is the function that’s called on each tick, like a control rate for those who are into synth-development. There is also an advance_time() function which is called each frame.
(also, I’m not very proud of this implementation – in a real project I’ll process the joystick-value to have it in the range of -1 – 1, and not -30 000 something to 30 000 something. And I’ll make it less sensitive so whatever is controlled wont “nudge around” when an axis is on near-zero, but not zero-exact.
Posted by Gasten on December 10, 2007
I’ve managed to get my xbox360-controller to work with fluxus in a
effective manner by modifying the gamepad-script (read here), but it struck me that
I would have to do this modification to all fluxus-programs I want to
use. That’s more hassle than I can handle.
Therefore I contacted Jeremy Friesner who’s developing oscjoy (I’m using oscjoy to interface with my joystick),
and asked him if he could add axis and button-remapping to the program.
He could, and I’ve already tested the initial build, and it works great.
(It’s not yet up on the homepage, but Jeremy said that he should add it
in a week or so.)
So, there you got it. Solved The Proper Way. The open source model really works!
Posted by Gasten on December 4, 2007
I’d love to write more, but I’m too tired. Some of the results from todays fiddling is pasted at the end.
Boy, isn’t Scheme well suited for live coding? It’s very algorithmic, and you can develop fast and abstract. And it’s the most beautiful language out there (is in looking at code as if it was a picture)!
Boy, isn’t Scheme badly suited for live coding. It’s a pain to write, a pain to read, and hell of a pain to debug!
Was a lot harder than I expected, but I managed to hack a cool script for my Xbox360 which will ease joysticking. Pasted below.
I’ve also started to swap the keyboard-controls to joystick-control in the asteroids-example. Unfortunally I managed to break it a little a couple of minutes ago, so you will have to live without it for now.
Read the rest of this entry »
Posted by Gasten on December 4, 2007
Started to play around with Fluxus late last week. It’s absolutely great! I thought 3D-graphics was a lot harder than it really is (well, ok, both OpenGL and Fluxus takes lot of the blows. Glad I can fiddle around in 3D-space without brainfucking things like garbage collection).
Pretty soon I realized what I wanted to do: a abstract 3D-game that triggers sounds when stuff happens in-game (a bit like this by AlgoMantra). Also, and this is the exciting part, it should be livecoded as the player is playing.
I Haven’t really worked out all the details, but I Imagen it as a very bare-boned space-shooter (there is a asteroids-demo in the examples-directory which I’m gonna gut), that just got the very basic: joystick-support, it draws the gfx, and sends osc to something like puredata (it would be great if the audio would be livecoded as well). As the performance progress the coder will add more graphic, change the existing stuff, and manipulate the rules of both the game and physics. It should progress from some early 80’s tech-demo to some kind of Geometry War 3D-clone.
Yes, I’m gonna get a joystick for this project. I’ve wanted to buy one when I started with Chuck, already. In fact, I already bought it. Understood yesterday that I were free from school today (lazy place) so I went ahead and bought a Xbox360-controller with USB-out. Compiled the drivers and stuff, and it works great! It’s a bit sensitive, and there is some axis-noise, but I can live with that (I just make my code less sensitive).
Oh, yeah: the controller-mapping is totally fuckup. I blame Microsoft.
My aim is to have something that runs later today (hopefully in a state which I can show you).