LinearPitch[freq_]:=69+12*Log[freq/440,2]
LinearPitchInv[pitch_]:=440*2^((pitch-69)/12)
middleA[t_]:=Sin[440 2Pi t]

pitch[880]
LinearPitchInv[81]

Play[Sin[LinearPitchInv[69+Floor[t]]* 2 Pi t],{t,0,12}]

PlayFunction[f_,a_,b_,min_,max_,duration_,start_]:=Play[
Sin[
LinearPitchInv[
Floor[36*(f[a+(b-a)*t/duration]-min)/(max-min)]+start
]* 2 Pi t
],{t,0,duration}]

h[x_]:=Exp[x];
h[x_]:=x;
h[x_]:=Sin[4Pi*x];
PlayFunction[h,0,1,-1,1,10,45]

LagrangePolynomial[data_,x_]/;MatrixQ[data]:=
Module[{n=Length[data], xl,yl},
{xl,yl}=Transpose[data];
Sum[Product[(x-xl[[i]])/(xl[[j]]-xl[[i]]),{i,Complement[Range[n],{j}]}]yl[[j]],{j,n}]
]
q[x_]:=LagrangePolynomial[{{.7,0},{1,.7},{2,2}},x]
r[x_]:=LagrangePolynomial[{{4,2},{5,1.4},{5.3,1}},x]

g[x_]:=Piecewise[{{1.5+x^2,x<1},
{q[x],x<2},
{1.5+Exp[-Log[Sqrt[3]]*x+Log[4.5]], x<4},
{r[x],x<6}}]
Plot[g[x],{x,0,5.5},PlotRange->{{0,5.5},{0,4}}]
PlayFunction[g,0,5.5,1,3,10,45]

Play[{t /10(1-t/10)Sin[1000t],t/10 Cos[t]Cos[2000t]^2,(1-t/10) Sin[t] Sin[4000t]},{t,0,10}]

f[x_]:=Sin[2-x]
Play[{f[t]*Sin[1000t],f[t-2]*Sin[2000t],f[t*Pi]*Sin[1500t]},{t,0,10}]

Play[{Sin[1000t],Sin[3000t],Sin[2500t]},{t,0,10}]

Play[{Sin[LinearPitchInv[69+Floor[Cos[t]*t]]* 2 Pi t],Sin[LinearPitchInv[81-Floor[t*Sin[t]]]* 2 Pi t]},{t,0,24}]

Play[{Cos[t]Sin[LinearPitchInv[69+Floor[t]]* 2 Pi t],Sin[t]Sin[LinearPitchInv[81-Floor[t]]* 2 Pi t]},{t,0,12}]

pitch[x_]:=Piecewise[{{1,x<1},
{2,x<2},
{3, x<4},
{4,x<6}}]
Plot[{g[x],pitch[x]},{x,0,5.5},PlotRange->{{0,5.5},{0,4}}]
Play[2*g[t]*Sin[pitch[t]*220 *2 Pi t],{t,0,5.5}]

Bits[x_]:=BitGet[x,{0,1,2,3,4,5,6,7}];
Bits[42]
Bits[42]*Bits[2]

Play[{(.001+BitGet[Floor[t],0])*Sin[LinearPitchInv[69+Floor[t]]* 2 Pi t],
(.001+BitGet[Floor[t],1])*Sin[LinearPitchInv[81-Floor[t]]* 2 Pi t]},{t,1,12}]

Bits[43]

BitGet[Floor[1.5],0]

Play[
(.001+BitGet[Floor[t],0])*Sin[LinearPitchInv[69]* 2 Pi t]+
(.001+BitGet[Floor[t],1])*Sin[LinearPitchInv[75]* 2 Pi t]+
(.001+BitGet[Floor[t],2])*Sin[LinearPitchInv[79]* 2 Pi t],{t,0,24}]

Play[(.001+Bits[Floor[t]]) .Sin[LinearPitchInv[{60,64,67,72,76,79,84,88}]* 2 Pi t],{t,1,32}]

Play[(.001+Bits[Floor[t*8]]) .Sin[LinearPitchInv[{60,64,67,72,76,79,84,88}]* 2 Pi t],{t,0,32}]

PlayFunction[f_,a_,b_,min_,max_,duration_,start_]:=Play[
Sin[
LinearPitchInv[
Floor[36*(f[a+(b-a)*t/duration]-min)/(max-min)]+start
]* 2 Pi t
],{t,0,duration}]

h[x_]:=Exp[x];
h[x_]:=x;
h[x_]:=Sin[4Pi*x];
PlayFunction[h,0,1,-1,1,10,45]

LagrangePolynomial[data_,x_]/;MatrixQ[data]:=
Module[{n=Length[data], xl,yl},
{xl,yl}=Transpose[data];
Sum[Product[(x-xl[[i]])/(xl[[j]]-xl[[i]]),{i,Complement[Range[n],{j}]}]yl[[j]],{j,n}]
]
q[x_]:=LagrangePolynomial[{{.7,0},{1,.7},{2,2}},x]
r[x_]:=LagrangePolynomial[{{4,2},{5,1.4},{5.3,1}},x]

g[x_]:=Piecewise[{{1.5+x^2,x<1},
{q[x],x<2},
{1.5+Exp[-Log[Sqrt[3]]*x+Log[4.5]], x<4},
{r[x],x<6}}]
Plot[g[x],{x,0,5.5},PlotRange->{{0,5.5},{0,4}}]
PlayFunction[g,0,5.5,1,3,10,45]

Play[{t /10(1-t/10)Sin[1000t],t/10 Cos[t]Cos[2000t]^2,(1-t/10) Sin[t] Sin[4000t]},{t,0,10}]

f[x_]:=Sin[2-x]
Play[{f[t]*Sin[1000t],f[t-2]*Sin[2000t],f[t*Pi]*Sin[1500t]},{t,0,10}]

Play[{Sin[1000t],Sin[3000t],Sin[2500t]},{t,0,10}]

Play[{Sin[LinearPitchInv[69+Floor[Cos[t]*t]]* 2 Pi t],Sin[LinearPitchInv[81-Floor[t*Sin[t]]]* 2 Pi t]},{t,0,24}]

Play[{Cos[t]Sin[LinearPitchInv[69+Floor[t]]* 2 Pi t],Sin[t]Sin[LinearPitchInv[81-Floor[t]]* 2 Pi t]},{t,0,12}]

pitch[x_]:=Piecewise[{{1,x<1},
{2,x<2},
{3, x<4},
{4,x<6}}]
Plot[{g[x],pitch[x]},{x,0,5.5},PlotRange->{{0,5.5},{0,4}}]
Play[2*g[t]*Sin[pitch[t]*220 *2 Pi t],{t,0,5.5}]

Bits[x_]:=BitGet[x,{7,6,5,4,3,2,1,0}];
Bits[42]
Bits[42]*Bits[2]

Play[{(.001+BitGet[Floor[t],0])*Sin[LinearPitchInv[69+Floor[t]]* 2 Pi t],
(.001+BitGet[Floor[t],1])*Sin[LinearPitchInv[81-Floor[t]]* 2 Pi t]},{t,1,12}]

Bits[43]

BitGet[Floor[1.5],0]

Play[{
(.001+BitGet[Floor[t],0])*Sin[LinearPitchInv[69+Floor[t]]* 2 Pi t],
(.001+BitGet[Floor[t],1])*Sin[LinearPitchInv[75]* 2 Pi t],
(.001+BitGet[Floor[t],2])*Sin[LinearPitchInv[81-Floor[t]]* 2 Pi t]
},{t,1,12}]