wave - a sound manager with audio parsing and rhythm functionalities

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Ulydev
Party member
Posts: 438
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

wave - a sound manager with audio parsing and rhythm functionalities

Post by Ulydev » Thu May 05, 2016 4:00 pm

Hello everyone!

I've been wanting to make an audio library for a long time.

Here's wave, an audio manager that lets you parse your source and even add rhythm-based mechanics in your game.


Code: Select all

local audio = require "wave"

function love.load()
  music = audio
    :newSource("music.wav", "stream")
    :setBPM(120)
    :onBeat(function() print("Boom!") end)
    :play()
end

function love.update(dt)
  music:update(dt)
end
Thanks to everyone who helped me out with beat detection! :awesome:

https://github.com/Ulydev/wave

This demo contains 4 examples using the library. Press space to switch between them.
The last example shows the beat detection feature used in wave. It's very experimental, so it might not work all the time.
Attachments
wave.love
(1.04 MiB) Downloaded 72 times
Last edited by Ulydev on Tue Aug 30, 2016 5:07 pm, edited 1 time in total.

User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by whitebear » Thu May 05, 2016 6:13 pm

That is most amazing thing! Take my money!

User avatar
Sulunia
Party member
Posts: 201
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by Sulunia » Thu May 05, 2016 7:00 pm

The middle circle is reacting to an FFT calculation or is beat-counting based?
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia

User avatar
Tesselode
Party member
Posts: 552
Joined: Fri Jul 23, 2010 7:55 pm

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by Tesselode » Thu May 05, 2016 7:20 pm

Woah, this looks really nice! I was working on my own dynamic music library, but I guess I won't need it anymore!

User avatar
zorg
Party member
Posts: 2654
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by zorg » Thu May 05, 2016 7:59 pm

Sulunia wrote:The middle circle is reacting to an FFT calculation or is beat-counting based?
Neither, i looked at the source, it's basically a beat counting implementation, but it does query the sounddata every few "chunks" for one sample data, and uses that to give back amplitude data. Not that precise, but it works. (oh, and it doesn't create new sounddata objects if your source is already static, so that's good :3)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.

User avatar
alberto_lara
Party member
Posts: 331
Joined: Wed Oct 30, 2013 8:59 pm

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by alberto_lara » Thu May 05, 2016 9:03 pm

Awesome!
LÖVE Projects: GOOi, Süsse and Katsudö
Thank you for taking the time to read this

User avatar
undef
Party member
Posts: 438
Joined: Mon Jun 10, 2013 3:09 pm
Location: Berlin
Contact:

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by undef » Fri May 06, 2016 2:38 pm

Nice!
twitter | steam | indieDB

Check out quadrant on Steam!

User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by qubodup » Fri May 06, 2016 6:21 pm

Cool beans! I heard the music before, was it in a game of yours (can't find a link..)?
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)

User avatar
Ulydev
Party member
Posts: 438
Joined: Mon Nov 10, 2014 10:46 pm
Location: Paris
Contact:

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by Ulydev » Wed May 18, 2016 5:28 pm

Thank you guys for the feedback!

Code: Select all

-Fixed (set/get)TargetPitch, (set/get)TargetVolume
I've been trying to add a music:setOffset(milliseconds) method to offset beat detection, but I can't seem to make it work (doing "self.time + self.offset" breaks the beat when looping). Can someone please help me with this?

User avatar
Sulunia
Party member
Posts: 201
Joined: Tue Mar 22, 2016 1:10 pm
Location: SRS, Brazil

Re: wave - a sound manager with audio parsing and rhythm functionalities

Post by Sulunia » Wed May 18, 2016 6:21 pm

Ulydev wrote: Can someone please help me with this?
Imma look into your source code. If you're generating a list of times where a song will beat then you'll most likely have to update the entire list with such offset. :o:

@edit:
You calculate this in realtime. It makes it a bit harder, but i guess it's faster that way. I'm not really good with metamethods/metatables, so bear with me here. The problem is when the song ends and loops back to the beggining, or the next beat with the offset? :monocle:
Don't check my github! It contains thousands of lines of spaghetti code in many different languages cool software! :neko:
https://github.com/Sulunia

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 3 guests