Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: jmx/util/Play.java


1   /*
2   
3   < This Java Class is part of the jMusic API Version 2000.11>
4   
5   Copyright (C) 2000 Andrew Sorensen & Andrew Brown
6   
7   This program is free software; you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation; either version 2 of the License, or any
10  later version.
11  
12  This program is distributed in the hope that it will be useful, but
13  WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16  
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  
21  */ 
22  
23  package jmx.util;
24  
25  import jmx.midi.MidiSynth;
26  import jm.music.data.*;
27  import jm.JMC;
28  
29  
30  public class Play implements JMC{
31      
32      public Play() {}
33     
34      //----------------------------------------------
35      // MidiSynth - JavaSound MIDI playback
36      //----------------------------------------------
37      /**
38      * Playback the jMusic score JavaSound MIDI
39      * @param Score
40      */ 
41      public static void midi(Score s) {
42          MidiSynth ms = new MidiSynth();
43          try {
44              System.out.println("-------------------- Playing MIDI file ----------------------");
45              ms.play(s);
46          }
47          catch (Exception e) {
48              System.err.println("MIDI Playback Error:" + e);
49              return;
50          }
51      }
52  }