Randomized Song Rewinder

Show off your games, demos and other (playable) creations.
Post Reply
Connorses
Citizen
Posts: 63
Joined: Fri Sep 06, 2013 7:02 am

Randomized Song Rewinder

Post by Connorses »

Annoy your friends!
Amuse your enemies!
Loop the intro to a song infinitely!

This program has a list of times, and when it reaches that time in a song it rolls dice to decide wether to rewind the song.

Recommended use: insert your own song, and use Audacity (or any music player I guess) to find the times you want the randomizer to use. If you only want to loop one section, enter only 2 numbers: the beginning and end of the looped section. It's a lot more fun with a longer list, though.

SOURCE CODE v2.0:

Code: Select all

source = love.audio.newSource("song.wav", "static")

times = {
	1.383, 
	6.914,
	7.872,
	15.317,
	18.902,
	22.521,
	26.198,
	29.840,
	32.594,
	34.288,
	37.124,
	44.477,
	51.830,
	57.340
}

love.window.setTitle("\"Let the bodies hit the") --random window titles

position = 0;
rewindTime = 2;
love.audio.play(source)--This hack was a mistake.

function love.load()

end

function love.update()
	position = source:tell()
	if position >= times[rewindTime] then
		choosePostion()
	end
end

function choosePostion()
	old = rewindTime
	if  (old > 2 and love.math.random(3) == 2) then
		source:seek( times[rewindTime-1], "seconds" )
	else
		while rewindTime >= old and rewindTime > old-3 do
			rewindTime = love.math.random( table.getn(times) )
		end
		source:seek( times[rewindTime], "seconds" )

		old = rewindTime
		while rewindTime <= old and rewindTime < old + 3 do
			rewindTime = love.math.random( table.getn(times) )
		end
	end

end
Last edited by Connorses on Sun Dec 04, 2022 9:55 pm, edited 3 times in total.
User avatar
Bunnybacon
Prole
Posts: 20
Joined: Fri Mar 25, 2016 8:42 am

Re: Randomized Song Rewinder

Post by Bunnybacon »

Very quirky, I like it!
The whole concept of small "party" apps/pranks is a fun idea.

:emo: FLOOOOOOOOOOR! :emo:
User avatar
kicknbritt
Citizen
Posts: 96
Joined: Sat May 30, 2015 2:15 am
Location: Chicago, IL/Anchorage,AK

Re: Randomized Song Rewinder

Post by kicknbritt »

Hahaha. This is pretty cool.
"I AM THE ARBITER!!!" *Pulls out Energy sword and kills everything*
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 53 guests