public bool trainningmode(ntValue nt, int ocIndex, int tempo) { //2017-01-17 김민영 //순서가 맞지않는 경우란 없다 원래 카운트 부분 수정 int crr = trainningindex; if (crr == allindex) { lb_test.Text = "연습이 완료되었습니다!"; return(false); } //MessageBox.Show(trScore[trainningindex].note.ToString()); if (nt.ToString() != trScore[crr].note.ToString()) { lb_test.Text = "음계가 일치하지 않습니다!"; return(false); } //음계가 일치하지 않을 시 종료 if (ocIndex != trScore[crr].octave) { lb_test.Text = "옥타브가 일치하지 않습니다."; return(false); } //옥타브가 일치하지 않을 시 종료*/ if (tempo != trScore[crr].length - 8) { lb_test.Text = "박자가 일치하지 않습니다."; return(false); } //박자가 일치하지 않을 시 종료*/ lb_test.Text = "맞았습니다!"; trainningindex++; return(true); }
public void save(string title, music musicSheet, Panel[] p_music) { string text = ""; text += "[" + title + "]"; for (int i = 0; i <= musicSheet.max_smind; i++) { text += "{"; for (int j = 0; j < musicSheet.sm[i].note_arr.Length; j++) { try { ntValue note = musicSheet.sm[i].note_arr[j].nt; int octave = musicSheet.sm[i].note_arr[j].ocIndex; int length = musicSheet.sm[i].note_arr[j].length; text += "<" + note.ToString() + "," + octave.ToString() + "," + length.ToString() + ">"; } catch { continue; } } text += "}"; } text += "e"; if (text != "e") { SaveFileDialog(text, title, p_music, musicSheet.max_smind); } else { MessageBox.Show("악보를 제작한 후 저장해보세요!"); } }