Midi Player?



  • the midi player has being introduce to HISE but it only plays 1 bar of the midi file loop, and does anybody has any idea of how to use it within the plugin, I mean how do you incorporate it into it.

    @Christoph-Hart

    Thanks in advance...



  • Id be interested in an example file as well 😃



  • I'll write a proper documentation for the MIDI Player ecosystem when I merge it back to the master branch, it's not 100% finalised yet.

    This opens a can of new possibilities, you can embed MIDI files, play them back, modify them using scripting calls, you can even build your own piano roll from a script panel.



  • @Christoph-Hart can't wait 🤗.

    Thanks



  • @Christoph-Hart said in Midi Player?:

    I'll write a proper documentation for the MIDI Player ecosystem when I merge it back to the master branch, it's not 100% finalised yet.

    This opens a can of new possibilities, you can embed MIDI files, play them back, modify them using scripting calls, you can even build your own piano roll from a script panel.

    Excited to see how this works 😃



  • Excited for this too



  • Nothing Yet even in the new version (2.1.0) of HISE? @Christoph-Hart ???



  • Sure it's there.



  • @Christoph-Hart but it only play 1 bar, and the example you said you'll do?



  • @Christoph-Hart said in Midi Player?:

    I'll write a proper documentation for the MIDI Player ecosystem when I merge it back to the master branch, it's not 100% finalised yet.
    This opens a can of new possibilities, you can embed MIDI files, play them back, modify them using scripting calls, you can even build your own piano roll from a script panel.

    This?



  • @Christoph-Hart any chance you can throw together some quick notes on this function? I ready to use this in my next project.



  • @dustbro Following



  • @Dominik-Mayer is closing in on the new documentation system and I‘ll make sure it contains a few words about the Midi Player.





  • @Christoph-Hart Is there a way to add multiple events to a track? I'd love to see a snip on how you would paint a timeline as well 🙏



  • @dustbro said in Midi Player?:

    Is there a way to add multiple events to a track? I'

    Yes, but I realise there is one puzzle piece missing.

    1. Create a list of MessageHolders which contain the MIDI messages
    2. Set the MIDI properties for each message
    3. Call flush() to pass it to the MIDI player.

    But you can't set the Type for the MessageHolder object (it was initially created to hold a reference to actual MIDI input so there was no need to change its type, but now we need MessageHolder.setType(MessageHolder.NoteOn);

    What do you mean with timeline? Any graphic representation grabs the rectangle list from the MIDI player, then applies some transformations and displays the information in some way, so if you can show me an example I can check how to realise it.



  • @Christoph-Hart I'm trying to incorporate this into a drum sampler...
    So file browser to drag n drop midi into a player, and an associated midi track to arrange parts.

    SD3_grooves-1506170664982.jpg



  • Alright, a snippet how to use the MIDI API to create notes programatically is available here:

    https://docs.hise.audio/tutorials/recipes/event-processing/create-midi-sequence.html

    Now the other thing you want to achieve is a little bit more complex, as it would require to divide the notes into multiple "clips", which is not supported ATM (and chances are tiny that it will be added in the future since it requires a full rework of how the MIDI files are handled).



  • @Christoph-Hart said in Midi Player?:

    it would require to divide the notes into multiple "clips"

    I'm thumbing thru the MidiPlayer API and found:

    getNoteRectangleList(var targetBounds)
    
    This converts the MIDI data in the current sequence to a list of rectangles for each note scaled to fill the rectangle supplied as argument.
    

    The description says

    The most simple application of this is to draw a piano-roll content into a Panel. 
    

    @Christoph-Hart Can you use a panel as a "clip" with this? I'm checking out the example code, but unsure how to properly populate "note". @Dominik-Mayer any insight on this?

        for(note in list)
        {
            // `note` is a array with 4 numbers and can be passed
            // into all Graphic API functions pretty conveniently.
            g.fillRect(note);
        }
    

    I'm also seeing

    setRepaintOnPositionChange(var shouldRepaintPanel)
    
    If true, the panel will get a repaint() call whenever the playback position changes.
    

    description:

    By default this is off, but if you need your connected Panel to repaint during playback (eg. to display a ruler that indicates the position), set this to true and it repaint() will be called periodically during playback
    

    would this Ruler be similar to the timeline ruler in the pic above?



  • Making a ruler and showing the contents of a clip is the smallest problem (in fact these are trivial to achieve with the API calls you listed above).

    The problem which you won't be able to overcome is to combine multiple MIDI files into a timeline, and drag them around as entity.

    I've modified the example from the docs to use a panel to display the position and content of the MIDI file which should get you started on the basics:

    HiseSnippet 2049.3oc4Y8+aabaE+NaeE0JyEoaEC6GIBFvNuncQxeIN.EEwxx1wZI1VUxMMnEEAz2wSGStiTkGkc0Jx9ab+oj+C1dOxS5NYq5ooktgto3.K936Q995mGIcWkLjkmKUNtqew3gLG2ekW+wBcR6DJW3z4PG2Ow6TZtloHVRGLdHMOmE435t5yPBtquli4y6e5AzTpHjURxw4kRdH6E7LttjZ28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