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 - Mind Calamity

Pages: [1]
1
Audio / Spectrum (Analysis)
« on: November 20, 2011, 05:08:39 pm »
Quote from: "Laurent"
What have you already tried?

As I have no idea where to start, I haven't tried anything, I'm currently searching for an "easy" way to use FFTW, by easy I mean under 300-500 lines properly written/formatted/understandable code, after that I'm planning to actually try to compile FFTW, as it's primary platform seems to be GCC and Linux, it's not that straight-forward to compile it on Windows.
(Everyone should start using CMake IMO)

Quote
FFTW is the most popular library for FFT. What's the problem with C? I think it's ok for low-level libraries that provide very precise functionality. It's not as if we were talking about a full game framework ;)


The problem with C is, it's not C++ (which I'm used to, and am probably too lazy to drop my habits).

Quote from: "Laurent"
What don't you understand exactly? We're not going to write the full code for you ;)


That's obvious, so I wasn't expecting it. ;)
As for what I don't understand, I haven't tried much, yet, but I'm going to give FFTW a try now, if I encounter any trouble on my way of using the both libraries together, or actually succeed in it, I'm going to report back with code and a detailed explanation on the problem/solution.

In the mean time, if anyone has some code from their previous/current project, feel free to donate, if you feel like it.

Whoops, I failed to notice that FFTW was GPL, so it's out of the question, FFTReal remains, and is under the WTFPL, and I think it will suffice, once I figure out how to use it.

Update: FFTReal is used in the Qt spectrum demo, time to try and adapt it to SFML.

2
Audio / Spectrum (Analysis)
« on: November 20, 2011, 04:29:43 pm »
So, I've been trying to make an application that needs spectrum analysis, and not paying $200+ (or 6000 in the case of FMOD), so after a bit of researching I concluded that SFML will probably be the best choice for me, so now the problem is: How ?

I have no idea how to do it, all I know is I need to implement the FFT algorithm and use it with the sound buffer samples, or so I read in a thread similar to mine, to be precise it said:

 
Quote
1. Get playing offset
2. Get small amount of samples starting from that offset
3. Use FFT on those samples
4. Visualize


Does anyone have any idea how to do that ?

I've been thinking of using FFTW for FFT, but it's C, which I don't really like, and it seems like it's pretty tricky to compile with VS, I also found FFTReal, which is C++, but I still have no idea how to use it, as it has no tutorials, nor documentation, so yeah...

I'm open to suggestions, also if anyone is going to suggest another library, I need it to be free for commercial use.

3
Audio / Playing a sound without a while loop ?
« on: November 20, 2011, 03:21:12 pm »
Well, that worked, I put it into a pointer, thanks for the tip, and the quick reply.

Here's the working code:

Code: [Select]
sf::Music* Music = new sf::Music();
Music->OpenFromFile(song);
Music->Play();

4
Audio / Playing a sound without a while loop ?
« on: November 20, 2011, 02:20:25 pm »
Um.. This is probably a stupid question, but the tutorials use a while loop which seems to play the sound (by checking it's status ??), and removing that stops the audio from being played...

So, how exactly should I go about playing sounds ?

In other words... This works:
Code: [Select]

sf::Music Music;
        // char* song = "D:\\song.ogg";
Music.OpenFromFile(song);
Music.Play();

        // Without the line below it doesn't work...
while (Music.GetStatus() == sf::Music::Playing) {}


And it also prevents anything else to be executed before the sound/music ends playing.
[/code]

5
General discussions / 2.0 Tutorials
« on: October 04, 2011, 03:48:18 pm »
Quote from: "Laurent"
Quote
I have no idea how the joystick works, so I did the joystick lines randomly, with the closest new function I could find

So you wanted to help other users with incorrect random lines of code? :shock:


I just wanted to help, I was going to add a comment stating that those lines aren't necessarily correct, but I forgot, I'm going to add them now.

BTW - I believe most users don't really have Joystick (again a random guess), so I don't think that is going to be much of a problem, but then again I put a warning in the code.

6
General discussions / 2.0 Tutorials
« on: October 04, 2011, 03:07:46 pm »
Quote from: "Laurent"
Quote
Code: [Select]
     int          JoystickX       = sf::Joystick::X;
      int          JoystickY       = sf::Joystick::Y;
      int          JoystickPOVX    = sf::Joystick::PovX;
      int          JoystickPOVY    = sf::Joystick::PovY;

This code isn't doing anything useful, sf::Joystick::X (and Y, PovX, PovY) are constants that must be used as axes identifiers in sf::Joystick functions.

Seriously, you shouldn't do that. You'll waste a lot of time, you'll make mistakes (I won't correct everything), and in a few weeks the official tutorials for 2.0 will be there.

There's already a thread that gathers all the API changes:
http://www.sfml-dev.org/forum/viewtopic.php?t=5343


I have no idea how the joystick works, so I did the joystick lines randomly, with the closest new function I could find, but anyway I'm not going to do any more tutorials, since you're going to make them (probably better) soon anyway.

7
General discussions / 2.0 Tutorials
« on: October 04, 2011, 01:45:17 pm »
Quote from: "Laurent"
Quote
Code: [Select]
sf::Keyboard   keyboard   = sf::Keyboard();
sf::Mouse      mouse      = sf::Mouse();
sf::Joystick   joystick   = sf::Joystick();

Althought this code works, it is misleading. One is not supposed to instanciate these classes, all their functions are static.


Thanks for the note, I updated the post and added the full source, which I forgot at first.

8
General discussions / 2.0 Tutorials
« on: October 04, 2011, 01:25:52 pm »
Quote from: "Laurent"
Do it if you want, but don't forget that I'll update them soon. And I won't just update the source code, I'll rewrite almost all of them.


Well, that might be the case, but until then, it's nice to have an alternative resource. As I'm reading through the tutorials, it won't hurt to post and updated version of them.

Besides, I have lots of free time today, and I'm planning to focus it on SFML.

9
General discussions / Tutorial - Window - Handling Events
« on: October 04, 2011, 01:24:31 pm »
Deleted by Laurent, the "tutorial" was full of mistakes. It was confusing and didn't help at all.

10
General discussions / 2.0 Tutorials
« on: October 04, 2011, 12:33:54 pm »
So, I think that the tutorials need updating, as the API has changed a bit for the next version.

I will update only the tutorials that contain source from the updated API, I will leave out the ones that are still working.

(I'll post the tutorials as replies to this one.)

Pages: [1]
anything