How to implement adaptive parameters for ODE solvers

I would like to create parameters that change with time t.
In the classic SIR model below for example, I would like to have a beta that changes: say there are two betas and a dummy variable that indicates when to use which beta.

function sir_ode!(du,u,p,t)
    (S,I,R,C) = u
    (β,c,γ) = p
    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;

I could do this by not using an ODE solver and simply looping over a discretised code above. But for later I would like to do this with the model description above, so that I can use the turing packages.

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.

Oh, thank you!
It seems to have worked, just that I had to change a lot of vector lengths.

Is there a nice beginners tutorial somewhere how to create more complex ODEs?