Creating  a midi Sequence

My wish: to create a blank midi sequence, add a track,
and populate the track with midi events.
I get as far as creating the new track, and am unable to create a MidiEvent on the track.
Any help would be much appreciated.
--John Held                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Spoke to soon.
Code compiles,but when run, sequencer.setSequence(seq) chokes (seq being a valid,non-null sequence).
The API says I can use either a file or a sequence, but sure seems to only want a file.
Any thoughts?
--John                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Detect Note Changes in MIDI Sequencer

    Hi all,
    I’m trying to detect when the MIDI Sequencer changes notes using some kind of a listener to detect when the note changes occur. My example program is able to detect the end of the sequence and I’d like to be able to detect note changes and print a message in a similar way. Here is my example code.
    import javax.swing.*;
    import javax.sound.midi.*;
    public class SequencerTestApplet extends JApplet
        public void init()
            SequencerTest seqTest = new SequencerTest();
            seqTest.play();
            System.out.println("Print from init()");
    class SequencerTest
        Sequencer sequencer=null;
        Sequence seq=null;
        Track track=null;
        public SequencerTest()
            try
            {   sequencer = MidiSystem.getSequencer();
                sequencer.open();
                // detect END OF SEQUENCE
                sequencer.addMetaEventListener(
                    new MetaEventListener()
                    {   public void meta(MetaMessage m)
                        {  if (m.getType() == 47) System.out.println("SEQUENCE FINISHED");
                sequencer.setTempoInBPM(40);
                seq = new Sequence(Sequence.PPQ, 16);
                track = seq.createTrack();
            catch (Exception e) { }
        public void play()
            try
            {    // NOTE 1
                ShortMessage noteOnMsg = new ShortMessage();
                noteOnMsg.setMessage(ShortMessage.NOTE_ON, 0, 60, 93);
                track.add(new MidiEvent(noteOnMsg, 0));
                ShortMessage noteOffMsg = new ShortMessage();
                noteOffMsg.setMessage(ShortMessage.NOTE_OFF, 0, 60, 93);
                track.add(new MidiEvent(noteOffMsg, 16));
                // NOTE 2
                ShortMessage noteOnMsg2 = new ShortMessage();
                noteOnMsg2.setMessage(ShortMessage.NOTE_ON, 0, 68, 93);
                track.add(new MidiEvent(noteOnMsg2, 16));
                ShortMessage noteOffMsg2 = new ShortMessage();
                noteOffMsg2.setMessage(ShortMessage.NOTE_OFF, 0, 68, 93);
                track.add(new MidiEvent(noteOffMsg2, 32));
                sequencer.setSequence(seq);
                sequencer.start();
            catch (Exception e) { }
    }In this program the init() method starts the sequencer through the play() method and then continues on so that the “print from init()” statement is printed from the init() method while the sequencer is still playing. Then after the sequencer is finished, it uses the MetaEventListener to detect the end of the sequence and print the “sequence finished” message. I’d like to be able to make it also detect when the sequence changes notes in a similar way... Start the sequence and move on, but then be able to detect each time a note change occurs and print a message.
    Since I am putting the notes at specific midi ticks (multiples of 16, or “quarter notes”) I could poll the Sequencer using getTickPosition() to see if the Sequencer’s tick position matches a particular multiple of 16. However, the problem with this is it would lock up the program since it would be constantly polling the sequencer and the program wouldn’t be able to do anything else while the Sequencer is playing (and I also have a loop option for the Sequencer so that would lock up the program indefinitely).
    Here’s what I’ve found out and tried so far...
    I read in this [this tutorial|http://java.sun.com/docs/books/tutorial/sound/MIDI-seq-adv.html] on the java sun site (under “Specifying Special Event Listeners”) that The Java Sound API specifies listener interfaces for control change events (for pitch-bend wheel, data slider, etc.) and meta events (for tempo change commands, end-of-track, etc.) but it says nothing about detecting note changes (note on/off). Also in the [EventListener API|http://java.sun.com/j2se/1.3/docs/api/java/util/class-use/EventListener.html] (under javax.sound.midi) it only lists the ControllerEventListener and the MetaEvenListener.
    I also read here that MIDI event listeners listen for the end of the MIDI stream, so again no info about detecting note changes.
    It seems like the sequencer should have some way of sending out messages (in some fashion) when these note changes happen, but I’m not sure how or even if it actually does. I’ve looked and looked and everything seems to be coming back to just these two types of listeners for MIDI so maybe it doesn’t.
    To be sure the MetaEventListener doesn’t detect note changes I changed the MetaMessage from:
    public void meta(MetaMessage m)
    {    if (m.getType() == 47) System.out.println("SEQUENCER FINISHED");
    }to:
    public void meta(MetaMessage m)
    {    System.out.println("" + m.getType());
    }so that it would print out all of the MetaMessages it receives. The only message that printed was “47” which indicates the end of the sequence. So the MetaEventListener doesn’t appear to do what I need it to do.
    I realize this is a rather odd problem and probably not many people have had the need to do something like this, but it never hurts to ask. If anyone has any suggestions on how to solve this problem it would be greatly appreciated.
    Thanks,
    -tkr

    Tekker wrote:
    As another idea, since I can't do it with a listener like I originally wanted to, would adding a separate thread to poll the sequencer and send an interrupt when it matches a particular midi tick be a good route to try? My thinking is this essentially act kind of like a listener by running in the background and reporting back when it changes notes.Yep, that worked! :)
    import javax.swing.*;
    import javax.sound.midi.*;
    public class ThreadTestApplet extends JApplet
         public void init()
              ThreadTest threadTest = new ThreadTest();
              threadTest.play();
              MIDIThread thread = new MIDIThread(threadTest.sequencer);
              thread.start();
              System.out.println("  Print from init() 1");
              try { Thread.sleep(1000); } catch (InterruptedException ie) {}
              System.out.println("  Print from init() 2");
              try { Thread.sleep(1000); } catch (InterruptedException ie) {}
              System.out.println("  Print from init() 3");
              try { Thread.sleep(1000); } catch (InterruptedException ie) {}
              System.out.println("  Print from init() 4");
    class ThreadTest
         Sequencer sequencer=null;
         Sequence seq=null;
         Track track=null;
         public ThreadTest()
              System.out.println("Sequencer Started");
              try
              {     sequencer = MidiSystem.getSequencer();
                   sequencer.open();
                   // detect END OF SEQUENCE
                   sequencer.addMetaEventListener(
                        new MetaEventListener()
                        {  public void meta(MetaMessage m)
                             {     if (m.getType() == 47) System.out.println("SEQUENCER FINISHED");
                   sequencer.setTempoInBPM(40);
                   seq = new Sequence(Sequence.PPQ, 16);
                   track = seq.createTrack();
              catch (Exception e) { }
         public void play()
              try
              {     // NOTE 1
                   ShortMessage noteOnMsg = new ShortMessage();
                   noteOnMsg.setMessage(ShortMessage.NOTE_ON, 0, 60, 93);
                   track.add(new MidiEvent(noteOnMsg, 0));
                   ShortMessage noteOffMsg = new ShortMessage();
                   noteOffMsg.setMessage(ShortMessage.NOTE_OFF, 0, 60, 93);
                   track.add(new MidiEvent(noteOffMsg, 16));
                   // NOTE 2
                   ShortMessage noteOnMsg2 = new ShortMessage();
                   noteOnMsg2.setMessage(ShortMessage.NOTE_ON, 0, 68, 93);
                   track.add(new MidiEvent(noteOnMsg2, 16));
                   ShortMessage noteOffMsg2 = new ShortMessage();
                   noteOffMsg2.setMessage(ShortMessage.NOTE_OFF, 0, 68, 93);
                   track.add(new MidiEvent(noteOffMsg2, 32));
                   sequencer.setSequence(seq);
                   sequencer.start();
              catch (Exception e) { }
    import javax.sound.midi.*;
    public class MIDIThread extends Thread
         Sequencer sequencer=null;
         long midiTick=0;
         long midi_progressionLastChord=32;
         boolean print = true;
         public MIDIThread(Sequencer sequencer)
              this.sequencer = sequencer;
         public void run()
              System.out.println("Thread Started");
              while (midiTick<midi_progressionLastChord)
              {     midiTick = sequencer.getTickPosition();
                   if (midiTick == 0 || midiTick == 16)
                   {     if (print)
                        {     System.out.println("NOTE CHANGE");
                             print = false;
                   else
                        print = true;
    }I put in several print statements (with pauses in the init method) and the init print statements continue to be printed while the sequencer is playing, so it's not locking up the system and the "note change" statements happen when the sequencer changes notes. So this part is working perfectly! :)
    Here's what I got for my output:
    Sequencer Started
    Print from init() 1
    Thread Started
    NOTE CHANGE
    Print from init() 2
    NOTE CHANGE
    Print from init() 3
    SEQUENCER FINISHED
    Print from init() 4
    The only problem I'm having is how to "throw" this action back up to the main init method and have it do the print statement instead of the thread class. Throwing an interrupt apparently won't work as you have to poll it to see if it has been interrupted (so it'd be no different than just polling the sequencer to see if it equals the specific midi tick). Maybe throw an ActionEvent? But how to attach it to my applet? Would I need to create an instance of my applet and then pass that into the thread class so it can catch the ActionEvent? And if I do that will it stop the thread or will it keep the thread running so can detect the other notes?... Or is there a better/simpler way to do this?
    Thanks again,
    -tkr

  • How to create the Access sequence for the Vendor+material+plant combination

    Hi all
    Please let me know How to create the Access sequence for the Vendormaterialplant combination..
    Whats the use? What its effect in purhcase and taxe..
    brief me please

    Hi,
    you are asked to maintain the access sequence for the tax condition for which you are putting 7.5%.
    goto OBQ1 or img..financial accounting new...global settings.... taxes on sales and purchases ......basic settings.....
    find the tax condition type. see in it which access sequence is attached.
    if there is none then use JTAX used for taxes in India.
    or you can create the similar one for your.
    to create the same goto OBQ2.
    new entry or copy JTAX.
    and assign the access sequence to condition type.
    this will resolve your problem if you just need to assign the access sequence.
    regards,
    Adwait Bachuwar

  • How do I create multiple midi tracks each with separate external synthesizer sound

    Mac Pro OS 10.10.2, Logic Pro 10.1.1, FireFace 800 (updated), Roland XP-30 synthesizer/keyboard, Mackie mixer.
    XP-30 analog output to Mackie, FireFace monitor to FireFace main inputs and FireFace out to Mackie.
    What I can't get to work: Sound output for monitoring as I record on each of several midi tracks, each with access to my banks/programs.
    Logic automatically set up the multi-instrument and created 16 tracks, visible in the mixer window. I have entered custom banks for the XP-30 and they are working.
    Mt problem is two parts. First, my last experience was with Logic Pro 7 way back.
    Problem two is that when I create midi tracks (except for the first one I created on channel 1) by control-clicking on one of the tracks in the mixer window I get no sound for monitoring. I can see the green monitor indicator for the track shows midi data incoming. I just can't hear it. It's as if there is no designated output. I have checked audio preferences and see the FireFace as input and output device. If i change the channel to channel 1, I get the sound, but then I have two tracks on channel 1 which doesn't work for designating unique sounds to each track.
    I can select "All" for channel and get monitored sound on several tracks; however, they then all play the same sound, of course.
    i can create midi tracks (either instrument or external) using the plus icon, but no matter how i set them up that way, they do not allow me access to my banks/programs.
    In logic Pro 7 it was no problem creating multiple midi tracks, each with a different sound assigned to it. In Logic Pro 10, I am baffled regarding how to accomplish this and get it all to work as simply and nicely as I was able to with #7.
    Make sense? Can anyone help?
    Thanks

    I have it set to Performance mode which according to the owners manual: "This mode makes the XP-30 function as a multitimbral sound
    source, and Performance settings can be modified. If you’re
    using an external MIDI device to control the XP-30 in this
    mode, it will function as a multitimbral sound source."

  • How can I play along with a MIDI sequence in Mainstage?

    Hi folks,
    I have some live performances where I would like to play along with MIDI sequences.  I've been using Mainstage and software instruments, but can't for the life of me figure out how do play along with MIDI sequences.  There's a nice plugin (whose name escapes me at the moment) that lets you play along with looped audio tracks....but a MIDI file would be better for my purposes.  Is there a way to do this?
    Thanks in advance,
    -Mike Kaplan

    Hi
    Not directly within Mainstage.... there could be workarounds using 3rd party applications slaved to MS, but it would be a complete pita (compared to working with scripts to iTunes Playlists or just bouncing the MIDI files to audio).
    CCT

  • Is there a way to view all cameras in the timeline at once without creating a multicam sequence?

    Is there a way to view all cameras in the timeline at once without creating a multicam sequence?  Is there some kind of window I can open where they will show up?  I am scrubbing a timeline and I would like to see all the cameras at once.

    The multicam monitor only shows multiple clips at once when they are part of a mutlicam sequence. is there some reason you don't want to use them inside a multicam sequence for previewing?
    Here is a possible workaround, if your workflow circumstances will permit it:
    Apply a pip preset effect  to each clip in the timeline. Use UL, UR, LL, LR presets and up to four video tracks will display at once. If you need to see more than that, you'll need to tweak their position parameters by hand. When you're done previewing them all at once you just need to delete their effects from the Effects Controls panel.
    I know it's not that neat or quick, but it will let you see everything at once in the program monitor.

  • Premiere Pro CC (2014) Crashes if I try and locate footage/scrub/create a blank sequence, please help

    Hello, this is my first time asking for help on here, I've been going round the forums and web in general for hours and can't seem to find a solution to this. I really hope someone can help me sort this.
    Every time I try and open a project in Pr CC 2014 on my Mac Pro  I get the "Sorry, a serious error has occurred that requires Adobe Premiere Pro to shut down. We will try and save your current project."
    People usually ask for as much detail as possible, so to that end: This is a project that I started on my MacBook Pro Retina, so when opening on my desktop it prompts me to locate the footage. Once I find the first file, as soon as my mouse moves over the clip (at the point that scrubbing would be evoked) I get the warning and it shuts down. I tried to open a blank new project, which does not shut down, until I go to import the footage and again, it only crashes when the mouse moves of the clip to scrub. I tried locating the footage in the finder to sidestep the Media Browser, and that allowed me to select the clip, but crashes once I tried to import it. I thought it may be the footage was corrupted, so I tried other clips with the same result. It also crashes if I just try to create a new sequence, with no footage at all in the project.
    All my other Adobe apps (AME, Pl, Ae, Br, Ai, Ps, Lr, Id, Mu) are working fine. I have uninstalled and reinstalled Pr and AME twice now. I have followed the advice of other posts and renamed/reset/deleted the preferences, plugins in the Library, and adobe folder in users/username/Documents. I have ensured that I have read/write access in all folders. I am running Yosemite on my desktop, but so is my laptop and Pr is running flawlessly on that. I never had this problem with Pr CC pre 2014, so I'm hoping it's not a hardware issue.
    I've also tried turning it off and on again!
    I have reached the end of my tether and consider myself well and truly defeated by this problem. I really hope that someone out there can figure what on earth is going on!
    Mac Pro (Early 2009)
    2 x 2.26 GHz Quad-Core Intel Xeon
    11 GB 1066 MHz DDR3 ECC
    ATI Radeon HD 5770 1024 MB
    and
    MacBook Pro (Retina 15-inch, Early 2013)
    2.7 GHz Intel Core i7
    16 GB 1600 MHz DDR3
    Intel HD Graphics 4000 1024 MB

    Hi Man0fst331,
    Try the following:
    Sign out from Creative Cloud, restart Premiere Pro, then sign in
    Update any GPU drivers
    Trash preferences
    Ensure Adobe preference files are set to read/write
    Delete media cache
    Remove plug-ins
    If you have AMD GPUs, make sure CUDA is not installed
    Repair permissions
    In Sequence Settings > Video Previews, change the codec to one that matches your footage
    Disconnect any third party hardware
    If you have a CUDA GPU, ensure that the Mercury Playback Engine is set to CUDA, not OpenCL
    Disable App Nap
    Reboot
    Report back if anything here worked for you.
    Thanks,
    Kevin

  • Create Slideshow Display sequence property doesn't work

    Create Slideshow Display sequence property doesn't work,
    I have selcted random but the slideshow always plays in order. I searched the scripts for any logi related to this and other properties set, but cannot find any refernce to any of these propoerties:
    transType='Random' transTime='1' firstImage='1' dispSequence='1'>
    How can I make the slideshow start  with a random image each time?
    thanks
    s

    Hello,
    I am back on this question, about how to get the non-flash version of the Creatr Slideshow v1.6 to display the images in a random sequence. Can anyone point me in the right direction, please?
    thanks
    juno

  • Trouble with creating an image sequence in QT Pro 7.4.

    I'm having trouble creating an image sequence in QT Pro 7.4(Windows XP). I have a folder containing a JPEG sequence (alternative a PICT-Image sequenz). I Open image sequence, choose the image-frequency and choose the first image, but QT created only the first image in a self-contained movie. But, the same images with the same procedure with QT Pro 7.2 on another Windows XP- PC created a correctly self-contained movie. Is this a bug in QT Pro 7.4?
    Please help me and apologize for my bad english!

    You have to revert to an older version of QT. After Effects users are having the same issue. Here's a link to a temporary fix (reverting back to older version):
    http://www.adobeforums.com/webx/.3c05dee6
    1) I downloaded QT 7.3.1 from the Apple Support Downloads website.
    2) I downloaded Pacifist from their webiste
    3) I installed Pacifist on my machine
    4) I opened the QuickTime DMG file and drug the PKG file out of it
    5) I launched Pacifist and dragged the QuickTime 7.3.1 PKG file onto the Pacifist window.
    6) I clicked on "Contents of QuickTime531_Leopard.pkg" to select it in Pacifist
    7) I choose "Install" from the Pacifist menu at the top of the window
    It started installing and I chose "Replace" when ever it prompted me. You can actually click a little check box that says "Don't Keep Asking Me This" and then you don't have to click "Replace" a 1000 times.
    9) I restarted my computer (Intel Quad-Core 3 Ghz) went to System Preferences>QuickTime and checked that I was now actually running QT 7.3. YES!!!

  • I need to create an animation sequence in photoshop cs6 longer than 5 seconds

    I need to create an animation sequence in photoshop cs6 longer than 5 seconds. please help.

    What problem are you having that should be easy just create the layer to make frames with. Create a frame animation in the timeline panel. Create the frames and set their display time. Save an animated gif for the web ie "Save For Web"
    Prior to CS6 Photoshop only had a Animation Palette in CS Adobe replaced the palette with the Timeline Palette that can do Frame animations and Video. You can render a fame animation as a video but video does not support transparency like and animated Gif.

  • 3.50mm to 6.35mm plug adapter, music in Midi Sequence for

    Hey all,
    I just bought the X-FI Platinum card to go with my Logitech Z-5500s. The problem is the platinum card only comes with ONE 3.50mm to 6.35mm plug adapter, and two are needed to connect to a headset's sound jack and microphone jack, on the X-FI I/O Dri've. Where can I shop online to buy another 3.50mm to 6.35mm plug adapter? Please link if possible.
    Also, I've noticed that ever since I bought the sound card, the music that I have on the computer that are Midi Sequence Files won't play any sound. It would play on my old onboard nforce2 soundstorm. What is wrong? I have two files that are in this format so I'd like to hear them.
    One last thing. Since I have the Logitech Z5500s and X-Fi platinum, what kind of wire should I need to buy to connect to my TV? and PS2? Thx

    ) http://cgi.ebay.com/ws/eBayISAPI.dll...ype=osi_widget is the type of adapter that you're looking for.
    2) Click on Start->Settings->Control Panel->Sound and Audio devices->Audio Tab and from here set the MIDI music playback device to be your soundcard's synth A or synth B.
    3) It depends on what outputs your TV's got. If it's got a headphone socket you could use 3.5 mm double ended cable to go to your Z5500s aux input from your TV's headphone socket. A better way to do it is to use a phono x 2 to stereo mini-plug cable
    http://www.sonystyle.com/is-bin/wbrI...es_AudioCables
    if your TV's got phono x 2 outputs at the back. You can plug this into your Z-5500s aux inputs.
    You should really be asking this on the Logitech forums.

  • How i create a simple sequence in OWB (Example)

    Hi,
    i want create an simple sequence in OWB. But how i make a simple sequence in the oracle data Warehouse Builder.
    Until now i goes into expression Builder of the sequence.
    where already written is:
    *"SEQ_ACCOUNT".NEXTVAL*
    so my idea was to write behind this start with 1 increment by 1
    also looks it practically so
    *"SEQ_ACCOUNT".NEXTVAL start with 1 increment by 1*
    but this doesn´t work. But was is wrong?
    Can me give anyone an concrete example for a simple sequence or show how it must write that it will be correct.
    I look forward for your replies :)

    I have found the solution for this problem :) To create a seqeunce goes to sequences in project explorer ---> new sequences ---> give name and bla bla bla --> right click on to created sequence and choose confiugre. Here you can under sequence parameter configure things as Increment By and Start with But how goes it into expression builder of a sequence?

  • I want to import one imovie project into another one.  In other words, I have created a short sequence in iMovie 11 on one computer, and I want to import it into a project that I am working on, on another computer.

    I want to import one imovie project into another one.  In other words, I have created a short sequence in iMovie 11 on one computer, and I want to import it into a project that I am working on, on another computer.  I copied the project files onto a hard drive, and then connected that drive to the Mac that my main project is on, but when I select "import" the files are faint gray -meaning I can't select them.  Help!  I want to transfer a sequence of shots from one iMovie 11 project on one computer, into another iMovie 11 project on another computer.

    Tell me it ain't so!
    I wish I could.  The research you've done is correct.
    Wether you copy and paste or rebuild the Project from the other computer, you're going to need to get your Evnets copied from the other computer.
    The Prjoject files only contain pointer back to the original media.
    Matt

  • How to create parallel routing sequence

    how to create parallel routing sequence?
    we have routings 3010 ,3020 ,3030 and 3040.
    but 3010,3020 and 3030 operationwise shop list to be released at one time becuse they all are parallel operations.
    after 3010,3020 and 3030 operations 3040 is a sequencial operation.
    please do explain the process how to create parallel routing sequence in this case
    and confirmation of operations
    thanking you
    srinivas

    Srinivas,
    i think you are looking at an option were in you can confirm or do goods Issue for the order. If that was the requirement, then the control is in customizing transaction "OPK4".
    Here in this transaction you need to define "operation sequence is not checked" for the plant/order type combination.
    Hope this helps....Please let me know if your need is something else,
    Regards,
    Prasobh

  • Can I create a 15fps sequence in FC 6.06?

    I've shot a stop motion video at 15fps but I can't find a way of creating a 15fps sequence to edit it on. All I can find are 24-30 fps. presets. I was thinking of using a 30fps seq. and importing the images with a duration of 2 frames but this will double the length of the video, am I correct? the audio has been recorded so I can't change the video duration as it will mess all the synching up.

    Don't think you can create a sequence at 15 fps, but what's your end use.  If you're planning on DVD or broadcast, you gonna have to eventually convert to a standard frame rate.  Why not do that now. I'd use Compressor to do the frame rate conversion.  You definte the frame rate in the quicktime video settings in the encoder panel and then define how the frame rate is adjusted in the frame controls tab.  You have the option of setting the duration to 100% of source.  I'd advise making the frame rate conversion at the "best" setting.

Maybe you are looking for

  • Error running Organization Lookup Recon in OIM 11g R2 with Active Directory

    Hi all, I have an implementation of OIM 11g R2, with an Active Directory 11.1.1.5.0 connecting to an instance of Active Directory on Windows Server 2008. I am trying to run the "Active Directory Organization Lookup Reconciliation" scheduled task, but

  • 120Hz

    *I am considering getting a 120HZ HDLCD my understanding is when running at this rate the system adds frames to compensate for speed variance, I am considering getting fcp and my questions are; If I make or add frames of my choice to lesser fps video

  • Using Flash Builder

    Is there a way I can export the site so that people can edit it whom are not using Flash Catalyst? Maybe to Builder or Flash? If so what type of file would I be exporting out to and which would be best?

  • JSF Data Table extension using sun's RI

    How do i modify the iteration logic of datatable in JSF? I need for 3 iteration the data table has to insert one row. How do i create custom component for these type of business logic? It should iterate horizontally,

  • JavaScript popup code not working 4 me

    Hi, I am to trying to open pop windows in Flash through JavaScript. Now I found a number of ways to do this on the forums but none is working for me. When I click the swf button containing the pop code (embedded in html), nothing happens. I do not ha