Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - SamuraiCrow

Pages: 1 2 [3]
General discussions / FindSFML for CMAKE
« on: January 28, 2009, 10:38:08 pm »
It worked fine under XCode 3.1.2 on MacOSX 10.5.6.

General discussions / C# and SFML for OS X (and iPhone)
« on: January 20, 2009, 08:29:24 pm »
Does C# even run on the iPhone?  I didn't think the iPhone ran .NET at all.  I'm sure there isn't a micro edition of Mono capable of running on handhelds.

In short, I think it's safe to say that the iPhone doesn't run C#.

General discussions / Handling Game Events? (quests etc.)
« on: January 17, 2009, 08:06:41 pm »
LUA is the most popular way to do it but using LUA as a scripting engine isn't the only way.

Here's how to implement coroutines in C/C++ (assuming statevar is an enum of states):

Code: [Select]

  case AT_DOOR:
    if (has_key==true)
       message("You need a key.");
  case DOOR_OPEN:

Keep in mind that this will probably execute once per game loop and there may be multiple states that need to be used.  If that's the case, you can try to pack them bitwise into an int or a long long and use that as your state variable instead.  Also remember, if there are multiple ways to trigger an event, you can put multiple case statements on the same section of code (assuming you're not using .NET).


Ping-pong looping will have to be converted to standard looping by doubling the length of the sample and making the second half reverse order.  It wastes memory but it will work.


I've written a primitive music compiler for the old Amiga computers and I'd like to port it to SFML as cross-platform portable code.  This will allow the embedded stand-alone music code to link itself in to the host executable and avoid the overhead of a complete music file interpreter.

I've seen in the MIDI thread under the Audio help forum that there is a demand for something like this but it is difficult to implement.

What I need to know is does OpenAL Soft allow me to enqueue a looping sample after a non-looping one?  What about a looping sample that alternates between playing frontward and backward?  (This is also known as "Ping-Pong" looping.)  These are all techniques that will be required to make an OpenAL Soft version of MIDI or Music Modules.

Please let me know what you think about this idea.

Audio / Is there an event trigger when sound done playing?
« on: January 14, 2009, 02:39:06 am »
Update:  Examining the example source on the OpenAL Soft website revealed that OpenAL Soft does indeed queue samples when streaming.  I'll have to see what can be done to make a musical instrument class.

Audio / Is there an event trigger when sound done playing?
« on: January 12, 2009, 02:14:13 am »
Here's a thought:  streamed audio requires a seamless enqueue of samples in order for there to be no skips between the buffers.  If this could be done in parallel on 32 voices playing at the same time, then it would be a practical means by which I could implement my instrument playback.

Audio / Is there an event trigger when sound done playing?
« on: January 11, 2009, 03:30:14 am »
I'm afraid that won't work.  I'd need a pausable clock for each of 32 voices playing at the same time and a precise way to switch samples as soon as any one of them is done playing.

The idea is that most of the instruments in music module formats have a portion of the sample that doesn't loop followed by a portion that does.  Sometimes the loop requires the computer to reverse the playback direction at the end of the loop and then resume forward playback at the beginning of the loop.

Perhaps I should have posted this in the Feature Requests forum.

Audio / MIDI support
« on: January 10, 2009, 09:24:32 pm »
I'm thinking of porting a music-to-code converter so that music files can be compiled all the way down to machine language using raw event triggering mechenisms and coroutines in C++.

I've already written a working prototype in C and it works on AmigaOS using the Audio Hardware Interface (AHI) drivers on that operating system.  I would like to write a better one based on the file loaders from MikMOD (LGPL) and using my own instrument handlers.  I want to make the instrument handling with a more liberal license than LGPL so that the output C++ code can be linked into the source of a game and will not produce rip-able music, only instrument samples.

Once I've gotten the MikMod version of the compiler complete, I can work on a MIDI-compatible version as well.

See my other thread for details.

Audio / Is there an event trigger when sound done playing?
« on: January 10, 2009, 08:51:41 pm »
I was just thinking about writing a traditional music file player (such as the old FastTracker 2 file format) in SFML.  I was looking for a way to trigger an event or some other type of hook when a sound finishes playing.

This would be useful because I need to implement a looping sample after a sample that is not looped is done playing in order for the instrument sound to be complete.  Also, the .XM file format supports what is called "ping-pong" looping where the sound playback is reversed (negative frequency on some sound cards) at the beginning and end of a looping sample.

It may be possible to do some of this already using threads but I'm not that familiar with threading.

Pages: 1 2 [3]