Results 1 to 3 of 3
  1. #1
    satyaram435 is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Question This programm stucks when i run this

    import javax.sound.midi.*;
    class MiniMusicPlayer1
    {


    public static void main(String[] args)
    {
    try
    {
    Sequencer sequencer=MidiSystem.getSequencer();
    sequencer.open();

    Sequence seq=new Sequence(Sequence.PPQ,4);
    Track track=seq.createTrack();

    for(int i=5;i<61;i+=4)
    {
    track.add(makeEvent(144,1,i,100,i));
    track.add(makeEvent(128,1,i,100,i+2));
    }

    sequencer.setSequence(seq);
    sequencer.setTempoInBPM(220);
    sequencer.start();

    }
    catch (Exception ex)
    {
    ex.printStackTrace();
    }
    System.out.println("end of main");
    }//close main

    public static MidiEvent makeEvent(int cmd,int chan,int one,int two,int tick)
    {
    MidiEvent event=null;
    try
    {
    ShortMessage a=new ShortMessage();
    a.setMessage(cmd,chan,one,two);
    event=new MidiEvent(a,tick);
    }
    catch(Exception ex)
    {
    ex.printStackTrace();
    }
    return event;
    }//cloe makeevent

    }//close class

  2. #2
    satyaram435 is offline Member
    Join Date
    Nov 2009
    Posts
    4
    Rep Power
    0

    Default This programm have to play lower note ti higher note

    It is giving the output but it unable to come out of the running process...

  3. #3
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Err in programm
    By nassir in forum JCreator
    Replies: 5
    Last Post: 02-27-2010, 01:19 AM
  2. Marks programm
    By blackmoon in forum AWT / Swing
    Replies: 5
    Last Post: 12-08-2009, 10:06 PM
  3. web programm (.jsp)
    By renars1985 in forum New To Java
    Replies: 1
    Last Post: 12-18-2007, 03:23 PM
  4. web programm (.jsp)
    By renars1985 in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 12-18-2007, 08:34 AM
  5. Programm Error: cannot find symbol Help?
    By junix in forum New To Java
    Replies: 2
    Last Post: 12-10-2007, 05:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •