How to implement adaptive parameters for ODE solvers

If you have a simple function of t, you can just add the time dependence right there:

function sir_ode!(du,u,p,t)
    (S,I,R,C) = u
    (a,ω,c,γ) = p
    β = a * (1+sin(ω*t))
    N = S+I+R
    infection = β*c*I/N*S
    recovery = γ*I
    @inbounds begin
        du[1] = -infection
        du[2] = infection - recovery
        du[3] = recovery
        du[4] = infection
    end
    nothing
end

In a more complicated scenario, you might use events.