Looking at this expression
Sound[Table[Play[Sin[k 1000 t], {t, 0, 0.2}], {k, 1, 3}]]
Play
has the HoldAll
attribute, which prevents the substitution for k
in the table. So you end up with a bunch of sound expressions that have a raw k
in them, which makes them invalid.
You could create the Sin
s first and then map Play
over them:
Sound[Play[#, {t, 0, .2}] & /@ Table[Sin[k 1000 t], {k, 1, 3}]]
Or you could inactivate Play
inside the table and re-activate it once the table is complete:
Sound[Activate[Table[Inactive[Play][Sin[k 1000 t], {t, 0, 0.2}], {k, 1, 3}]]]
I wouldn't be surprised if there were a function designed to do this kind of think automatically, but I'm not familiar with this domain.