Monday, May 16, 2011

It's been a while

OK,
didn't mean to quote Staind, but yeah, it's been a while since I wrote something here...

I've been trying to find more time to write stuff for games, but hey, life happens, got pretty sick, moved across the world, got better,...

So let's see, I am trying to finish a game for XNA these days, a simple game using a physics engine, I'll aim for both PC & XBox360 but we'll see if I can finish it, with all that is going on.

Regarding music, I've been enjoying video games lately in 5.1, it really gives you another dimension... it's funny how some games' music get your attention... like Fancy Pants, really cool stuff going there...

Even silly stuff like IloMilo makes me wonder how complicated it would be to create something like that....

Anyway,

I'll see if I can post more often and specially whatever I try to accomplish in Video games and music/sound.

Take care.

Friday, August 28, 2009

Audio and Music work

I am working on this Indy project adding Audio and Music, plus all the implementation with XAct, Torque and XNA.

I think it's going to be fun and it was about time I got back into Music and Audio for games.

This is the link for the project: Silver Age

I think Dan was right and I should really get involved in audio and music for games...

David

Wednesday, December 26, 2007

Dan Morris

My dear friend Dan Morris passed away on the 21st of December, he was working at Activision in Central Audio. I'll miss him immensely, he was a great guy and a musical genius.

I miss you man.

David.

Thursday, September 13, 2007

XNA & XAct sample

It's been a while, but here I am posting a very simple test program.
If you have 2 background cues, say ambience and battle, you could switch between them with this code.

Keep in mind that LoopEvent = Infinite only in the ambience and battle cues not in the transitions to and from ones.

Here is the code. If you want the exe and resources let me know and I"ll post it somewhere is some 20MB with my music.

This is my Game1.cs file

Code:
#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
#endregion

namespace MusicTransition
{
///
/// This is the main type for your game
///
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
ContentManager content;


public Game1()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
}


///
/// Allows the game to perform any initialization it needs to before starting to run.
/// This is where it can query for any required services and load any non-graphic
/// related content. Calling base.Initialize will enumerate through any components
/// and initialize them as well.
///
///
AudioEngine audioEngine;
WaveBank waveBank;
SoundBank soundBank;
enum GameStates { Ambient, Amb2Bat, Battle, Bat2Amb };
GameStates CurrentState;
Cue Ambient;
Cue Battle;
Cue Amb2Bat;
Cue Bat2Amb;

protected override void Initialize()
{
audioEngine = new AudioEngine("Content\\Audio\\MusicTran.xgs");
waveBank = new WaveBank(audioEngine, "Content\\Audio\\Wave Bank.xwb");
soundBank = new SoundBank(audioEngine, "Content\\Audio\\Sound Bank.xsb");
CurrentState = GameStates.Ambient;
Ambient = soundBank.GetCue("Amb");
Battle = soundBank.GetCue("Bat");
Amb2Bat = soundBank.GetCue("Amb2Bat");
Bat2Amb = soundBank.GetCue("Bat2Amb");
Ambient.Play();

base.Initialize();
}

///
/// Load your graphics content. If loadAllContent is true, you should
/// load content from both ResourceManagementMode pools. Otherwise, just
/// load ResourceManagementMode.Manual content.
///
/// Which type of content to load.

SpriteBatch ForegroundBatch;
SpriteFont CourierNew;
Vector2 FontPos1;
float FontRotation1;
Vector2 FontPos2;
float FontRotation2;
protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{
CourierNew = content.Load("Times");
ForegroundBatch = new SpriteBatch(graphics.GraphicsDevice);
}
FontPos1 = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, (graphics.GraphicsDevice.Viewport.Height / 2) - 50 );
FontRotation1 = 0;
FontPos2 = new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, (graphics.GraphicsDevice.Viewport.Height / 2) + 50);
FontRotation2 = 0;
}



///
/// Unload your graphics content. If unloadAllContent is true, you should
/// unload content from both ResourceManagementMode pools. Otherwise, just
/// unload ResourceManagementMode.Manual content. Manual content will get
/// Disposed by the GraphicsDevice during a Reset.
///
/// Which type of content to unload.
protected override void UnloadGraphicsContent(bool unloadAllContent)
{
if (unloadAllContent)
{
// TODO: Unload any ResourceManagementMode.Automatic content
content.Unload();
}

// TODO: Unload any ResourceManagementMode.Manual content
}


///
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input and playing audio.
///
/// Provides a snapshot of timing values.
protected override void Update(GameTime gameTime)
{
FontRotation1 += 0.001F;
FontRotation2 += 0.01F;

switch (CurrentState)
{

case GameStates.Amb2Bat:
{
if (!Amb2Bat.IsPlaying)
{
CurrentState = GameStates.Battle;
Battle = soundBank.GetCue("Bat");
Battle.Play();
}
break;
}
case GameStates.Bat2Amb:
{
if (!Bat2Amb.IsPlaying)
{
CurrentState = GameStates.Ambient;
Ambient = soundBank.GetCue("Amb");
Ambient.Play();
}
break;
}
}

if (Keyboard.GetState().IsKeyDown(Keys.A))// user trigered
{
switch (CurrentState)
{
case GameStates.Ambient:
{
Ambient.Stop(AudioStopOptions.Immediate);
Amb2Bat = soundBank.GetCue("Amb2Bat");
Amb2Bat.Play();
CurrentState = GameStates.Amb2Bat;
break;
}

case GameStates.Battle:
{
Battle.Stop(AudioStopOptions.Immediate);
Bat2Amb = soundBank.GetCue("Bat2Amb");
Bat2Amb.Play();
CurrentState = GameStates.Bat2Amb;
break;
}
}
}
// Allows the game to exit
if (Keyboard.GetState().IsKeyDown(Keys.X))
this.Exit();

// TODO: Add your update logic here

base.Update(gameTime);
}


///
/// This is called when the game should draw itself.
///
/// Provides a snapshot of timing values.
protected override void Draw(GameTime gameTime)
{
if(CurrentState == GameStates.Ambient)
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);
else if (CurrentState == GameStates.Amb2Bat)
graphics.GraphicsDevice.Clear(Color.Purple);
else if (CurrentState == GameStates.Battle)
graphics.GraphicsDevice.Clear(Color.Red);
else
graphics.GraphicsDevice.Clear(Color.BlueViolet);
ForegroundBatch.Begin();

// Draw Hello World
string output = "© 2007 David Cortés Provencio, Software and Music.";

// Find the center of the string
Vector2 FontOrigin = CourierNew.MeasureString( output ) / 2;
// Draw the string
ForegroundBatch.DrawString( CourierNew, output, FontPos1, Color.White, FontRotation1, FontOrigin, 1.0f, SpriteEffects.None, 0.5f );

output = "Press 'A' to transition and 'X' to exit";

// Find the center of the string
FontOrigin = CourierNew.MeasureString( output ) / 2;
// Draw the string
ForegroundBatch.DrawString( CourierNew, output, FontPos2, Color.Black, FontRotation2, FontOrigin, 1.0f, SpriteEffects.None, 0.5f );

ForegroundBatch.End();


base.Draw(gameTime);
}
}
}

Thursday, June 07, 2007

more XNA

Hey,still here, I just found a couple of nice tutorials from the XNA team:
Enjoy.

Tuesday, October 31, 2006

Another blog

It's been a while, but here is another link for Film music this time

Wednesday, September 13, 2006

Gamefest stuff

Check the audio link here: