VC++ MFC 鍵盤 録音再生
pythonの場合は以下pythonのお勉強:音楽 鍵盤もどき 録音と再生void CBeepTestDlg::OnBnClickedButton1(){ int freq = 523; int time = 500; Beep(freq, time); play_table[play_index] = 1; play_index++;}void CBeepTestDlg::OnBnClickedButton2(){ // TODO: ここにコントロール通知ハンドラー コードを追加します。 int freq = 587; int time = 500; Beep(freq, time); play_table[play_index] = 2; play_index++;}void CBeepTestDlg::OnBnClickedButton3(){ int freq = 659; int time = 500; Beep(freq, time); play_table[play_index] = 3; play_index++;}void CBeepTestDlg::OnBnClickedButton4(){ int freq = 698; int time = 500; Beep(freq, time); play_table[play_index] = 4; play_index++;}void CBeepTestDlg::OnBnClickedButton5(){ int freq = 784; int time = 500; Beep(freq, time); play_table[play_index] = 5; play_index++;}void CBeepTestDlg::OnBnClickedButton6(){ int freq = 880; int time = 500; Beep(freq, time); play_table[play_index] = 6; play_index++;}void CBeepTestDlg::OnBnClickedButton7(){ int freq = 998; int time = 500; Beep(freq, time); play_table[play_index] = 7; play_index++;}void CBeepTestDlg::OnBnClickedButton8(){ int freq = 1047; int time = 500; Beep(freq, time); play_table[play_index] = 8; play_index++;}void CBeepTestDlg::OnBnClickedButton9(){ int i; int time = 500; int freq=0; for (i = 0; i < play_index; i++) { switch (play_table[i]) { case 1: freq = 523; break; case 2: freq = 587; break; case 3: freq = 659; break; case 4: freq = 698; break; case 5: freq = 784; break; case 6: freq = 880; break; case 7: freq = 998; break; case 8: freq = 1047; break; default: freq = 0; break; } Beep(freq, time); }}再生をスレッドで記述の場合UINT MyThread(LPVOID p) { int i; int time = 500; int freq = 0; CString string; for (i = 0; i < play_index; i++) { switch (play_table[i]) { case 1: freq = 523; break; case 2: freq = 587; break; case 3: freq = 659; break; case 4: freq = 698; break; case 5: freq = 784; break; case 6: freq = 880; break; case 7: freq = 998; break; case 8: freq = 1047; break; default: freq = 0; break; } Beep(freq, time); } return 0;}//再生をスレッドで実行void CBeepTestDlg::OnBnClickedButton9(){ int thread_id, count; thread_id = 0; count = 0; AfxBeginThread(MyThread, this);}【中古】Visual C# 2013逆引き大全555の極意 Visual Studio Professiona /秀和システム/増田智明(単行本)