Audiokinetic's Community Q&A is the forum where users can ask and answer questions within the Wwise and Strata communities. If you would like to get an answer from Audiokinetic's Technical support team, make sure you use the Support Tickets page.

How to separate MIDI events in a Callback

0 votes

Hello. I develop a small arcade game for experimental purposes. This game has a dynamic MIDI music background and MIDI sound effects. To analyze the results of the experiment I need to record all player actions and game events including the sound.
As the music is dynamic, I use a Callback on the music background to record all the music MIDI events but I discovered that the MIDI sound effects also trigger the callback (that I only put on the music play event). The music uses a music-box sound and sound effects are drum sounds. To replay them with the right instrument, I need to separate them.

I tried two different approaches :
- the channel : I tried to identifies the channel used for each instrument but it can vary from one execution of the game to another
- the associated gameObject : if I try to Post the sound effect events with another gameObject source, no sound is emitted... the log show that the events are received by Wwise but not played :

    Same gameObject (SoundControler):

    Timestamp    Type    Description    Wwise Object Name    Game Object Name    Wwise Object ID    Game Object ID    Scope
    0:01:03.872    Event    Event Triggered    touch    SoundControler    2040218098    13976    Game Object
    0:01:03.872    Action Triggered    Trigger    touch    SoundControler    2040218098    13976    Game Object
    0:01:03.872    Notification    Scheduled stinger "\Default Work Unit\SoundEffects\touch" on segment "PetrouchkaQuarter\Petrouchka_1" in 0 ms    PetrouchkaSwitch    SoundControler    166949021    13976    Game Object
    0:01:03.872    Notification    Event Finished        SoundControler        13976    Game Object
    0:01:03.872    Notification    Music track "touch" resolved MIDI target "Drums"    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - All Controllers OffMIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - Program Change: 0MIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - CC: 7 Val: 100MIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - CC: 10 Val: 64MIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - CC: 91 Val: 0MIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - CC: 93 Val: 0MIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    MIDI Event    Ch 10 - Note-On: C#2 Vel: 80 MIDI In    touch    SoundControler    665975159    13976    Game Object
    0:01:03.872    Notification    Playing    C2#    SoundControler    856015156    13976    Game Object

    Different gameObjects (SoundControler and SoundEffectEmitter):

    Timestamp    Type    Description    Wwise Object Name    Game Object Name    Wwise Object ID    Game Object ID    Scope
    0:00:21.120    Event    Event Triggered    touch    SoundEffectEmitter    2040218098    13972    Game Object
    0:00:21.120    Action Triggered    Trigger    touch    SoundEffectEmitter    2040218098    13972    Game Object
    0:00:21.120    Notification    Event Finished        SoundEffectEmitter        13972    Game Object
    0:00:21.184    Event    Event Triggered    touch    SoundEffectEmitter    2040218098    13972    Game Object
    0:00:21.184    Action Triggered    Trigger    touch    SoundEffectEmitter    2040218098    13972    Game Object
    0:00:21.184    Notification    Event Finished        SoundEffectEmitter        13972    Game Object
    0:00:21.312    Notification    Stopped    Petrouchka    SoundControler    886202547    13976    Game Object
    0:00:21.312    Notification    Stopped    Petrouchka    SoundControler    886202547    13976    Game Object

I don't know why no sound is played, I suppose that's because sound effects are synchronized on the music with a stinger and the music is now attached to another gameObject.

I have no clue how to separate the sound FX from music to record them separately (other than removing the stingers). Maybe there is an information in the AkMIDIEventCallbackInfo structure that can allow me to separate music and sound FX but reading the documentation I do not find anything useful.

Do you have any clue how to achieve this ?
Thank you in advance for any help you could provide.

 

asked Jan 23, 2020 in General Discussion by Aline H. (130 points)

Please sign-in or register to answer this question.

...