return function(arg) local notes = {} notes.sources = {} local round = function(n) return math.floor(n+.5) end local dec = function(x) return x - math.floor(x) end local sin = math.sin local pi = math.pi local down = math.floor local up = math.ceil local sqrt = math.sqrt local abs = math.abs --[[ Without SoundData support, these lines are useless. functions = {} functions.sine = function(s, v) return (sin(s/((44100/v))*pi*2)) end functions.square=function(s, v) local ssin = sin(s/((44100/v))*pi*2); return ssin >0 and 1 or ssin<0 and -1 or 0 end functions.triang = function(s, v) return abs((s*2)/(44100/v)) end --]] local diff = 2^(1/12) for i = 1, 92 do notes.sources[i] = love.audio.newSource(arg) notes.sources[i]:setPitch(diff^(i-49)) end return notes end