![black and gray laptop computer](https://ma-servant.com/wp/wp-content/uploads/2020/01/pexels-photo-546819-e1628989766353-1024x576.jpeg)
C++
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <iostream> float NoteFrequency(float x , float y){ // x = 基準ピッチ、y = ノートナンバー if(y < 0 || y > 127){return 0;} return x * powf(2,(y-69) / 12); } //メイン関数 int main(){ std::cout << NoteFrequency(440,60) << std::endl; return 0; } |
コメント