×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    5

    s40 Midi Support

    Hello,

    I have done several hours of searching trying to discover if the s40 (specifically the 2330) supports midi, and how this can be determined programatically from within a midlet.

    I already have code to fall back to tone generation if midi isn't available, but currently I get no errors from the device, and no midi sounds. This works in various j2me emulators and on other real devices.

    I have pasted up a class I am using for testing at http://pastebin.com/e36A3GKq which produces no errors and no sound and would be grateful for any help.

    The questions I have are:

    1) Does s40 support midi in this way?

    2) If so what's wrong with my code?

    3) If not how do I detect this in the program?

    Thanks...
    Last edited by und3f; 2010-04-17 at 12:31. Reason: wrong link

  2. #2
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: s40 Midi Support

    is the device by any chance set on Silent profile ?

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    5

    Re: s40 Midi Support

    Thanks for your suggestion - The phone is definitely not set on silent profile and the volume level in the Player and midi channels is set to 100.

    Possibly related: Further debugging has shown that the Player which the MidiControl is derived from loses it's prefetched state with any calls from my application to deallocate it, and then future calls to prefetch() fail. This was causing the app to throw IllegalStateExceptions when midiControl.shortMidiEvent was called, however even before this happens there is still no sound.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: s40 Midi Support

    Do you have a SIM card inserted into the device ?
    On some devices (like the 5800XM, even if thats a S60) thats needed...

  5. #5
    Registered User
    Join Date
    Apr 2010
    Posts
    5

    Re: s40 Midi Support

    Hi, sorry for the slow reply (was expecting an alert email to tell me there were new messages in this thread).

    The phone does have a sim card.

  6. #6
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: s40 Midi Support

    Hello und3f,

    your test device, Nokia 2330 classic is a Series 40 Lite device, Series 40 5th Edition, Feature Pack 1 Lite to more specific. The Lite Edition is more limited in terms of Java APIs, however AFAIK there should not be any limitations on playing MIDI files (nor there is any public record on that: Java ME API support on Nokia devices)

    Couple questions:

    1) Have you tested this on other Nokia devices (possibly with other Series 40 Lite devices)?

    2) Have you tried to play some other files with MMAPI player by using Nokia 2330 classic?

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  7. #7
    Registered User
    Join Date
    Apr 2010
    Posts
    5

    Exclamation Re: s40 Midi Support

    r2j7,

    Thanks for taking a look.

    1) No - this is the only s40 test device which I have access to.

    2) I'm not actually trying to play a file. Instead I am trying to use the shortMidiEvent method on MIDIControl to play a specific note:

    //sudo-code may not run

    Player audioPlayer = Manager.createPlayer(Manager.MIDI_DEVICE_LOCATOR);
    audioPlayer.prefetch();
    audioPlayer.realize();
    MIDIControl midiControl =
    (MIDIControl) audioPlayer.getControl("javax.microedition.media.control.MIDIControl");

    midiControl.shortMidiEvent(MIDIControl.NOTE_ON | channel, 60 , 100);

    //end of code

    I am currently looking at using a single 200ms wav or mp3 file to play the note instead, but this is not the first choice solution as shipping mp3 and wav files is a bulky way of playing a few notes!

  8. #8
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: s40 Midi Support

    Hello und3f,

    thank you for your answers.

    I will try my best to check this issue during next week once in office.

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

Similar Threads

  1. s40 txt file support
    By ripley in forum Mobile Java General
    Replies: 6
    Last Post: 2006-12-17, 14:30
  2. Which S40 devices support JSR-75?
    By rolloderwikinger in forum Mobile Java General
    Replies: 2
    Last Post: 2006-01-28, 19:20
  3. Does S40 device support SOAP client or XML RPC?
    By potakaka in forum Mobile Java General
    Replies: 0
    Last Post: 2006-01-18, 09:55

Posting Permissions

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