This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Sound

Sound[primitives]
represents a sound.
Sound
specifies that the sound should have duration t.
Sound
specifies that the sound should extend from time to time .
  • Lists containing the following primitives can be used:
SampledSoundFunction[f,n,r]amplitude levels generated by a function
SampledSoundList[{a1,a2,...},r]amplitude levels given in a list
SoundNote[spec,...]a music-like note
Sound[prims,t]a sound scaled to have duration t
Sound[prims,{tmin,tmax}]a sound played over the time interval to
  • Primitives with duration specifications are played consecutively in sequence, independent of primitives with explicit time specifications.
  • When primitives prims appear in Sound, the sequence of durations and time specifications in prims are rescaled and shifted to fit into the time interval defined by tspec.
  • For the outermost Sound object, times are by default taken to be given in absolute seconds.
  • For inner Sound objects, times can be given as Scaled[r].
  • Sound[prims, Scaled[r]] will slow down prims by a factor r.
  • Mixed into lists of sound primitives can be the following SoundNote directives:
"style"use the specified style
opt->valueuse the specified option setting
  • The possible styles and options are those for SoundNote.
  • Nested lists of sound primitives and directives can be given. Directive specifications normally remain in effect only until the end of the list which contains them.
  • A list containing only sound directives is treated as if its elements were directly inserted into an enclosing list.
  • Style can be used to apply the options or directives opts to obj.
  • Sound[...] is displayed in StandardForm as a button containing a graphic representing the sound. Clicking the button plays the sound, preempting any other sounds that are already playing.
  • In InputForm, Sound[...] is displayed as an explicit list of primitives.
  • The option SoundVolume->v specifies a relative sound volume v for a note.
  • The following options can be given:
SoundVolume1relative sound volume
Represent a sound consisting of a sequence of two notes:
Represent a sound consisting of a sequence of two waveforms:
Represent a sound consisting of a sequence of two notes:
In[1]:=
Click for copyable input
Out[1]=
 
Represent a sound consisting of a sequence of two waveforms:
In[1]:=
Click for copyable input
Out[1]=
Represent a sequence of notes, with each note taking 1 second:
Represent a sequence of notes, with the whole sequence lasting 1.5 seconds:
Represent a sequence of notes to be played between and :
Represent a sequence of notes to be played between and :
Combine the two sound sequences:
Superimpose three time-warped versions of a sound:
Represent a sequence of notes to be rendered in accordion style:
Combine two note sequences with different instrument styles:
Create an algorithmic composition from a cellular automaton pattern:
Generate a simple WolframTones-like composition:
Record a sound:
Squash the sound to play over 0.8 seconds:
Play a random sequence of notes from different instruments:
Make each note have a random duration:
New in 2 | Last modified in 6