Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] MIDI Unified 5.x

Discussion in 'Assets and Asset Store' started by Foriero, Mar 26, 2016.

  1. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi Daniel, I was able to fix CSharpSynth.cs with ConcurrentQueue and also fixed your suggestion about AudioSettings.outputSampleRate.

    I feel like there is no need to fix anything in AudioSynthesis if we access it only from one thread from unity.

    Anything else you need to fix?
     
  2. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Struggling just with these lines :

    // Create synth
    sampleRate = AudioSettings.outputSampleRate/sampleRateDivider; // default is sampleRateDivider = 1;
    AudioSettings.GetDSPBufferSize(out bufferLength, out numBuffers);
    midiSynthesizer = new Synthesizer(sampleRate, channels, bufferLength / numBuffers, numBuffers, polyphony);

    The issue is when I have sampleRate = AudioSettings.outputSampleRate/2; THEN the audio is playing two time HIGHER.

    Any idea how to fix that.

    PS : No worry you can set the sampleRateDivider ( 1, 2, 4 )
     
  3. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Hi Marek, I cannot update your git repository because the fix isn't in the AudioSynthesis library but in your CSharpSynth class. However, I've attached the file containing our version of the fix, for anyone interested. I can't promise that everything is correct but it works for us. Using a concurrent queue like you did may also fix the problem; it depends on how you did it, but as long as all calls to AudioSynthesis are done on the same thread, it should be ok (the InitSynth stuff is already covered by playEnabled).

    Thank you for using the Unity-specified sample rate on the synth. If you can, it's likely better to remove the user-specified sample rate from the inspector in the MIDIUnified settings, in order to avoid confusion.

    As for the last part, we simply replaced the custom sample rate for the AudioSettings.outputSampleRate here:

    return CSHARPSynth.Start (AudioSettings.outputSampleRate, settings.channels);

    What are you trying to change with those lines?

    Lastly, I believe it is in the interest of all users that you at least fix the problems with MIDIUnified 5, even if you are only going to include major new features in the next version. I don't agree with your upgrade system because the asset is very pricey and not documented, but won't try to say you are wrong. Just please consider giving your already paying users the needed fixes. Documentation would also be appreciated!

    Cheers,
    Daniel
     

    Attached Files:

  4. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    As for your question of further fixes, if you have fixed the soundbanks not being copied on iOS and the switch statement in SoftSynth.mm having the cases wrong, those are mostly the stuff we found needing a fix.

    Then there's the most glaring "issue" of missing documentation for all your classes with user-accessible methods. :) And some confusion between what is NATIVE and what is NONE and etc, but those would be solved with documentation too.

    PS: regarding your PM, I and my colleague haven't yet tried to control the volume of either MIDI or the synth, so I can't be of help there.
     
    Last edited: Nov 30, 2017
  5. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi Daniel, yes I removed the frequency completely. You have only option to divide AudioSettings.outputSamplerRate by enum ( 1,2 or 4 ). Which is important for C# synth since to have 44kHz is a bit CPU intensive. So if we instantiate 22kHz then it is clear that it will sound one time higher if we don't do anything with buffer sizes. I put everywhere tooltips for MIDISettings and also will try to work a bit more on documentation.

    I will look into SoftSynth.mm issues. And that copy sf2 into iOS.

    ConcurrentQueue works fine. I don't have any mentioned issues anymore.
     
  6. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Alright, sounds good!

    Played notes would be in another octave if the dividers are used, but that may probably be countered by sending all MIDI NoteOn messages in a different octave too (theoretically, because haven't tested this!). The user may do this him/herself, but its advisable to warn him/her, maybe in those tooltips. :)
     
  7. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Good news. I was able to completely fix C#Synth.
    More good news. We are going to implement AlphaSynth ( which is another version of pure C# synth algorithm )
    More good news. We are looking into implement fluidsynth into MIDIUnified.

    If anyone is used to compile crossplatform with cmake please let me know we need your help.

    Marek.
     
  8. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Ok SoftSynth.mm fixed. So the only what is missing is that copying sf2 file int iOS build.

    Will check that. If anything else needed please let me know.
     
  9. amgadani

    amgadani

    Joined:
    Jul 8, 2017
    Posts:
    1
    Hi Foriero, I am getting a runtime error from Microsoft Visual C++ Runtime Library whenever i run any of the examples. I cannot run anything without unity crashing. I haven't added anything to these examples so I am not sure what is wrong. I installed the foriero core as well. How can I debug?
     
  10. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hello, this seems like serious bug. We haven't test windows quite a while now. Might be we need to recompile some libraries.
     
  11. TaylorAnderson

    TaylorAnderson

    Joined:
    Jul 28, 2012
    Posts:
    10
    Hello, I've been looking at this asset for a bit but I'm not 100% sure it does what I want it to do (and for $100 it is far too risky to just hope for the best). I want to be able to take a midi song, convert it into a grid of 3d objects, and then associate those objects with midi notes that can be moved around / changed. Is that possible with this tool?
     
  12. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    What version of Windows are you testing with?
     
  13. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Ok long waiting time has ended. Today we have released MIDI Unified 2017.1

    It is paid update ( 50$/50Euro ). Grace period is one year back. Which means if you bought this package less than one year ago you should be able to upgrade for free. Please delete previous version from your project. We have polished this version and fixed all what you suggested to us.

    Thank you for your support, Marek.
     
  14. Giovannino82

    Giovannino82

    Joined:
    Aug 11, 2014
    Posts:
    3
    Hello! Maybe a silly question, does MIDI Unified let me create and edit MIDI files by script also?
     
  15. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Simple answer. No. :)
     
  16. Giovannino82

    Giovannino82

    Joined:
    Aug 11, 2014
    Posts:
    3
  17. CODE72

    CODE72

    Joined:
    Sep 15, 2017
    Posts:
    1
    Where is tutorial or sample about MIDI unified and playmaker?
     
  18. luoxiaoqiang

    luoxiaoqiang

    Joined:
    Sep 27, 2017
    Posts:
    2
    Hello Marek,
    I have already bought your product "MIDIUnified 2017.1.".It really helps me a lot.However I have a question for you.This version requires Android 6.0+. How can it support Android 4.0+ to cover most phone solutions.
    I also send a message to your skype.
    Look forward to your favourable reply. Thanks.

    Regards,
    June
     
  19. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Sorry not possible. It is possible but it would accept only usb midi and it is a lot work. Basically I would need to write new plugin. If you have 1000$ i will write that solution for yoy.
     
  20. luoxiaoqiang

    luoxiaoqiang

    Joined:
    Sep 27, 2017
    Posts:
    2
    How can I contact you?Would you give me your email?
     
  21. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
  22. xfer

    xfer

    Joined:
    Mar 30, 2015
    Posts:
    3
    Using this plugin is possible to create a piano with pitch and velocity by holding a key?


    Sorry to bother with a such basic question, but I couldn't find any documentation or video about the plugin features.
     
  23. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    974
    I just bought this asset and I'm feeling a bit overwhelmed. All I want to do is to play midi files and control their playback, volume and spatial location. The only way I've found to play a midi file is through the karaoke script, but I'm not interested in karaoke. That script seems like such an overkill for what I want to do. Furthermore, it doesn't seem like you can control the volume or change the midi file once the scene is running, or even stop it. Removing the GameObject does not make the music stop. Any instrument that happened to play will continue indefinitely.

    This asset seems a lot more counter intuitive than it needs to be, at least for midi file playback. I think it should come with a component like the unity native audio source, where you simply reference a midi file you want to play, and can control its properties.

    In addition to this, adding the karaoke script also makes the keyboard play sounds when you press its buttons. In my case that is undesired.

    Perhaps this asset is not at all purposed for what I want to do? It certainly seems capable, but ill adapted.
     
    Last edited: Jan 11, 2018
  24. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hello, that is exactly what Karaoke script is doing. Just drag other file there. Also if you need visual controls you would need to create UI buttons for that. Let me know if you need more assistance.
     
  25. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    974
    How do you stop the karaoke script from playing sounds when pressing keyboard buttons?
    How do you change the volume of the MIDI song during playback?
    How do you change the MIDI song once the scene has started playing? (When changing midi asset, the old one keeps playing.)
    How do you stop the MIDI from playing indefinitely when removing the karaoke GameObject?
    How do you change the spatial location of the MIDI song playing?
     
    Last edited: Jan 11, 2018
  26. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    Just purchased and imported this and got 13 errors like this:

    Assets/Foriero Store/Others/MIDIUnified/Scripts/MIDIUnifed/Plugins/Providers/MidiPlugin.WSA.cs(7,21): error CS0234: The type or namespace name `Extensions' does not exist in the namespace `ForieroEngine'. Are you missing an assembly reference?

    Our build settings are set to iOS. Is there anything special I need to do to get it working on iOS?

    Thanks
     
  27. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    oh, and I'm using the latest Unity - 2017.3.1f1
     
  28. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Please download foriero core from asset store.
     
  29. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    OK I'll try that. Shouldn't that be in the installation instructions?

    Thanks
     
  30. enragedsquirrel

    enragedsquirrel

    Joined:
    Oct 30, 2017
    Posts:
    3
    Will you be providing any updates in the near future to this product (e.g. 2018.1 support, new documentation) I want to try it, but at 100$ I want to ensure that it will be supported for a while.
     
  31. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Yes. Unity has currently bug in 2018.1 and we are unable to pack our product for asset store. :-(
     
  32. enragedsquirrel

    enragedsquirrel

    Joined:
    Oct 30, 2017
    Posts:
    3
    Thank you, I purchased product and tried to dive in but encountered errors, please advise if this is related to mentioned unity 2018.1 bug...

    - imported asset core (had to upgrade to 2018.1 to download)
    - set the framework to C# 4.0
    - imported midi unified
    - on run (blank scene or any sample scene) I get the following errors:


    - The type or namespace name `ObjectPool' does not exist in the namespace `ForieroEngine'. Are you missing an assembly reference?
    - The type or namespace name `RecyclableObject' could not be found. Are you missing `ForieroEngine.Pooling.Concurrent' using directive?
    - The type or namespace name `ConcurrentPool' could not be found. Are you missing `ForieroEngine.Pooling.Concurrent' using directive?
    - error CS0115: `ForieroEngine.MIDIUnified.MIDI.AudioSourcePoolItem.Recycle()' is marked as an override but no suitable method found to override

    Is this the mentioned bug, or do you have any suggestions to run examples?
     
  33. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Have you installed ForieroCore from asset store?
     
  34. enragedsquirrel

    enragedsquirrel

    Joined:
    Oct 30, 2017
    Posts:
    3
    Yes, ForieroCore installed. Worked fine by itself in 2018.1 after changing framework. Midi unified package gives those errors after importing last.
     
  35. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Please contact me via studio.foriero.com I will send you latest version.
     
  36. extraordinaryfacility

    extraordinaryfacility

    Joined:
    Apr 24, 2017
    Posts:
    1
    Hi, I have exactly the same problem as @enragedsquirrel - any help would be much appreciated!
     
  37. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi, please contact me via that website. Thank you.
     
  38. Kiupe

    Kiupe

    Joined:
    Feb 1, 2013
    Posts:
    528
    Hello,

    If I get it the right way, I can pass a MIDI file creating from Cubase or other musical application to this plugin and it will be able to play it ?

    How are sound generated ?
    Is it possible to "root" sounds to an AudioMixer ?
    Do you still plan to support FluidSynth ?

    Thanks
     
  39. gbarbone

    gbarbone

    Joined:
    Aug 1, 2018
    Posts:
    3
    Hi there, I am also getting the Runtime Error. Any idea on how to fix it? It was intermittent at first and now it occurs everytime I access the Keyboard input script. Thanks!
     
  40. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi, how can I help you? We are preparing 2018.2 and 2018.3 MIDIUnified release.
     
  41. lumeneo

    lumeneo

    Joined:
    Mar 3, 2014
    Posts:
    60
    Interested in purchasing the asset, but can anyone confirm that it will allow me to send and receive midi to Mac DAWs like Ableton and Logic? Thx!
     
  42. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Yes it will. :) It is from MIDIUnified developer.
     
    lumeneo likes this.
  43. gbarbone

    gbarbone

    Joined:
    Aug 1, 2018
    Posts:
    3
    It seems that if I disable and re-enable the midi keyboard script I no longer get the error or crash. Any thoughts? Also when will you likely release the update?

    Thanks!
     
  44. CanisLupus

    CanisLupus

    Joined:
    Jul 29, 2013
    Posts:
    427
    Hi @Foriero,

    After successfully packaging a macOS build of our Unity application into a .pkg file for the Mac App Store, we get the following errors when submitting it to the store via the Application Loader:

    ERROR ITMS-90240: "Unsupported Architectures. Your executable contained the following disallowed architectures: '[i386 (in com.ourcompany.ourapp.pkg/Payload/Our App.app/Contents/Plugins/osxsynth.bundle/Contents/MacOS/osxsynth)]'. New apps submitted to the Mac App Store must support 64-bit starting January 2018, and Mac app updates and existing apps must support 64-bit starting June 2018."

    It seems that osxsynth.bundle is compiled for both i386 and x86_64. Since we don't have the source code for osxsynth, could we have access to it compiled only for 64 bits? All Mac builds in Unity are 64bit-only now anyway. :)

    Cheers!
    Daniel
     
  45. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Yes true we have 2018.3 version but waiting for Unity official release.. Please contact me email I can give you link.. M.
     
  46. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Please check out latest MIDIUnified 2018.3.6 A lot bug fixes and polishing went into this release. Thank you, Marek.
     
  47. MidnightGameDeveloper

    MidnightGameDeveloper

    Joined:
    Apr 26, 2014
    Posts:
    122
    Hello i am interested in your asset, but i have some questions.
    -Will this asset also work in Unity 2019.1.* ?
    -What exactly is the Native Synthesizer (Does it use AudioSource Components)?
    -Is the Synthesizer frame rate independent?
    -When playing with a MIDI-Device, is the delay comparable to something like GarageBand or is it bigger?
    -Is it possible to get a refund if it does not fit my needs at all?

    Thanks in advance!
     
    Last edited: Jul 23, 2019
  48. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Hi,
    -Will this asset also work in Unity 2019.1.* ?
    Yes
    -What exactly is the Native Synthesizer (Does it use AudioSource Components)?
    I would recommend using BassSynth that is part of the package www.un4seen.com
    -Is the Synthesizer frame rate independent?
    No
    -When playing with a MIDI-Device, is the delay comparable to something like GarageBand or is it bigger?
    Delay is acceptable but differs on platforms.
    -Is it possible to get a refund if it does not fit my needs at all?
    Sorry the package is worth it if you aim midi in/out and synth. We can help. Refunds are very rare. You would need to have sound argument so that I approve the refund.

    Thank you, Marek.
     
  49. joelognn

    joelognn

    Joined:
    Aug 8, 2018
    Posts:
    9
    Hi,

    A quick question which I have been struggling for a very long with today, having to read through quite a bit of code.

    I simply need to extract the MIDI note number, velocity and duration for the NoteOn events. I notice that the NoteOn event contains parameters for note number (Data1) and velocity (Data2). Where can I get the duration?
     
  50. Foriero

    Foriero

    Joined:
    Jan 24, 2012
    Posts:
    584
    Midi does not have duration. You need to calculate it. MidiOff time - MidiOn time