At first I want to thank the community for love2d, really like it!
I am a nerdy musician that likes to code.
Here is some of my music. The visuals where made with processing and a Kinect
https://vimeo.com/163467506
Now I am working on a game in love2d with generative music, but I can't get the timing exactly right.
musically I know what to do but programming wise I have al lot to learn.
the basic of my code looks something like this
Code: Select all
-- 16 note at 120 bpm
maxtime = 0.125
--measures
maxcounter = 4
switch = false
function update()
time = love.timer.getTime()%maxtime
if time >0 and time < maxtime/2 and switch == false then
-- play sound at first note
if counter == 0 and switch == false then
--playsound here
end
counter= (counter +1) %maxcounter
switch = true
end
if time > maxtime/2 then
switch = false
end
end
https://www.dropbox.com/sh/ll5knmipjk1m ... F93Pa?dl=0
I know this isn't the perfect way of doing it but I don't know a other one..
So my question is how can I do fast time based event te proper way ?