What would be the output of the following?
>>> name = 'Mark'
>>> print 'Hello, ' + name
Hello, Mark
What is the out of the following?
>>>a[100, 30, 20]
>>>a
100, 30, 20
What do we call an individual unit or splice of an audio file? Hint: there are tens of thousands of them per second.
Sample
What is wrong with the following function?
def addOne(number): print number + 1
Everything is one line / there is no block indentation.
What would be the output of the following?
>>> a = 5
>>> b = 8
>>> a == b
False
The difference between these three:
"
'
"""
The first and second are interchangeable, the third includes paragraphs
What is the output of the following?
>>>a[100, 30, 20]
>>>a[2]
20
How many samples are in CD quality audio?
44,100
Which is correct?
if (x==2):
print "yes"
if (x=2):
print "yes"
The first,
if (x==2):
print "yes"
What is wrong with the following?
def(setValue):
a = 5
__________________
>>> print a
The context of the variable 'a' is only valid inside the function.
Describe the difference between a MIDI sound and an audio file.
MIDI is not a natural instrument, it is generated sound coming from a computer. An audio file is a wav (or other) recording of a natural acoustic sound.
Describe the code needed to set a variable a that would store the values 100 and 20
>>> a[100, 20]
Describe the process to increase or decrease the frequency of a sound.
Either double or half the length of the wave representing a given sound.
What would need to change to produce the desired outcome of 2.5?
>>>5 / 2
>>>5.0 / 2.0
or
>>>5.0 / 2
or 5 / 2.0
What are the highest and lowest values we can assign for amplitude within a 16 bit sample.
32,768 and 32,767
What are the highest and lowest values we can assign for amplitude within a 16 bit sample.
32,768 and 32,767
What is the output of the following?
>>>a['green', 'eggs', 'ham']
>>>a[0] * 3
greengreengreen
How many bits are used to store an audio sample that is CD quality, allowing for sample ranges from -32,768 to 32,767
16 bits or 2 bytes
What mathematic operator is needed to combine two sounds. Explain your choice.
'+' for adding samples
or '*' if you want to blend at a given ratio (ex: 0.5)
Define amplitude.
The distance from the zero point to the greatest pressure (or least pressure).
Explain the meaning of frequency, and give a common minimum and maximum frequency that humans can hear.
Frequency is determined by the number of repeating waves in a given second, and a common frequency that humans can hear is from 5 to 20,000Hz
>>> a = ['spam' , 'eggs' , 100 , 1234]
>>> ????????
>>> a
['spam', 'eggs', 123, 1234]
a[2] = a[2] + 23
What is a sampling rate? What sampling rate does CD quality audio use?
How many samples are used in a given second. CD quality audio uses 44,100 samples per second.
Write on the board how to create a sound object from a wav file located at c:\sound.wav.
makeSound('c:\sound.wav')
or makeSound(pickAFile())
What would the following function do?
def mystery(sound):
for sample in getSamples(sound):
value = getSampleValue(sample)
setSampleValue(sample,value * 2)
This would increase the volume of an audio file passed to it.