1

## librosa找歌曲大調疑問

from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt # matplotlib for displaying the output
%matplotlib inline
import IPython.display # IPython.display for audio output
import librosa # Librosa for audio
import librosa.display # display module for visualization
y_harmonic, y_percussive = librosa.effects.hpss(y)
C = librosa.feature.chroma_cqt(y=y_harmonic, sr=sr, bins_per_octave=36)
1. 想請問"bins_per_octave=36"的意思:看了原文跟中文翻譯都不是很懂，每八度36個bins?
2. 網路上僅找到輸出視覺化的code，想請問只要顯示出這首歌的大調的話，code要怎麼寫 print('chord: ',C....)
fillano iT邦超人 1 級 ‧ 2020-03-11 15:11:02 檢舉

### 2 個回答

0
fillano
iT邦超人 1 級 ‧ 2020-03-12 08:27:01

1

iT邦大師 1 級 ‧ 2020-03-11 15:03:34

https://librosa.github.io/librosa/generated/librosa.feature.chroma_cqt.html

Number of bins per octave in the CQT. Default: matches n_chroma

Octave -> 8.

https://en.wikipedia.org/wiki/Constant-Q_transform

https://dsp.stackexchange.com/questions/54883/how-can-i-calculate-the-number-of-bins-per-octave

https://dsp.stackexchange.com/questions/26927/what-is-a-frequency-bin

https://ithelp.ithome.com.tw/articles/10195763

fillano iT邦超人 1 級 ‧ 2020-03-11 17:49:42 檢舉