Showing posts with label powerglove. Show all posts
Showing posts with label powerglove. Show all posts

Thursday, 31 May 2007

Studio power gloving!



This is a short footage of my band Simmetry jamming on a space-rock theme, letting me improvise with the power glove!

It's our first attempt in composing something around the new instrument; not so simple to handle, difficult to keep in tune and complex to use due to the slight delay.

Maybe some further effect will give him an additional gear. Cool and scenographic, anyway!

Monday, 19 March 2007

MIDI Power glove, toward live performance



Introduced distortion and location-controlled bandpass filters. It's really more alienish now. There's a little jitter I can't explain - gotta remove it.

My excuses for the overall quality of the video, but SBlive's converters are really poor: I used to route the signal into the M-delta, but this time I had to capture on the shitty one.




Last week I tried the glove in studio with my band, and the results are promising. I do think it needs only two more refinements: a better bounds detection routine and some kind of instant silencer gesture. :)

Thursday, 1 March 2007

OpenAL hello world!


OpenAL are for audio what OpenGL are for video: a cross-platform, and open source, set of API useful for creating a realistic tridimensional audio environment.

Exactly like OpenGL, they're easy to learn and well documented. They don't handle MIDI yet, therefore I used them only to play samples, triggered by the numerical pad on the wrist of powerglove.

I quit using playsound() Windows primitive for it is too cheap: no multibuffering, no pitch control, no positioning... just playing. Instead, I wanna play several alien-related noise at a time, launch drum loops and so on.

So, let's see how to play something. First, you have to download OpenAL SDK, libraries and documentations from the official site. Once installed, link libraries to your project and put the headers in your code (al.h, alc.h, alut.h).

Then, simply:

alutInit(NULL, NULL);

to erase any pending AL process. Now, we have to open a sound device and, for any device, we must define a "context" to place the sounds in. We can make this by coding:

ALCdevice* device;
ALCcontext* context;
device = alcOpenDevice(NULL);
context = alcCreateContext(device, NULL);
alcMakeContextCurrent(context);
alGetError();

alGetError() returns AL_NO_ERROR if opening procedure went ok. If it happened, we have correctly initialized OpenAL. Done this, it's time to place a listener (imagine Doom - it's the spacemarine!); listener has 3 important features: a position, a velocity and an orientation. Every parameters help OpenAL to render sounds, as it happens in OpenGL environment. They're very similar as approach.

ALfloat ListenerPos[] = { 0.0, 0.0, 0.0 };
ALfloat ListenerVel[] = { 0.0, 0.0, 0.0 };
ALfloat ListenerOri[] = { 0.0, 0.0, -1.0, 0.0, 0.0, 0.0 };

alListenerfv(AL_POSITION, ListenerPos);
alListenerfv(AL_VELOCITY, ListenerVel);
alListenerfv(AL_ORIENTATION, ListenerOri);

Check out documentation for the meaning of every floating-point value. Now it's time to load a wave file in memory, decant it into a buffer to be used by OpenAL routines and launch it.

ALuint Buffer;

ALenum formato;
ALsizei dimensione;
ALvoid* dati;
ALsizei frequenza;
ALboolean loop;

alGenBuffers(1, &Buffer);
alutLoadWAVFile(percorso, &formato, &dati, &dimensione, &frequenza, &loop);
alBufferData(Buffer, formato, dati, dimensione, frequenza);
alutUnloadWAV(formato, dati, dimensione, frequenza);

It's very clear what happens: we generate a buffer, load the wave into the buffer catching informations, load the wave into the generated buffer, and unload wave from memory.

Finally, we have to bind the buffer to a source and play it:

/* generate source */
alGenSources(1, &Source);

/* place it */
ALfloat SourcePos[] = { 0.0, 0.0, 0.0 };
ALfloat SourceVel[] = { 0.0, 0.0, 0.0 };

/* options */
alSourcei (Source, AL_BUFFER, Buffer );
alSourcef (Source, AL_PITCH, 1.0f );
alSourcef (Source, AL_GAIN, 1.0f );
alSourcefv(Source, AL_POSITION, SourcePos);
alSourcefv(Source, AL_VELOCITY, SourceVel);
alSourcei (Source, AL_LOOPING,
loop);

/* riproduco sorgente */
alSourcePlay(Source);

You're done. It's really that simple. Amazing!

Saturday, 24 February 2007

Sometimes... they come back!



We meet again, powerglove!!

I turned it microtonal, lowered MIDI latency through a better sound card, introduced modulation and exponential volume control. It's starting to kick some serious ass!!