SA-MP Forums Archive
[Plugin] BASS Spectrum Analyzer [v0.14] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] BASS Spectrum Analyzer [v0.14] (/showthread.php?tid=316861)

Pages: 1 2 3 4


BASS Spectrum Analyzer [v0.14] - Scott - 08.02.2012

BASS Spectrum Analyzer


This plugin utilizes the BASS audio library to return a FFT representation of an audio stream. Use at your own risk, it is not threaded and will cause delays to the main thread when starting audio streams.

Natives/Documentation:
Most natives return 1 on success, 0 on failure, use BASS_ErrorGetCode() to get failure reason
Code:
native BASS_Init();
native BASS_Free();
native BASS_PlayStream(url[]); // Returns the handle ID created
native BASS_StopStream(handle);
native BASS_ErrorGetCode();
native BASS_ChannelGetData(handle, Float:buffer[], length); //Note: length does not match documentation syntax, see include for which are defined
native BASS_ChannelGetLevel(handle, &left, &right);
native BASS_ChannelGetLength(handle); // Returns channel length in seconds
Examples:
Examples provided are meant to be proof-of-concepts, they would not be realistic to use in a production environment due to the high amount of bandwidth required. Try on a local server.

FFT Laser - https://github.com/h02/SA-MP-BASS-Sp...pect-laser.pwn
A video using the same concept (but a different library at the time):
http://*********/yMc4dm9QeME

FFT Bars: https://github.com/h02/SA-MP-BASS-Sp.../spect-bar.pwn
http://i.imgur.com/UNiay.jpg

Levels: https://github.com/h02/SA-MP-BASS-Sp...pect-level.pwn

Particles/Fireworks: https://github.com/h02/SA-MP-BASS-Sp...-particles.pwn
(The most suitable example of what could be used on a live server.)

You have all the data made available from the library function so you could probably make something much cooler than what I did, and something that would actually work in a production environment.

Download: BASS Library Source: http://www.un4seen.com/bass.html


Re: BASS Spectrum Analyzer [BETA] - Gamer_Z - 08.02.2012

Not really well explained...
Quote:

//create the laser array at pershing square (lspd)

...
u mean:

?

Any screens?
and what's it usefull for, if you consider it usefull... ;o?


Re: BASS Spectrum Analyzer [BETA] - Scott - 08.02.2012

Quote:
Originally Posted by Gamer_Z
View Post
Not really well explained...

...
u mean:

?

Any screens?
and what's it usefull for, if you consider it usefull... ;o?
Here's a video I made using the same concept (but a different library at the time):
[ame]http://www.youtube.com/watch?v=yMc4dm9QeME[/ame]

You have all the data made available from the library function you could probably make something much cooler than this.


Re: BASS Spectrum Analyzer [BETA] - Gamer_Z - 08.02.2012

Quote:
Originally Posted by h02
View Post
Here's a video I made using the same concept (but a different library at the time):
http://www.youtube.com/watch?v=yMc4dm9QeME

You have all the data made available from the library function you could probably make something much cooler than this.
why not point the lasers to the ground and adjust the Height(Z coords)? Looks awfull . Like you're trying to scare a monster away.

However the idea of this plugin is funny (but I think there's non need to analyze sound, just do some random Z adjustments and voila we got a pseudo bas analizer)


Re: BASS Spectrum Analyzer [BETA] - Scott - 08.02.2012

Quote:
Originally Posted by Gamer_Z
View Post
why not point the lasers to the ground and adjust the Height(Z coords)? Looks awfull . Like you're trying to scare a monster away.

However the idea of this plugin is funny (but I think there's non need to analyze sound, just do some random Z adjustments and voila we got a pseudo bas analizer)
The example I made isn't very practical due to the high amount of updates (40*28 updates per second at most.) However it would be possible to make a good one using a less amount of objects and running at only 1-2hz if you were clever.


AW: BASS Spectrum Analyzer [BETA] - Drebin - 08.02.2012

Holy cow! Amazing work


Re: BASS Spectrum Analyzer [BETA] - Ricop522 - 08.02.2012

Great work


Re: BASS Spectrum Analyzer [v0.1] - Scott - 09.02.2012

Added:
Code:
native BASS_ErrorGetCode();
native BASS_ChannelGetLevel(&left, &right);
Examples updated.


Re: BASS Spectrum Analyzer [v0.1] - Scenario - 09.02.2012

Very cool.


Re: BASS Spectrum Analyzer [v0.1] - Niko_boy - 09.02.2012

This is a wonderful release!


Respuesta: BASS Spectrum Analyzer [v0.1] - junkbuster - 09.02.2012

Perfect release, I have always been waiting for something like this, excelent job.


Re: BASS Spectrum Analyzer [v0.1] - Lorenc_ - 09.02.2012

Great, though what could this even be used for?


Re: BASS Spectrum Analyzer [v0.1] - T0pAz - 09.02.2012

What's the use of this plugin?


Re: BASS Spectrum Analyzer [v0.1] - Fj0rtizFredde - 09.02.2012

This is awesome. Going to be fun to play around with.


Re: BASS Spectrum Analyzer [v0.1] - Ballu Miaa - 09.02.2012

Quote:
Originally Posted by T0pAz
View Post
What's the use of this plugin?
Thats what im trying to ask as well bro! :S lol


Re: BASS Spectrum Analyzer [v0.1] - iZN - 09.02.2012

Great work !
..
A bass spectrum analyzer measures the magnitude of an input signal versus frequency within the full frequency range of the bass.


Re: BASS Spectrum Analyzer [v0.1] - SpiderWalk - 09.02.2012

COOL!!


Re: BASS Spectrum Analyzer [v0.1] - TheArcher - 09.02.2012

Not bad. This plugin uses only lasers?


Re: BASS Spectrum Analyzer [v0.1] - Gamer_Z - 09.02.2012

Quote:
Originally Posted by TheArcher
View Post
Not bad. This plugin uses only lasers?
Read the whole topic ;>
It's not the plugin which creates objects...


AW: BASS Spectrum Analyzer [v0.1] - Meta - 09.02.2012

God, we could make bouncing textdraw bars with that