×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    May 2007
    Posts
    51

    Playing MIDI events not working?

    Hello,
    I tried to play a MIDI event on a S60 phone using the MIDIClientUtility class.
    Since I am not allowed to post attachments here, I try posting the relevant portions of my code directly:
    MidiClientObserver is a class implementing MMidiClientUtilityObserver
    Code:
    void CSequencerAppUi::ConstructL()
    {
    ...
        MIDIObserver=new MidiClientObserver();
        MIDI=CMidiClientUtility::NewL((*MIDIObserver));
    }
    Code:
    TKeyResponse CSequencerAppUi::HandleKeyEventL(
        const TKeyEvent& aKeyEvent,TEventCode aType)
        {
        	if (aType==EEventKey)
        	{
        		
        		
        		TTimeIntervalMicroSeconds duration(1000000);
        		MIDI->PlayNoteL(1, 60, duration, 64, 64);
        		return EKeyWasConsumed;
        		
        	
        	}	
        	return EKeyWasNotConsumed; 
        }
    The code compiles and runs fine, I just don't hear any sound...
    Has anyone any idea what's wrong??

    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: Playing MIDI events not working?

    Never used Midi player, usually if I want some kind of tone played, I just use Toneplayer, anyway maybe it doesn't fit your requirements.

    All and all, did you check if there is SetVolume or simalar that you could use for setting the audio volume. Alse remember to check if there is a function for retrieving the actual Max-Volume, it may vary between devices and the emulator.

    yucca

  3. #3
    Regular Contributor
    Join Date
    May 2007
    Posts
    51

    Re: Playing MIDI events not working?

    Well I need to create a synthesized sound like a drum etc. not a simple tone, that's why I am using the MidiClienUtility.
    I tried using SetVolume() but it didn't help.
    Playing a complete MIDI file work perfectly though. And playing WAV samples works too.
    I am assume there is something wrong with the PlayNoteL, NoteOn and NoteOff functions of MidiClientUtility.
    Any help would be greatly appreciated.

    Thanks
    codepatch

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Playing MIDI events not working?

    Were you able to make it work properly?

Similar Threads

  1. Midi file playing problem
    By haristeguh in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2006-04-06, 01:02
  2. Replies: 2
    Last Post: 2004-04-20, 16:45
  3. Playing a MIDI file(well, trying to)
    By EvilCartman in forum Mobile Java General
    Replies: 3
    Last Post: 2004-02-13, 19:50
  4. trouble playing MIDI and WAV concurrently
    By dkainer in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-12-10, 02:03
  5. Weird problem in playing midi with 3300
    By shuto198 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2003-09-04, 20:01

Posting Permissions

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