./20161119-1808-cet-4-1.png

  • aubio documentation about initiating a pitch detector, https://aubio.org/doc/latest/pitch_8h.html#a962561ea270e0308ed26ac9bab554550.
  • The 1st parameter is the method of the pitch detection. Up to now, I only know "DEFAULT" method. I am not sure if there is other methods and if those other methods better for my case. Nevertheless, I will keep using "DEFAULT" for now on.
  • The 2nd parameter is a buffer before the sound sent to be processed.
  • The 3rd parameter is said to be the interval between two consecutive sound analysis. The variable used is called hop_size. Other than these, I am not sure on what does this parameter do.
    • In the example code hop_size is buffer divided by 2 and rounded up.
  • The last parameter is the sample size. I do not know what does sample size do.

./20161119-1808-cet-4-2.png

self.recorder = alsaaudio.PCM(
    type = alsaaudio.PCM_CAPTURE
)

./20161119-1808-cet-4-3.png

./20161119-1808-cet-4-4.png

./20161119-1808-cet-4-5.png

#variable.py
variable_text = "Hello world!"
#other.py
import variable
variable.variable_text = variable.variable_text + " Hello world again!"
#This print will result in "Hello world! Hello world again!"
print(variable.variable_text)

./20161119-1808-cet-4-6.png

  • So, constant can be treated as other normal Python variables. So, make sure to have use prefix self in variable that is class wide available.
  • Screenshot to the StackOverflow Python discussion.

./20161119-1808-cet-4-7.png

./20161119-1808-cet-4-8.png

./20161119-1808-cet-4-9.png