Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require("bass")
- local smoother = 0
- local me = LocalPlayer()
- local source = Entity(165)
- local emitter = ParticleEmitter(EyePos(), false)
- source:SetNoDraw(true)
- source:SetModel("models/dav0r/hoverball.mdl")
- local detail = 6
- local mul = 360/detail
- local fft_detail = 5
- local mul_fft = 1024/fft_detail
- local function Print(...)
- if LocalPlayer():Nick() == "CapsAdmin" then print(...) return end
- if SERVER then print(...) return end
- local tbl = {...}
- for key, value in pairs(tbl) do
- if key ~= #tbl then
- EPOE.AddText(tostring(value)..", ")
- else
- EPOE.AddText(tostring(value).."\n")
- end
- end
- end
- hook.Add("PostDrawOpaqueRenderables",1,function()
- local xd = FUNKY_STREAM
- if not xd then return end
- BASS.SetPosition(me:GetPos(), me:GetVelocity()/100, me:GetAimVector()*-1, me:GetUp())
- xd:set3dposition(source:GetPos(), source:GetForward(), source:GetVelocity()/100)
- local tbl = xd:fft2048()
- smoother = smoother + ((tbl[5] - smoother) / 3)
- --EPOE.AddText(smoother.."\n")
- --[[ source:SetAngles(VectorRand():Angle())
- cam.IgnoreZ(true)
- render.SetBlend(0.8)
- source:DrawModel()
- render.SetBlend(0)
- cam.IgnoreZ(false)
- source:SetModelScale(Vector()*math.max(smoother*10, 0.5)) ]]
- for h=1, fft_detail do
- local pow = math.max(((h/fft_detail)*12)-6, 1)
- local volume = tbl[math.Clamp(math.Round(h*mul_fft), 1, 1024)] * 100 ^ pow
- for i=1, math.Clamp(math.Round(volume*10),0,10) do
- if h == 16 then EPOE.AddText(pow.."\n") end
- --for p=-detail, detail do
- --for y=-detail, detail do
- local angle = ((volume-0.5)*180)*2
- local forward = VectorRand():GetNormal() * volume
- local particle = emitter:Add("particle/particle_sphere", source:GetPos() + (forward*150))
- if (particle) then
- particle:SetVelocity(forward * 500)
- particle:SetAngles(Angle(math.random(360), math.random(360), math.random(360)))
- particle:SetLifeTime(0)
- particle:SetDieTime(math.Clamp(volume^3, 0.1, 0.3))
- particle:SetStartAlpha(0)
- particle:SetEndAlpha(255)
- local length = math.Clamp((h/fft_detail)*420 * (volume^2), 1, 100)
- --if h==1 then Print(50+volume*100, volume) end
- particle:SetStartSize(10*(volume+1)*5)
- particle:SetStartLength(length*(volume+1)*5)
- particle:SetEndSize(0)
- particle:SetEndLength(0)
- --particle:SetGravity(Vector(0,0,-volume+1*600))
- local color = HSVToColor(math.Clamp(volume*360, 0, 360), math.Clamp((-volume+1)*6, 0, 5), math.Clamp(volume*2, 0, 1))
- particle:SetColor(color.r, color.g, color.b)
- particle:SetCollide(true)
- particle:SetBounce(0.1)
- particle:SetAirResistance(math.Clamp(1000*(-volume+2), 300, 1000))
- end
- --end
- --end
- end
- end
- end)
- BASS.StreamFileURL('http://72.26.204.28:6414/', 1, function(stream,b)
- FUNKY_STREAM = FUNKY_STREAM or stream
- FUNKY_STREAM:play()
- FUNKY_STREAM:setvolume(200)
- end)
Advertisement
Add Comment
Please, Sign In to add comment