Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
        private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            int x = (int)slider1.Value;

            MidiPlay.changeVolume(x);
            textBlock_Volume.Text = x.ToString();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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];
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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();
            }
        }
Ejemplo n.º 7
0
 public void run()
 {
     MidiPlay.playBasic(device, note, trmbre, channel);
 }
Ejemplo n.º 8
0
 public void run_left()
 {
     MidiPlay.playBasic_left(device, note, trmbre, channel, playvolume);
 }
Ejemplo n.º 9
0
 public void keyDown(string str)
 {
     //string s = str + "5";
     MidiPlay.playMidi(myMidiDevice, str);
 }