How to get the thread a sequence plays on?

Hi, this is sort of a continuation of an earlier question... I have a sequence that plays back with imperfect timing. I would like to 'get a hold' of the thread that it plays back on in order to check / change its priority, etc.
But a Sequencer is an interface; and it is gotten from the MidiSystem, which is also an interface. I am stumped as how to go about accessing the Java Sound Sequencer thread which does in fact get created by my program when I get a Sequencer from the MidiSystem.
An excellent suggestion was given to me to extend Sequencer, then use the Thread.getCurrentThread() on my "MySequencer" object. To get a Sequencer, you call MidiSystem.getSequencer() - I can't figure out how to get a "MySequencer" (object that extends Sequencer) rather than a Sequencer from the MidiSystem.
So, to be clear, my question is - Is there a way to get a reference to the thread that a sequence plays back on?
Forgive me if this is a boneheaded question... I should have taken more Java classes back when I was in school...
Thanks

You think the GUI should be sluggish and keyboard and mouse capture delayed so someone can hear Fur Elise with precise timing as they laggingly scroll through a JTable with their mouse while waiting a few seconds for button clicks to occur?YES! That's ABSOLUTELY what I am suggesting. In none of my previous posts have I said or even suggested that the MIDI file was to be playing in the background have I? This program is about real time music recording and playback. Live, that is.* In front of an audience*. If a midi burp were OK with me, I would not have been pursuing this, would I? Everything I have posted is in relation to the timing needs I have for this program. I don't care if the flippin' screen goes blank, if the MIDI timing is good.
OK?
Briefly: The program has two main ... uh.. use cases. First, the GUI is used to pre-program which clips are to played where. This is not done in real time, so I am indifferent to any consideration of timing. It is mainly for this that I use the JTable. But in the Second case, when the play button is hit, the sequence plays and the clips are triggered according to what was previously been entered int the JTable. This sequence plays a drum track which I play along with. The sequence also triggers the clips to be played (via MetaMessages) which have to be to be in time with everything else - or else the program is utterly useless. So I hope you can see that at this point, the GUI doesn't really matter that much, but the timing of the MIDI sequence is crucial.
I agree with you that perfect midi timing might not be all that important for everyone. But here's a quote from the Java Sound tutorial:
"The Java Sound API does not include sophisticated sound editors or graphical tools, but it provides capabilities upon which such programs can be built."
Surely Sun would not expect application designers to go to the trouble of building such programs if the Java Sound API was designed to deliver flawed Midi timing at best? Am I mistaken in thinking that stable Midi timing is possible? From all that I have read over at the Java Sound Resources web site it seems that not everybody suffers from bad MIDI timing.
-Scott

