Coding - practical 3 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What are the two opposing principles for dealing with input?

A
  • Continuously check if something has changed (known as “polling”)
  • Set things up to alert us when something has changed ( callback).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the difference between ‘void IAP::run()’ and the callback functions?

A
  • IAP::run() = process data and text input.

- Callback functions (such as callbackNoteReceived()) = dealing with MIDI input.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the 4 parts of ‘void IAP::callbackNoteReceived (int note, int velocity, int channel)’.

A
  1. void = return datatype
  2. IAP = ownership
  3. callbackNoteReceived = the name of our callback function, these must be typed exactly as they appear, other callback functions have similar names (i.e. for mod wheel).
  4. (int note, int velocity, int channel) = the parameters of our callback function, these are the pieces of data passed to us for processing.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the formula for converting MIDI note numbers into frequencies?

A

f = 440 × 2 to the power of (n−69)/12


How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What happens when we call aserveOscillator()?

A

We are passing values into a function that deals with communicating with aserve.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly