Convert MIDI numbers to note names?

is there a built-in way to get the note name for the corresponding MIDI number and vice versa? 60 ----> "C4"
if so, there would have to be a way to deal with enharmonics, like a preference for "sharp" note names.
internally there must be something of the like, but i can't find a method in the midi api.

is there a built-in way to get the note name for the
corresponding MIDI number and vice versa? 60 ----> "C4"
if so, there would have to be a way to deal with
enharmonics, like a preference for "sharp" note
names.
internally there must be something of the like, but i
can't find a method in the midi api.You have to build it yourself, but it's easy:private static final String[] notes= { "c", "c#", "d" ... , "a#", "b" };
// find the octave number
String midiToOctave(int midi) { return midi/12-1; }
// find the note name
int midiToNote(int midi) { return notes[midi%12]; }
// find the midi number
int noteToMidi(String note, int octave) {
   int i;
   for (i= 0; i < notes.length; i++)
      if (note.equals(notes))
return 12*(octave+1)+i;
return -1;
kind regards,
Jos

Similar Messages

  • Why are my contacts showing numbers and not names

    Why are my contacts showing numbers and not names?

    When you added your contact details in the contact app did you fill in the fields correctly.  For example in contacts where it says "first" did you enter a number instead of a name?

  • How do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    how do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    Hi JN and Barry,
    Barry wrote:
    The second case may not be included in the available D&T formats in Numbers 3
    For my region, the Date & Time data formats include month.
    The Date Pop-Up
    This may not be the case for all regions.
    Remember that the month is only the display, and the Full Date & Time is still there. If I change the format to reveal what is behind the curtain:
    Regards,
    Ian.

  • IPhone messages show numbers and not contact names

    My iPhone in messenger is showing phone numbers and not contacts. My contacts are OK, was working Ok just stopped today. Not sure why?

    huh.. after a lot of experiments it now works
    the contacts in n82 only dsplayed, contacts with names and numbers.. surprisingly when i connected my phone to pc suite and not nseries pc suite and checked the contacts through my computer, i noticed that there were duplicate entries... for all numbers without names
    i deleted them and now its okay
    Thanks anyways

  • Conacts appear as numbers not names

    When notificatiion of texts appear the Conact it comes from appear as numbers not names
    Any thoughts?

    Had same problem and was able to restore names in the text message by going to Settings> Mail, Contacts, Calendars> then change Default Account to iCloud.

  • Displaying numbers not names in messages

    My iPhone 5 is displaying numbers when I get messages not names
    Any ideas?
    TIA

    if your carrier is Verizon take a look at this link http://discussions.apple.com/thread/3752984?tstart=30

  • Converting many numbers files to PDFs?

    Hi everyone!
    I would like to convert many Numbers files to PDF documents. Every Numbers document should be a new PDF with the same name!
    I even tried to write a workflow file with Automator, but I dont get the "create a PDF"-part running.
    Furthermore I googled for 2 hours, but all scripts I found do not work with the latest Numbers version...
    Please help me... Maybe one of you have a Apple Script or a solution using Automator?
    OS X 10.9.3
    Numbers Version 3.2 (1861)

    Dear Lori,
    promptUser =false, see below.
    Does not work.
    All programs that might disturbe PDF output removed from computer.
    Does not work.
    I am now investing some evenings into Word-VBA, making a script loop through the subdirectories over several levels (does Acrobat do that anyway?)...
    Does not work.
    Not yet.
    It will have to...
    best regards,
    Boris
    <?xml version="1.0" encoding="UTF-8"?>
    <Workflow xmlns="http://ns.adobe.com/acrobat/workflow/2012" title="ZOPtest ORT" description="" majorVersion="1" minorVersion="0">
    <Sources defaultCommand="WorkflowPlaybackSelectFolder">
      <Folder path="/nas02/quinsee$/Fachabteilung/ZOP/Standards/Standards NCH"/>
    </Sources>
    <Group label="Unbenannt">
      <Command name="Scan:OPT" pauseBefore="false" promptUser="false">
       <Items>
        <Item name="ApplyMRC" type="boolean" value="false"/>
        <Item name="BkgrRemove" type="integer" value="0"/>
        <Item name="ColorCompression" type="integer" value="4"/>
        <Item name="Descreen" type="boolean" value="false"/>
        <Item name="Deskew" type="boolean" value="false"/>
        <Item name="Format" type="integer" value="1"/>
        <Item name="Language" type="integer" value="-1"/>
        <Item name="MonoCompression" type="integer" value="1"/>
        <Item name="QualityLevel" type="integer" value="1"/>
        <Item name="TextSharpen" type="integer" value="0"/>
        <Item name="doOCR" type="boolean" value="false"/>
       </Items>
      </Command>
    </Group>
    </Workflow>

  • Unknown error -50 converting midi file

    I'm trying to convert some midi files I made to mp3's so I can burn them to a disk. When I select "convert to mp3" from the Advanced menu I get an "unknown error (-50)" message. I've tried this on my iMac and on a Win2K laptop with the same results. I've successfully converted midi files in the past, so I'm not sure what's wrong now. I have iTunes 6 on both machines. My iMac is running the latest update of Mac OSX version 3. Any ideas what this error code means, or how to get around it?

    Nope. For example the album where tracks 11 & 12 wouldn't convert: track 11 is titled "The End Has No End". All other details (artist, album, genre, artwork, etc) are identical to tracks 1-12 & track 13. Yet track 11 wouldn't convert, throwing up the error message when the progress bar was about 25% of the way up, but tracks 1-10 and track 13 convert fine
    Which leads me to another point that makes me think it can't be what you suggested - namely that track 11 fails about 25% of the way up the progress bar, yet track 12 fails AS SOON as I choose "Convert to AAC". If the problem was related to file name characters or whatever you'd expect both of them to fail at the same point, presuming iTunes writes name/tag information at the same point for every file (start or end I'd presume).
    Thanks anyway. Anyone else got any ideas?

  • OS Numbers versus OS Names

    Does anyone know where we can find some type of conversion chart that can be used to convert OSX version numbers, such as OSX 10.6.8, to the "Name" that many use, such as "Mountain Lion", Mavericks", etc., etc. When we go to the "About This Mac" under the Apple, we can easily see the OSX version number, but the name is not provided. What is the name for OSX 10.6.8? What is the version number for "Mavericks"? And the list goes on and on! Very confusing! Why doesn't Apple include the name (under the Apple menu) if that's what we're going to be using?

    gooberpeas wrote:
    Thank you, that helps, however, it would be much more convenient if Apple would drop the names and just use the version numbers. The hierarchy of the various versions are much easier to relate to when referring to numbers instead of names. By the way, when I go to the "About This Mac" under the Apple menu, we see the OSX version number (10.6.8 in my case) but not the name as you suggested. Thanks again!
    it would be much more convenient if Apple would drop the names and just use the version numbers.
    vs
    "When we go to the "About This Mac" under the Apple, we can easily see the OSX version number, but the name is not provided."
    That seems to be the exact opposite of your original question, gooberpeas. I need more coffee

  • Numbers 09 not working - I can open the program but only a few files are available, missing blank, checklist and many others. e.g  when I click on a file I get this error: The document "nmbtemplate is invalid. The index.xml file is missing. help.

    Please let me know what I can do to get my Numbers (iWork 09) working properly again.
    Here is what is going on:
    Numbers in iWork 09 not working can't access Blank, Checklist and many other files within Numbers.   I can open the program but only a few files are available. When I click on the file (which also has no icon just the name of the file) this warning appears:
    The document "Blank.nmbtemplate" is invalid.  The index.xml file is missing.
    I recently had to get a new hard drive installed and had the system upgraded and more memory put in by a Mac certified specialist recommended to me from the Apple store in Northbrook because this was the 3rd time my drive went bad but this time it was to old (I got the IMAC- in 2007) and the Apple store could no longer work on it this time so they recommended a few places that had certified Mac specialists.  Since then Numbers is not working right.
    I'm sure it's something simple to fix, but I've tried re installing it and that didn't work.  Appreciate any help.
    Thanks
    AppMare

    There is one way its getting fixed. Once I update my Adobe Illustrator CC to Adobe Illustrator CC 2014 it is further allowing me to go into the system folder and allocate the font to the file so that it can replace it. My only concern now is that our MAC partners who will receive these files back from us have Adobe CS6. We will down save it to CS6 but I hope they won't experience any font issues because of us using CC 2014? Any light you can shed on this?

  • I updated to OS X Mavericks and now trying to run Logic Pro X on a MacBook Pro mid-2009, using an M-Audio Axiom 49 and an M-Audio Fast Track Pro... Logic keeps telling me that Mac OS X MIDI Services are not available... How do I solve this problem?

    I updated to OS X Mavericks and now trying to run Logic Pro X on a MacBook Pro mid-2009, using an M-Audio Axiom 49 and an M-Audio Fast Track Pro... Logic keeps telling me that Mac OS X MIDI Services are not available... How do I solve this problem?

    I just checked to see if the update to OS X Yosemite 10.10.1 solved any of the issues outlined in my previous post, and to my dismay, nothing has changed -- all of the previous problems persist.
    My iMac (8) -- it's renamed itself eight times since the recent troubleshoot with the Apple tech rep -- shows up as a shared device in Finder on my MacBook Pro, but when I click on it, I cannot establish a connection using "Connect As".  So I've attempted to connect using the menu "Go/Connect to Server...", using both (alternately) the iMac's name and IP address, to no avail.  I get a message which reads: "There was a problem connecting to the server 'Peter's iMac (8)'. This server may not exist or it is unavailable at this time.  Check the server name or IP address, check your network connection, and then try again."
    Here's what I know:
    The server -- Peter's iMac (8) does exist;
    The server -- Peter's iMac (8) is available at this time;
    The server name -- Peter's iMac (8) -- is correct, as specified in the system sharing preferences;
    The server IP address is correct, as specified in the system sharing preferences;
    The network connection is active when I attempt to connect.
    I'm convinced the problems stem directly from the OS X Yosemite update.  None of this was ever remotely an issue in the previous OS X's -- any of them.  This is maddening!  What can be done?  Apple?? Anyone???

  • The document "navidad.numbers" could not be opened.

    I created a document during december, and now I can't open it. It's really important, I need help here.
    I doesn't gives me any explanation only the pop up saying: The document “navidad.numbers” could not be opened.
    Message was edited by: jaimemtz

    jaimemtz:
    This might not help you at this point, but maybe if someone else comes along later, it will help them solve their problem.
    I just had this exact same problem and from the looks of your document title, my fix might work for yours as well.  I fixed the file by editing the index.xml file in the corrupted numbers file.  Numbers '09 doesn't save documents as folders by default anymore, but you should be able to unzip them to folders using something like Unarchiver, 7zip, or a similar program (I used my default archive extraction program, which is called "The Unarchiver").  My problem was that I had put an obscure unicode character in the name of one of my tables.  Look at the console output in Console.app and see if something similar doesn't show up.  I just went into the text file, changed the offending characters to something from ASCII, and renamed the (unzipped) folder to have the .numbers extension, and the file openned without any issues.
    Anyway, like I said, probably won't help at this point, but maybe it will help someone else later.
    David

  • The document "abc.numbers" could not be opened [Numbers 09]

    I’m getting the document “abc.numbers” could not be opened message. I’ve seen this posted about Numbers ’08 but I’m getting this dreaded message with Numbers ’09.
    I’ve unzipped the file and cannot find anything that looks out of the ordinary to me. The buildVersionHistory.plist looks fine, as does the index.xml and QuickLook folder. When I compare these to a new, empty numbers file I can’t see differences besides those expected.
    Any help would be very much appreciated!

    May you attach the beast to a mail and send them to my mailbox ?
    Click my blue name to get my address.
    I wiil try to discover what is wrong.
    I guess that something is wrong in the index.xml file.
    I received several documents with this kind of problem.
    In some of them, the xml file was truncated, in others, it appeared as a 'correctly built' file but Numbers was unable to decipher it. One erroneous character is sufficient to render such a file unusable.
    This is why I wrote many times : backup, backup, backup…
    This means : keep consecutive copies as my backup script is able to build.
    Yvan KOENIG (VALLAURIS, France) samedi 23 janvier 2010 16:05:04

  • I can't Convert midi files into any other format

    A few months ago, I was able to convert midi files into mp3 when one day, I updated iTunes using software update. Ever since the updates I had for my Mac it still hasn't work.
    It has this error that won't allow me to convert. I talked to my friend wrldwzrd89 who is one of my friends and he said that it is because Apple had a piece of data missing allowing midis to be converted to mp3, or any other format.
    Is this true or do you know the solution?

    I can't tell you the exact reason why it doesn't work, but there is an article about this problem and a solution if you have QuickTime Pro:
    iTunes: MIDI files cannot be converted in iTunes 6.0.3 and 6.0.4
    Not the last sentence in the article. That usually means they're working on a fix.
    No guarantee that it will be fixed in the next version however. We'll have to wait and see.
    Hope this helps.
    M
    17' iMac fp 800 MHz 768 MB RAM   Mac OS X (10.4.6)   Several ext. HD (backup and data)

  • Why do my senders of txt messages show up as telephone numbers instead of names?

    Why do my senders of txt messages show up as telephone numbers instead of names?

    Chances are the senders are not in your contacts. 

Maybe you are looking for

  • How can I unistall Vista from Satellite L300-11Q and install Windows XP

    Hello! Help please: How can I unistall Windows Vista from my notebook and install Windows XP? Should I do something with discs and BIOS before it, or I can just format disc C and then install XP from CD-disc? How can I make a recovery disc before uni

  • ICal Alarms not working in iPod

    Around six months ago iCal alarms stopped working on my iPod. They do not even show up when I view a To Do or Event on my iPod. This happened all of a sudden and I have never changed any settings other than installing standard updates. I cannot recal

  • Java interface as method arg question.

    Hello, Imagine that I have the following two interfaces and their associated classes: AI, AC, FooI, FooC where AC and FooC implements the interfaces AI and AC respectively. Assume than that FooI has contains only the following method: public void doI

  • Wrong result of multiplication !!!

    Hello! When i run the following code the result is wrong: double d = 3.4*3.4; System.out.println(d); System.out.println(d/2); The output is 11.559999999999999 5.779999999999999 The correct result is: 11.56 5.78 Is this a bug? When i use float the res

  • Experts plz help ALV issue

    hi all experts plz help i have an alv based on object oriented method in the output i am gettin a toolbar in which i have two buttons like print and export problem is when i click on these buttons i am gettin short dump Field symbol has not yet been