Similar Messages

  • How to get the loaded client sequence file path/name?

    I added a step in Process model, and wanted to get currently loaded client sequence file name/path. I used the variable of "SequenceFile.Path" but then I realized what I would get is the process model file path, not loaded client sequence file path/name. How can I get loaded client sequence file path/name?
    Thanks!
    Jacky

    I dont understand what you are trying to achieve.  Can you provide more information.
    If you are trying to dynamically load and run a client sequence file at run time you need to make a couple of calls to the TS API from inside the process model, Engine.GetSequenceFileEx to get a reference to your sequence identified by its pathname, and then Execution.ClientFile to tell the process model which sequence you want to run.
    Steve
    There are 10 types of people in the world that understand binary, those that do and those that don't.

  • How to get the Thread in another running application??

    Hi,
    If I have a java application running (as daemon), how can I get the running thread context from another new started java application?
    What I'm trying to accomplish here is that, after I started a daemon thread ( a ServerSocket program ), I want to write another program to control the running thread ( query the status, stop it, or restart it ...).
    Any help will be highly appreciated! Thanks.

    A different java application runs in a different Processand they cannot share anything.
    Any lucky out there? Anyone tried something on this?

  • How to Get the iPhone to NOT Play All Audio Through Bluetooth Earpiece?

    I have a Jawbone earpiece, and when it's connect to my iPhone, all sounds (not just telelphone conversations) are sent to it. Since I don't leave it in my ear when I'm not on a call, I don't hear alerts for incoming messages and e-mails. Is there a way to change this behavious so that only the audio from telephone conversations is sent to my earpiece?

    I got the answer here:
    http://forum.java.sun.com/thread.jspa?threadID=5149132&tstart=15
    I tried getDuration() before, but it always return a same time, I think maybe I didn't realize the player.

  • Firefox V 25.0.1 on an iMac OSX 10.9 will not play streamed audio from a web site. Audio on Safari V7 OK. Any ideas on how to get the Firefox audio to play?

    The audio on the site is in MP3 format. The site is coded in PHP.

    I'm not sure if the current Firefox release is supporting MP3 in an audio or video tag if that is what is used to play this media file.
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=851290 bug 851290] - Use GStreamer on Mac for H.264/MP3/AAC playback (instead of AV Foundation)
    <i>Please do not comment in bug reports: https://bugzilla.mozilla.org/page.cgi?id=etiquette.html</i>

  • How do I get the iTunes festival to play on my Apple TV in the evening, as I work during the day and can't watch it at 4:00pm?  I have the app installed on my iPad and can't get it to play!

    How do I get the iTunes festival to play on my Apple TV in the evening, as I work during the day and can't watch it at 4:00pm?  I have the app installed on my iPad and can't get it to play!

    I haven't received an answer. I hope someone can answer this because it's an ongoing problem that I can't play some CDs on my MacBook Air (see my original post for the details). Anyone? Please? Thanks in advance!

  • Question: how to get the adobe plug in to play a downloaded flv file ?

    I want to know how to get the flv adobe plug in which i downloaded as a result abc or nbc or cbs.com i forget exactly which said i had to and also it seems to be used for playing most all videos from web such as those from utube,hulu, etc. So my question is how do i get the plug in to play any downloaded *.flv video ?  The particulars on the one i have is:
    Output folder: C:\WINDOWS\system32\Macromed\Flash
    Execute: "C:\WINDOWS\system32\Macromed\Flash\uninstall_plugin.exe"
    Extract: NPSWF32.dll
    Extract: NPSWF32_FlashUtil.exe
    Extract: flashplayer.xpt
    also perhaps FLVPlayer.swf of about 9Kb may have something to do with it?
    And the latest update i have was about jan 13 when it seemed to automatically take over my system and update itself.x
    I know it has the ability to do what i want- which is full screen cropped ,change aspect ratios etc. and seems
    It has to be able to or else it could not play the files and give those options which it does on some videos like from utube etc. in the first place. Unfortuneately it has something also to do with the useless *.swf files which are apparently of no use to anything and could certainly be eliminated .
      I have downloaded several freebie flv players such as bs player etc. etc. but they all have so many faults and are not suitable. Bs player does what i want but it hangs , have to go to system mgr. to get out of it sometimes , often difficult to use etc.etc. The main features is i need is to be able to make and play playlists to automatically in full screen one after the other in a specified order with NO user intervention and the ability to magnify or 'pan in' i guess they call it and change aspect ratios so that i can have full screen as if just cropping part of horizontal such as if want to view a 16/9 aspect ratio on a computer as i have with the prior standard 4/3 aspect and change a downloaded vertically stretched to a cropped instead etc.
        Also it doesn't make sense to download others and take up disk space when already have the adobe - also adobe seems to be the only one that plays hulu flv's correctly - on other flv players the video and audio are way out of sync and not just by few seconds but often by a minute or more. I know there is another 'pain' way to do it which is create a *.avi or other extension with loss of clarity etc. which have done but would like to be able to just do it in real time while playing the flv file itself as for example
    as bs player does.
       Anyway if there is no way to get adobe to do this does anyone know of any other free flv player downloads which will do what
    i want - basically playlists, magnify , pan,crop and still full screen, change aspect ratios -  other than bs player ?

    The plugin is what it is: a browser plugin - it cannot act as a standalone player.
    To play local flv files you either need to
    download/install the standalone player (Projector) from http://www.adobe.com/support/flashplayer/downloads.html
    download/install Adobe Media Player http://www.adobe.com/products/mediaplayer/

  • I have the Itunes match but am getting radio ads after upgrading. How do I get the Itunes radio to play ad-free again?

    I have the Itunes match but am getting radio ads after upgrading. How do I get the Itunes radio to play ad-free again?

    Hello fortcoins,
    It may help to turn iTunes Match off, then back on.
    Windows: While holding down the shift key, choose Store > Turn Off iTunes Match.
    Turn iTunes Match on by selecting Store > Turn On iTunes Match.
    How to troubleshoot iTunes Match
    http://support.apple.com/en-us/TS4054
    Cheers,
    Allen

  • How to get each thread in the threadpool

    Hi,everyone.I'm now learning java.util.concurrent package and I have two questions about the threadpool.
    1) How to get each thread in the threadpool;
    2) How to get each thread's data in the threadpool and dispaly them onto GUI;
    e.g :
    There are 5 threads in the threadpool(ThreadPoolExecutor) and I have 100 tasks(Runnable or Callable),every task scans a directory(every task scans a different directory),how can I display the "real-time" count of the files in the directory which the current 5 threads in the threadpool scan onto the ListView Items in the GUI?

    Willings wrote:
    Hi,everyone.I'm now learning java.util.concurrent package and I have two questions about the threadpool.
    1) How to get each thread in the threadpool;You don't
    2) How to get each thread's data in the threadpool and dispaly them onto GUI;
    e.g : You don't
    There are 5 threads in the threadpool(ThreadPoolExecutor) and I have 100 tasks(Runnable or Callable),every task scans a directory(every task scans a different directory),how can I display the "real-time" count of the files in the directory which the current 5 threads in the threadpool scan onto the ListView Items in the GUI?You should notify your "monitor" when you add something to the pool, and the Runnable/Callable should notify the same "monitor" when it starts to execute, and during its processing. Finally you notify the monitor when the execution has completed.
    Kaj

  • HT204370 how do i get the movie sound to play through the TV speakers, It is connected to my mac bookpro but the sound only comes through my macbook pro

    how do i get the movie sound to play through the TV speakers when watching a movie from Itunes, It is connected to my macbook pro but the sound only comes through my macbook pro.
    Thanks

    Transfer the movie from your iPad to your MacBook then. =)
    iOS: How to transfer or sync content to your computer
    http://support.apple.com/kb/HT1296

  • How do I get the same song to play on the main menu and during scene select

    I would like the music to play continuously throught the menu and scene selection. As it is I have to drag the audio file into each scene selection, and the music starts at the beginning.
    At least, is there a way to remove the awful sound track that iDVD has on the themes?
    iMac 20 core Duo   Mac OS X (10.4.8)  

    Yes I can add audio, how do I get the same song to play throughout the chapter menus? I have 30 "chapters", which are scenes from an hour of home movie. Can the same song play continuously throughout the different chater menus?. As it is now, I have to drag an audio file into every submenu, and it starts the song at the beginning for each chapter menu.
    Otherwise, that same song that is preloaded on the theme is played. I hope this makes sence, kind of hard to explain. Thanks

  • I have downloaded a TV episode of itunes but it is only showing the HD version. How do I get the SD version to play on my ipod?

    I have downloaded a TV episode of itunes but it is only showing the HD version. How do I get the SD version to play on my ipod?

    When buying HD versions of shows, only the HD copy will automatically download now (probably due to requests from people who don't need/want the SD version and complained about it being forced on them). The SD copy can be downloaded from your purchases area in iTunes. On the main iTunes Store page, go to Purchases under the Quick Links and then select TV shows. Click the "Not On This Computer" button. Uncheck the "Download HD when available" box and you should then see the SD copies of the shows and be able to download them.
    Regards.

  • How to get the values of all elements and sub elements from  following xml

    how to get the values of all elements and sub elements from following xml...
    <?xml version="1.0" encoding="UTF-8" ?>
    <List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
    <TransactionID>TransactionID</TransactionID>
    <Match>
    <Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
    <List_Matched_Field>
    <FSFM_Matches>
    <NUMBER>NUMBER</NUMBER>
    <TERROR>TERROR</TERROR>
    <TU>TU</TU>
    <NAMEU>NAMEU</NAMEU>
    <DESCRIPT>DESCRIPT</DESCRIPT>
    <KODCR>KODCR</KODCR>
    <KODCN>KODCN</KODCN>
    <AMR>AMR</AMR>
    <ADDRESS>ADDRESS</ADDRESS>
    <SD>SD</SD>
    <RG>RG</RG>
    <ND>ND</ND>
    <VD>VD</VD>
    <GR>GR</GR>
    <YR>YR</YR>
    <MR>MR</MR>
    <CB_DATE>CB_DATE</CB_DATE>
    <CE_DATE>CE_DATE</CE_DATE>
    <DIRECTOR>DIRECTOR</DIRECTOR>
    <FOUNDER>FOUNDER</FOUNDER>
    <TERRTYPE>TERRTYPE</TERRTYPE>
    </FSFM_Matches>
    <OfacMatchDetails>
    <UID>UID</UID>
    <TITLE>TITLE</TITLE>
    <SDNTYPE>SDNTYPE</SDNTYPE>
    <REMARKS>REMARKS</REMARKS>
    <ID_UID>ID_UID</ID_UID>
    <IDTYPE>IDTYPE</IDTYPE>
    <IDNUMBER>IDNUMBER</IDNUMBER>
    <IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
    <ISSUEDATE>ISSUEDATE</ISSUEDATE>
    <EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
    <ADDRESS1>ADDRESS1</ADDRESS1>
    <ADDRESS2>ADDRESS2</ADDRESS2>
    <ADDRESS3>ADDRESS3</ADDRESS3>
    <CITY>CITY</CITY>
    <STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
    <POSTALCODE>POSTALCODE</POSTALCODE>
    <COUNTRY>COUNTRY</COUNTRY>
    </OfacMatchDetails>
    </List_Matched_Field>
    </Match>
    </List_AML_Finacle>

    avoid multi post
    http://forum.java.sun.com/thread.jspa?threadID=5249519

  • How to get the View for a particular Document position?

    Hi there,
    Does anyone know how to get the "deepest" View that is responsible for rendering a particular Document offset?
    I tried looking at modelToView() and some other methods, but I am lost.
    Can anyone please help me?
    Thanks,
    Swati

    Bart--
    To find the table cell of the insertion point, you could use something like:
    InterfacePtr<ITextStoryThread> storythreadp(txtModel->QueryStoryThread(startPos + 1));
    InterfacePtr<ICellContent> cellcontentp(storythreadp, UseDefaultIID());
    if (! cellcontentp) {
      // Not a table cell, so see if it's the primary thread (kTextStoryBoss/ITextModel).
      InterfacePtr<ITextModel> threadmodelp(storythreadp, UseDefaultIID());
      if (threadmodelp) {
        // It's the primary thread...
      else {
        // It's something else with an ITextStoryThread (note, footnote, etc.).
    else {
      // The insertion point's in a table cell (kTextCellContentBoss).
      InterfacePtr<ITableModel> tableModel(cellcontentp->GetTableModel(), UseDefaultIID());
      GridID gridID(cellcontentp->GetGridID());
      GridAddress gridLoc(cellcontentp->GetGridAddress());
      // ...and so on.
    Hope this helps get you where you want to go.
    Chris Roueche / Freelance Developer

  • HT5731 I bought a full season of a TV show. I downloaded all episodes. When I go into my iTunes library, select the episodes I get a message of: This computer is already associated with an Apple ID. I can't for the life of me get the TV show to play.

    I bought a full season of a TV show. I downloaded all episodes, I went to my  iTunes library, selected the episode I wanted to watch. I got this message: This computer is already associated with an Apple ID. I can't for the life of me get the TV shows to play. I went on iTunes and when to my purchases. Clicked on the episodes and the same message popped up. How do I get these to play? I also see my download box with an error message saying it has paused the download. I click unpause and it just pauses again. I have been able to get one of the episodes to play once through, but now it gives me the same message.

    It's been months, so you may not care anymore, but you can't download songs from multiple Apple IDs over a 90 days period.  Sorry, it's not allowed for legal reasons.

Maybe you are looking for