Send MIDI Sequence to GarageBand

Hello,
Is it possible to write a Java program that OSX will see as a virtual MIDI device (just like it might see a real MIDI USB keyboard) so that I can programmatically generate and send MIDI sequences through GarageBand?
I am experienced with Java and C and I have written device drivers. But I am not sure where to begin because I have zero experience with the javax.sound.midi package.
I envision the following: When I run the program from a terminal it initializes a virtual device and then pauses. At this point if GarageBand is running I should see the familiar "The number of midi inputs has changed" message. Then each time I hit <Enter> and it plays my coded MIDI sequence. I can select a different instrument in GarageBand and hit <Enter> again and it will play the sequence again using the new instrument. Pressing 'x' or a special character will cause the device to deinitialize again triggering the aforementioned GarageBand message and the Java program will exit.
Is this possible?
Any direction would be greatly appreciated.
Mike

Hi,
I have a similar question, so I'm curious if you ever found an answer to yours. I was wondering if I could get a Java sound Synthesizer for a native synthesizer AudioUnit (specifically Ivory Pianos). It doesn't look like it.
Rob

Similar Messages

  • Using garageband as a midi sequencer for a synthesizer

    Sorry for the newbie question.
    I have an old korg trinity synth that has some wonderful instruments on it. I want to use garageband just as a midi sequencer. No audio recording going on here, and no usage of the garageband sounds (or just minor use).
    I ordered a midi-usb interface.
    I want to multi-track so I want garageband to record midi on one track while it is playing out midi on another.
    Is this all easy stuff for garageband, or will I hit any snags (like latency?)
    Thanks

    http://www.bulletsandbones.com/GB/GBFAQ.html#midiout
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Send midi from software sequencer to midi out

    I am quite new to logic and sometimes am confused about the midi routing...
    I have a sequencer (Reaktor) in a software instrument track, from wich I want to send midi to my hardware synthesiser. (sometimes maby recording the midi coming out from reaktor to a midi track)
    I have the output channel in Reaktor set to the same as the receive channel of my synthesiser. (everything works fine in Reaktor standalone)
    But I was not able to do it from logic ...
    I tried option-clic on the triangle in the track in the environnement, to draw a beautiful cable to the corresponding midi channel of my instrument track...
    And a few other things...
    My synthesiser still recieve nothing.
    If anyone can show me the road, i will be very grateful.
    Thanks

    Here is thread from the Reaktor Forum:
    http://www.native-instruments.com:80/forum/showthread.php?t=63504&highlight=Midi +Output
    some Ensembles don't transmit Midi to the Outside world - this one does:
    http://www.native-instruments.com/index.php?id=userlibrary&type=0&ulbr=1&plview= detail&patchid=6669

  • "Illegal Sequence" message: GarageBand won't open, possibly due to corrupted files

    GarageBand recently crashed while trying to save a particularly long composition, around 200 bars long at the time, but it's been laggy since it exceeded around 60 bars. Recently, while saving the song, the app suddenly crashed. Now, whenever I open the app, it attempts to load the song and a prompts me with a pop-up message that says "Illegal Sequence (1)" with the option to either "Repair" or "Quit." Neither option appears to have any effect, and after hitting either of them a few times, the app will crash again.
    I have a feeling that some files have become corrupted, and I fear that I will not be able to recover this song. It's the only lengthy composition that I never backed up to iCloud, and I am beside myself for being so careless with a project that I have put over 48 hours into. If I could at least get GarageBand to open to the menu so that I can backup the song to iCloud or email it to myself, the problem would be virtually solved. Even if that didn't work, I could at least have some resolution.
    I'm using GarageBand Version 1.4.1 (180.17) on an iPhone 4 running on iOS 6, because I'm one of those people who hated iOS 7 the moment I saw it and refused to update.
    If anyone has any idea how to fix this, please help. This happened about an hour ago, and it is destroying me.

    Hi,
    I just had this same issue on my MacBook Pro.  I was able to recover the real instrument audio that I had recorded and saved previously, but not the MIDI.  Hopefully someone can help
    Here's what happened: I was saving a composition of about 130 measures, and instead of saving, all of my recorded tracks went blank.  They were still in the right places, but none of them made any sound when I hit play.  I tried reverting to the saved version, but that just brought up a completely blank file.  No recorded tracks, no instruments, nothing.  [picture below]
    I tried reopening the file, and I got the same message you did, "Illegal Sequence (1)" with options to 'Repair' or 'Quit'.  Repair brought up the blank Garageband document as above. "Quit" made garageband crash, producing some sort of divide by zero error in com.apple.main, but my Garageband often crashes instead of quitting so that could be a separate issue. 
    However, I was able to recover all of the recorded audio that I had saved previously (!!).  To anyone else out there with the same problem, just control-click on the damaged Garageband file and choose "Show Package Contents" from the drop down menu.  You'll then see a folder with the components of the Garageband file.  Any audio recordings you've made will be in the Media folder, and you can make a new Garageband file and drag and drop them in. 
    I haven't found where the MIDI sequences are stored, and I lost the last 15 minutes of audio I had recorded. Does anyone know if there's a way to recover them? 
    I'm using Garageband Version 6.0.5 (428.5) on a 13-inch late 2011 MacBook Pro running OS X 10.9.5
    Thanks for any help anyone can give!

  • Detect Note Changes in MIDI Sequencer

    Hi all,
    I&rsquo;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&rsquo;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 &ldquo;print from init()&rdquo; 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 &ldquo;sequence finished&rdquo; message. I&rsquo;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 &ldquo;quarter notes&rdquo;) I could poll the Sequencer using getTickPosition() to see if the Sequencer&rsquo;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&rsquo;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&rsquo;s what I&rsquo;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 &ldquo;Specifying Special Event Listeners&rdquo;) 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&rsquo;m not sure how or even if it actually does. I&rsquo;ve looked and looked and everything seems to be coming back to just these two types of listeners for MIDI so maybe it doesn&rsquo;t.
    To be sure the MetaEventListener doesn&rsquo;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 &ldquo;47&rdquo; which indicates the end of the sequence. So the MetaEventListener doesn&rsquo;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

  • Randomise midi events in garageband?

    Hi. Anyone know of a plugin or method to randomise midi events in garageband? E.g. I'd like to be able to randomise (to a controlled degree) note velocities (preferably within a specified range perhaps ± one or two points) and note beginnings (± a few miliseconds). It's a big project I'm working on so it'd be nice if there were a plugin or some other automated means of accomplishing this.
    Thank you in advance,
    Niall, Dublin, Ireland

    I'm trying to do a similar thing - I'm no expert but here's a few ideas:
    First you need a Transmitter not a Receiver (confusingly) - it takes signals from your keyboard and Transmits them to other receivers in your program.
    So you have a Device, d, a Transmitter, t, and use MidiSystem.getSequencer() to get a Sequencer, s.
    You also need a Receiver for the sequencer, r.
    add the Transmitter to the Device: t = d.getTransmitter();
    add the Receiver to the Sequencer r = s.getReceiver();
    connect them together: t.setReceiver(r);
    The class where you want to do stuff with incoming midi signals should implement interface ControllerEventListener, i.e. it has a method controlChange(shortMessage event) which will be called when the sequencer receives midi via receiver r. Then, provided the above code is inside this class, you can add the event listener to the sequencer by:
    listenedSoFar = s.addControllerEventListener(this, listened)
    where listened is int[], a list of the kinds of messages you want to deal with. Elements can be between 0-127. Class ShortMessage has constatnts for these like ShortMessage.NOTE_ON etc. listenedSoFar is a list of all the kinds of messages this event listener responds to. If this is the first/only addControllerEventListener then listenedSoFar should equal listened.
    I'm not sure this is exactly right as i'm in the middle of writing my program. If you've already cracked the problem then any tips you have would be appreciated.
    George

  • Midi sequences no longer trigger on-beat

    i have had recent problems where my project midi sequences suddenly do not trigger my external synths on-beat anymore - on playback i hear the messages triggered well before the beat. the bizzare thing is that if I record the audio input from that sequence, the recorded audio file is on-beat! if i open a new project everything is fine - so i don't think this is a latency issue. this has happened to a few projects recently. any suggestions on the fix, or what is causing the problem?

    Hi,
    I believe your problem is to with the incorrect PDC implementation Logic has for external midi.
    Unfortunately, you have one of two choices,
    1) do your midi outside logic (which I have sometimes resorted to)
    or
    2) use an external instrument object for your midi in logic, and route the audio output of your external into logic. This way you will get perfect and tight midi on playback, you just better not try record any jazz solos because the latency off course now affects your external midi instrument.
    From http://support.apple.com/kb/HT1213:
    +"Another effect with delay compensation set to All is that MIDI tracks triggering external sound modules will be out of sync. This is because Logic has no direct control over the audio output of external devices. A possible solution for this would be to route the audio outputs from the external MIDI devices to inputs on your audio hardware and monitor them through Logic. This way, the audio streams from the MIDI devices can be compensated during playback. Using Logic's External instrument to route MIDI to your external devices is an ideal way to work in this situation."+
    The above statement is my one and only gripe with logic. All they have to do is not send midi messages for the same amount of time that they set aside for PDC and everything would be great.
    I've heard of others using complicated methods to get around this, but they involve finding out the delay, which changes with every plug in introduced and subtracted, and whether your Mac is having a good or bad hair day.
    good luck.

  • Send Program Changes in GarageBand?

    Can you send Program Changes from a MIDI controller in GarageBand?

    No, you can't change the instrument of a track via midi.

  • Unable to send midi from Mainstage out to Rewire applications

    I can't seem to find out how to send midi out from Mainstage to other applications, such as Reason.
    I created an external instrument channel strip, but in the midi out -box out the channel strip I can only see the physical midi output from my audio interface. The Rewire application should be visible here as an option, shouldn't it - or is there another way to send midi out from Mainstage to be able to play for example Reason instruments with Mainstage? Any ideas what might be wrong? I have Reason open and it seems to be working as a Rewire slave as it should, but somehow it isn't visible as a midi port in Mainstage.
    - Malmberg
    Message was edited by: Malmberg

    Hey Malmberg, I was able to get this to work by doing the following steps:
    Opened Mainstage and my Mainstage concert file first
    Then opened Reason (I only have the demo)
    Selected a patch I wanted to use in Mainstage to Reason
    Clicked + to create a new Ext channel strip
    In the MIDI Out box, I used the dropdown list and choose Reason (see image)
    It could be that the sequence you used so open MS first, then Reason

  • 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

  • How do I change the volume for a single midi instrument in GarageBand 10? Every time I move the volume, it moves back!

    How do I change the volume for a single midi instrument in GarageBand 10? Every time I move the volume, it moves back!

    Every time I move the volume, it moves back!
    Check, if you have a volume automation set on the software instrument track.
    If the track volume automation curve is enabled, the volume slider for the track will move with the automation curve.
    Click the automation curves disclosure triangle in the track header and disable the volume automation.

  • Selecting one of multiple midi inputs in Garageband

    Hi,
    I've connected an M-Audio Midisport 4X4 to my powerbook G4 and am trying to control the synths in Reason Adapted at the same time as a synth in Garageband, in order to play them together.
    Does anyone know how to select the midi input in Garageband? At the moment it only acknowledges that there are 4 inputs and all controllers set off the synths...Reason is fine, you can select which midi input you want...I have Garageband 2...does version 3 have this option or have I overlooked something in 2?
    Thanks for your help,
    Alex Taylor

    shippo_uk wrote:
    Is this possible and if so how do I acheive this please?
    yes, you can build an instrument:
    http://www.bulletsandbones.com/GB/Tutorials.html#buildaninstrument
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • Can't import midi files in garageband 11 after lion install?

    I can't import or open midi files in garageband 11 ,tried reinstalling from my app dvd, will not allow, it is grayed out was using snow leopard and updated
    to lion and thats when it quit also my quicktime pro 7 will no longer export midi.

    Same here. Now that I think of it, I recently put in Logic Studio 8 and Garageband didn't open on it's own anymore. That was iLife'06. I then up-graded to iLife '08 and Garageband still doesn't open to a new project. The only way I can still open Garageband is to make a "template" out of one of their demos, then when that opens I strip the tracks out and start with new ones. By the way, I just tried to install XLN Audio's Addictive Drums. They work in Logic Studio, but do not open at all in Garageband. Error message says the plug-in is not "valid". So much for Garageband being easier than Logic.

  • Cant get macbook pro to send midi signals

    I have a new Macbook pro running 10.8.2 and I am trying to send midi singals to an Elation Magic 260 light controller. I have an M-Audio Midisport USB Uno connected from the macbook to the magic 260. I have installed the drivers for the uno, I can see it show up in my AMS screen and have created an external device for my Magic 260. When I go to test the setup...I get no sgnal coming from the macbook. Just wondering if anyone out there can offer some insight or advice?
    Thanks in advance!
    Derek

    Click here and follow the instructions.
    (125998)

  • Editing a midi file in GarageBand 09

    Just downloaded a midi soundtrack, a karaoke version of a popular song. I plan to track in original vocals, but I have additional verses of lyrics that will require repeating sections of verse and chorus to accommodate.
    As cool as midi is on Garageband, it don't see those (GB file) cleavage points that can be grabbed and manipulated.
    Is there an app that will allow me to convert the midi file into a standard GB file I can work with, or a way to section the midi track for looping and/or repeating in GB?
    At a complete stand still on this;-(

    Good to know. I will have to contact the MP3 site, because I don't see a tempo designation in the limited documentation. I do have the option to download the same song, but in different keys (+/-) 3 half step intervals from the original key the song was done in. Nothing seems happen when I change the key and tempo in Garageband. Another thing I have to dig into.
    Yeh, I was one increment off on my cut point, and when I extended the song, there was a slight audible disassociation at the join points. I'm still curious about monitoring capability when paused, with respect to dragging the tape head line manually and listening to the audio around the cut point or should I say split point.
    The song is set up: intro-verse-verse-chorus-verse-verse-chorus-instrumental break-verse-verse-chorus-verse-verse-chorus-instrumental break-verse-verse-chorus-verse-verse-chorus....ending.
    If I were to just delete the ending, and then grab the last chorus and pull (stretch) the whole track it to the right, what part of the song is expanding? I tried doing this, but the pattern became altered, forcing me to sing through an instrumental break, to keep the vocal coherent.
    I should have copied the section, after the intro and before the ending, and added that, between the body and the ending. I'll try that tomorrow:-)

Maybe you are looking for

  • Verizon Cloud is a Mess

    I have been using Verizon Cloud to back up my contacts, documents, and photos. I recently decided to delete some of my contacts from my backup. What a nightmare! First, when logging into My Verizon and trying to manage my contacts from the link provi

  • Payment of advance against po to vendor

    hi friends..            if advance is to be paid to the vendor, how should we communicate it to finance department in sap.. i know that advance can be payed through f-47, but how purchase department will communicate to pay advance.. hope my question

  • The INSERT button does not toggle between inserting text and overwriting text, but just stays in insert. Is there a way to switch to overwriting text?

    I am using Firefox to fill in forms in our library cataloging system, InMagic Genie. With IE, I can toggle back and forth from insert to overwriting text with the INSERT button, but it has no effect in Firefox.

  • Odd issue when splitting stereo files..

    One very useful feature in AA CS 5.5 is splitting stereo wavs into two mono files. I work in games developer and need this. But an issue has arisen with a tool I use that converts to a particular format for Sony PSP games: it doesn't like these split

  • I cannot update iTunes.

    I cannot update iTunes.  On Windows 7 IE 10.  I get message "The feature you are trying to use is on a network resource that is unavailable.  Enter an alternate path to a folder containing the installation package iTunes64.msi