Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice

Maestro Midi Player Tool Kit - Good news for your rhythm game !

Discussion in 'Made With Unity' started by BachmannT, Apr 14, 2018.

  1. rmacgillis

    rmacgillis

    Joined:
    Feb 5, 2014
    Posts:
    8
    Update,

    Very odd:

    I'd only tested on my tablet which has Android 8.1.0. Never could get the sound from just cutting out within minutes.

    Decided, what the heck, tested it on my cheap phone which also has 8.1.0 , and the Streamer never cut out, and I thoroughly tested it!

    So could a midi issue like this just be related to hardware? Or maybe some program on the tablet it conflicts with?
     
  2. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    300
    Hard question you have!
    Normally, Unit is able to play on every hardware and Maestro use only standard Unity functions. So, the difference could be when compiling your project for Android. Have you the correct app bundle ? It's often an issue on this side.

    Regards
    Thierry
     
  3. rmacgillis

    rmacgillis

    Joined:
    Feb 5, 2014
    Posts:
    8
    Yeah. I suppose I will experiment with different build options and let you know. Thnks. BTW, on the tablet, it's not just midi audio that cuts out, ALL audiosources, non-midi, produce no sound when the cut out happens, yet, there are no debug.log error messages in the build (which I can read using a plug-in).

    It's a Samsung Tablet, maybe that's the problem....
     
    Last edited: Apr 24, 2022
  4. Alvarezmd90

    Alvarezmd90

    Joined:
    Jul 21, 2016
    Posts:
    147
    Hey there Bachmann, I've updated my project to the latest version and it's still all working flawlessly.
    I also revamped the music system of Ocarina Of Time and make it so it only has to read from a single soundfont instead of multiple smaller ones. I can now use streamplayer to make the player input keys on the ocarina. However, I don't know how I can make it so that...
    Code (CSharp):
    1. Stream.MPTK_ChannelForcedPresetSet(43,-1);
    2. Stream.MPTK_PlayEvent(NotePlaying);
    play's a different instrument on the soundfont. It's index 43 that is of the ocarina. I tried multiple things but it seems to remain on index 0 accordion. Am I doing something wrong?
     
  5. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    300
    Good news!
    For your issue, look here the API documentation for this method: https://mptkapi.paxstellar.com/d3/d..._synth.html#aa028db91cbec41e3bbe9e27e52d9a99e
    Change your code with:
    Stream.MPTK_ChannelForcedPresetSet(0, 43);
    (if the channel of your MIDI event is 0)
    Regards
    Thierry
     
    Alvarezmd90 likes this.
  6. Alvarezmd90

    Alvarezmd90

    Joined:
    Jul 21, 2016
    Posts:
    147
    Thanks, yes, that does the trick!
    However, for some unknown reason I ran into a new issue now that when this note is played, it cancels the current song being played, instead of overlapping with the current song. I use midistreamplayer alongside midifileplayer. I tried changing the id session or channel but it keeps cutting out when I play a note. Should there be a special value set somewhere to bypass this behavior?
     
  7. BachmannT

    BachmannT

    Joined:
    Nov 20, 2016
    Posts:
    300
    Have you two separate prefab like this ? (see the demo CatchMusic)
    upload_2022-4-28_7-27-6.png
     
    Alvarezmd90 likes this.
  8. Alvarezmd90

    Alvarezmd90

    Joined:
    Jul 21, 2016
    Posts:
    147
    Works like a charm. Thanks! :D
     
unityunity