Пример #1
0
 private void button_UpTone_Click(object sender, RoutedEventArgs e)
 {
     MidiPlay.changekey(1);
     toneId          = toneId + 1;
     upWin_Tone.Text = toneOfMusic[toneId % 12];
     keyDownColor_right(60);
 }
Пример #2
0
        private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            int x = (int)slider1.Value;

            MidiPlay.changeVolume(x);
            textBlock_Volume.Text = x.ToString();
        }
Пример #3
0
        private void slider2_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            int x = (int)slider2.Value;

            textBlock_Beat.Text = upWin_Speed.Text = x.ToString();
            x += 20;
            MidiPlay.changeBeat(x);
        }
Пример #4
0
 private void button_DownTone_Click(object sender, RoutedEventArgs e)
 {
     //if(toneId<=12)
     MidiPlay.changekey(-1);
     toneId = toneId - 1;
     if (toneId < 0)
     {
         toneId += 12;
     }
     upWin_Tone.Text = toneOfMusic[toneId % 12];
 }
Пример #5
0
 public void run()
 {
     //以下的Play如果移植到源工程需要改为MidiPlay
     if (inf4 != null)
     {
         MidiPlay.NewPlay(device, inf1, n1, inf2, n2, inf3, n3, inf4, n4);
     }
     else if (inf4 == null && inf3 != null)
     {
         MidiPlay.NewPlay(device, inf1, n1, inf2, n2, inf3, n3);
     }
 }
Пример #6
0
        //public void change


        public void mainPlay()
        {
            string[] track  = new string[instrumentN];
            string   score0 = textBlock_main.Text.Replace(" ", "").Replace(",", "");// 去掉曲谱里的逗号和空格

            try
            {
                NoteInput.inputCheck(score0);
                winInputCheck();
                track[0] = textBlock_main.Text.Replace(" ", "");
                if (muteMainScore)
                {
                    track[0] = NoteInput.muteNote(track[0]);
                }

                string resultChordSeq = textBlock_main2.Text.Trim();
                // MessageBox.Show(textBlock_main2.Text);
                track[1] = chordTrack[0].splitedChordNote(resultChordSeq);
                track[2] = chordTrack[1].splitedChordNote(resultChordSeq);
                track[3] = chordTrack[2].splitedChordNote(resultChordSeq);

                /*
                 * for (int i = 0; i < instrumentN; i++)
                 * {
                 *  if (track[i].Last() == ',')
                 *      track[i] = track[i].Substring(0, track[i].Length - 1);
                 *
                 *  chordTrack[i].adjustForOctave(track[i], track[0]);//调整八度关系
                 *  //MessageBox.Show(track[i]);
                 * }
                 */
                /*
                 * foreach(string x in track)
                 * {
                 *  MessageBox.Show(x);
                 * }
                 */
                // if( ! ( textBlock_main.Text==null && textBlock_main2.Text== null) )
                MidiPlay.BrandNew(myMidiDevice, track[0], timbreTrack[0], track[1], timbreTrack[1], track[2], timbreTrack[2], track[3], timbreTrack[3]);
            }
            catch (UserInputException e)
            {
                MessageBox.Show("请输入音符");
                initAllInputWin();
            }
        }
Пример #7
0
 public void run()
 {
     MidiPlay.playBasic(device, note, trmbre, channel);
 }
Пример #8
0
 public void run_left()
 {
     MidiPlay.playBasic_left(device, note, trmbre, channel, playvolume);
 }
Пример #9
0
 public void keyDown(string str)
 {
     //string s = str + "5";
     MidiPlay.playMidi(myMidiDevice, str);
 }