LÖVE Audio Effects Playground

Show off your games, demos and other (playable) creations.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: LÖVE Audio Effects Playground

Post by ReFreezed »

I actually thought about that - allowing the user to rewire things however they want - but since it doesn't change the outputted audio it would just be confusing. :)
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: LÖVE Audio Effects Playground

Post by pgimeno »

That's very cool indeed! Extra points if the cables are shaped like a catenary :D
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: LÖVE Audio Effects Playground

Post by ReFreezed »

It's more or less two sines added together which I don't think counts as a catenary shape, so no extra points I guess. :P
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: LÖVE Audio Effects Playground

Post by pgimeno »

I don't blame you, it gets really complex. Still very cool though.

The use of sines was a bit surprising. I thought you would have used Bézier curves. It's what I would have used probably.
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: LÖVE Audio Effects Playground

Post by ReFreezed »

I just needed the cables to sag a bit, and sines have those saggy bits! :) No idea that shape this actually is.

Code: Select all

-- (hiX,hiY) is the higher connection on the screen.
-- (loX,loY) is the lower.
for segment = 0, SEGMENTS do
	local tx  = segment / SEGMENTS -- Move linearly on x.
	local ty  = sin(tx*TAU/4) -- Quickly approach lower y (ty=1).
	local sag = sin(tx*TAU/2) * MAX_SAG -- Sag in the middle.

	local segmentX = lerp(hiX, loX, tx)
	local segmentY = lerp(hiY, loY, ty) + sag
end
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: LÖVE Audio Effects Playground

Post by ReFreezed »

Well, extending a line reveals the true shape.
Attachments
sines.png
sines.png (31.13 KiB) Viewed 3254 times
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
zorg
Party member
Posts: 3435
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: LÖVE Audio Effects Playground

Post by zorg »

Awesome little educational tool! I usually can't keep up with the Games subforum, but this is great. :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
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: LÖVE Audio Effects Playground

Post by ReFreezed »

Thanks :)
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: LÖVE Audio Effects Playground

Post by pgimeno »

I was bothered by the fact that the sine waves straighten up unnaturally near one of the ends, so I ended up making a parabolic version. A parabola is a decent-ish approximation of a catenary in many cases.

(Rename to main.lua to test)
Attachments
pseudo-catenary.lua
(4.99 KiB) Downloaded 72 times
User avatar
ReFreezed
Party member
Posts: 612
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

Re: LÖVE Audio Effects Playground

Post by ReFreezed »

That's nice. I'll save that code for the future.

In the program, the cables swing back and forth a bit. Could you implement physically correct swinging as well? :) (Just kidding.)
Tools: Hot Particles, LuaPreprocess, InputField, (more) Games: Momento Temporis
"If each mistake being made is a new one, then progress is being made."
Post Reply

Who is online

Users browsing this forum: ShoesForClues and 10 guests