HISE Logo Forum
    • Categories
    • Register
    • Login

    Any tutorials for Midi?

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 212 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • griffinboyG
      griffinboy
      last edited by griffinboy

      Advice appreciated:
      I'm looking at programming a sequencer in Hise that can write a midi file.
      It's for generative sequencing starting from a blank slate, and so I would need to be able to create custom sequences and then eventually write them to a midi file.

      I'm looking to find the best way to do this in Hise.

      Are there any snippets / material I should look at to get started? I saw this in the docs:

      450ab095-84e3-4d30-9217-ae23b98fa805-image.png

      Which made me wonder whether this is intended for my use case? In which case I would be working with Event data inside of hise for the actual generation of the Sequences.

      But then I spotted this

      0ac205c4-bed2-4679-81c8-461b83475395-image.png
      f60b931b-8197-4154-831f-c27882a99d9c-image.png

      (Unfortunately the bunchofnotes no longer links to any doc page)

      Which mentions 'current sequences'. No clue what that means yet!

      I'm new to the Midi side of Hise and just wanted to make sure I get off on the right foot by asking some advice!

      My initial guess:
      I would need to make a Hise project that creates a 'sequence' and start writing event data to it somehow? Then I would go and export it as a midi file.
      Something like that? 😅

      I'm not sure what this looks like, I'm only just starting with the file saving stuff.

      I want to keep this as flexible as possible. In the I'm likely to write my own internal data structure for the storage and modification of the sequences, and then convert them into Midi.

      HISEnbergH ustkU 3 Replies Last reply Reply Quote 0
      • HISEnbergH
        HISEnberg @griffinboy
        last edited by

        @griffinboy Not an exact 1 to 1 match, but this post should get you some of the way there:

        Link Preview Image
        Custom Arpeggio Preset Browser to Save Arpeggio Presets Separately

        Hi Everybody Here is a Custom Arpeggio Preset Browser that will Store Arpeggio Presets Separately under the "UserPresets" Folder P.S. if you use the Snippet ...

        favicon

        Forum (forum.hise.audio)

        1 Reply Last reply Reply Quote 1
        • ustkU
          ustk @griffinboy
          last edited by ustk

          @griffinboy From an .md file in the doc folder itself under tutorials/recipes/event-processing
          I don't know if it appears anywhere in the documentation though...

          HiseSnippet 1579.3oc4X01aaaCDVJIZXwasncqXXejnX.SAwi01IoN.ECMNN1MdMu3Zm1UzggBFIJKlJQpRQkLug9eb+T5+fsiRx1xspAFdqa.aNeHl2cj744tiGO59RgCMNVHMLW+rwQTCyO2Z3XtxusOgwM5cfg4MsNlDqnRTln8GGQhiotFllq9Hs.y0WyH8yae39j.B2gNSjgwyDLG5QrPlZlz968XVPPWhK8LVXAq2dudNBdaQfHAvypV0LhHNuhLhdBQa1JVFleRGWlRHGpHJZrg4Z6KbGOzWbEOy9mwhYmGP0CpaLDVnLwcEAtZDq+tQaeVfa+I7N1vvzp+LuvpYdg6XcLykMU9LuwsRUflMih9CyUtN3UeIg2JEf2mLIHkBu.xXpbRPp2A8PYRpOGnZmHkTtZH80Iz4BNu8g4pNSBt4hxORHh5vI.TcKJ1b0OBzyPyjtr.plplSF.VqoEDxOfnHFlwV61.yO69Od21CFzqGFe7S57hKZgw3miwsv8wgrACOqWiW.Rviw3KZ1rwHbqCOEFdwlMa340Zqzu2Z2POO7y6iOj+C8O4Wos2uqW6Vdd0a0avlNG1G6e.F2byGiwFZbLKyyTmqNjMhSTIRPl0IIg6S.FTvAchHjA5SOMkK7V6c.kWlXsOFbjRUwSKYN94b5FEh9qkE8us0PGIKRMSi1W8k4RmkaNedPlViUDVVnaTwKg6nXBNh35dhPQsCXwppHGeBmSCph3fLdR34TYUzkz.gCSMtJJRDyzypJJfxGo72nxuUAAetjHQgnuG0gOhwoXGIExPNF.Ab38Pc3WZuwCRsLDGSUZZXGh066o7hJzRNIcWsmAfhF7rbnXOASEU1NC714jXtcDBdwJRXjcNDGQUCggPZWWg7IIPbfJ2GPcr8DNtQ97mRPwBQPwTBJxHnmWQMWGCEeXRHVRRf1bRjpHazwZbTRrucXt3YRDfj2biJ5+t28Pm4yhQWAUqQ9.KQPg4zLCTbd0DbEsmI.7L+zO+fJ5Yzx0EQPmCoW9HgWp0wUlljUEUuJ590f+0nYUj9+v18NZ2JWK78Z3cde86LQOdGsEa89VzL2hF35efEoYibS1JEBS46inJ.8RpGUpoGRIPJeJJs3ZTZwUbE3NpXUZFgVbdIWvCjduoNlLq1r8cKVV9taj4h548tKJxUPi4eqB4StjhH7wHXSfrCEJP.WS5VEcEUOSNk5pwTV9GfTZXjZ7znAxiIiUUXd1EPFlE2Qak8FSNsBKT6rEPvonyAhbES4i19daiTPJFJdRUtTqKtTY6q81UQamE5dSJgNQbE.PzEIfeQWvIkd5TpR7e.6bgbREhoxogdEHnHoHhl4RKvGoHDLDWoHH7Bf7z7ydGAahcfN.NsflfmUWwVS20ADhdWUddkpqM3xkhf.8Y4RTqO8IutIZOsdIIHgN0Pnr87WaVYwt1LOCnfgBdONScZDc53LlNQRMioDrnnY7pnzT5ThYyDUxc0syvD7sm1K8hY3hkbY8SieJllglGPuDZ6K61p0sNfF+JkHxnjqxf1oDtIA5KGK1iktwxbEfKdtqw5o2Mn31345LYwa7pVoclTuL1tfv81V8YJG+xw6JkfWcOcejwadar2vpimG0QMCrqY084KaOqKGTtYFT9LqgvUVo0HSAxWkNF8i5BdOhxoRsSs9077heeQedQzB+7hScTv1Cs+xigKLmagGRCYmAkGiKJ7owztR5qGnixEk2V.MBVlp29vt.IKcNC0UXSSWZEJR3y0F3R1n87mZJXeIOpXs+Edyye+G89qWoX0ECtk3AM6+duc9VPNstcrNbc6ofDMF+Bn9mGIIPMQ57I4GK3hHeAm4TLCX.UIYiFQkEwdoDpkRM2q2tydCnATRwr4uYuifrPhD7SzkzWTew8EWW75qsxfKRexD8eiJ7q9+yJ7CDIJFezwDHQ8WxdN7PnvpCM+ALvFYYtht3X13Z5wYUV4toC9C3Stx55wl4JqOQ4+H6QHwQJdoSVyO5b4OMUBvad5a+W25X8XTciz15f4YUCWyHDpH9RGGs696.+S4yowRLmsVh4r8RLmcVh4b+kXNMWh4r60NG8kQsRThvrihff9cx9UhLm9iVYtpweBedasBA
          

          keywords: Create a MIDI Sequence
          summary: A short example how to programatically generate MIDI sequences.
          author: Christoph Hart
          modified: 29.08.2019

          This snippet shows you how to programatically create a MIDI sequency that can be played in a Midi Player

          The API is pretty low-level, so the first thing that we add is a helper function that writes a proper note (including note-on and off).
          The arguments are pretty self-explanatory, the only thing to note is that the timing values are expressed as fraction of a quarter beat.

          function addNote(list, channel, notenumber, velocity, position, length)
          {
              var m = Engine.createMessageHolder();
              m.setType(m.NoteOn);
              m.setNoteNumber(notenumber);
              m.setVelocity(velocity);
              m.setChannel(channel);
              m.setTimestamp(Engine.getSamplesForQuarterBeats(position));
              
              var o = Engine.createMessageHolder();
              o.setType(o.NoteOff);
              o.setNoteNumber(notenumber);
              o.setChannel(channel);
              o.setTimestamp(Engine.getSamplesForQuarterBeats(position + length));
              
              list.push(m);
              list.push(o);
          }
          

          Using this function, we can create a simple array that contains all notes like this:

          // This will hold our note sequence.
          var l = [];
          
          // Add a bunch of notes
          addNote(l, 1, 60, 127, 0, 1);
          addNote(l, 1, 63, 127, 1, 0.5);
          addNote(l, 1, 65, 127, 1.5, 0.2);
          addNote(l, 1, 67, 127, 2, 0.5);
          addNote(l, 1, 72, 127, 3, 1);
          

          Now the rest is similar to what we've seen in the API Documentation:

          // Get a reference to the MIDI player.
          const var MIDIPlayer1 = Synth.getMidiPlayer("MIDI Player1");
          
          // If the MIDI player doesn't have any content loaded, we
          // need to create a empty sequence first
          if(MIDIPlayer1.isEmpty())
          {
              // Create one bar with 4/4 time signature
              MIDIPlayer1.create(4, 4, 1);
          }
          
          // Now we just pass the list to the MIDI player and let it create
          // a proper MIDI sequence from it.
          MIDIPlayer1.flushMessageList(l);
          
          HiseSnippet 1579.3oc4X01aaaCDVJIZXwasncqXXejnX.SAwi01IoN.ECMNN1MdMu3Zm1UzggBFIJKlJQpRQkLug9eb+T5+fsiRx1xspAFdqa.aNeHl2cj744tiGO59RgCMNVHMLW+rwQTCyO2Z3XtxusOgwM5cfg4MsNlDqnRTln8GGQhiotFllq9Hs.y0WyH8yae39j.B2gNSjgwyDLG5Q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KtTY6q81UQamE5dSJgNQbE.PzEIfeQWvIkd5TpR7e.6bgbREhoxogdEHnHoHhl4RKvGoHDLDWoHH7Bf7z7ydGAahcfN.NsflfmUWwVS20ADhdWUddkpqM3xkhf.8Y4RTqO8IutIZOsdIIHgN0Pnr87WaVYwt1LOCnfgBdONScZDc53LlNQRMioDrnnY7pnzT5ThYyDUxc0syvD7sm1K8hY3hkbY8SieJllglGPuDZ6K61p0sNfF+JkHxnjqxf1oDtIA5KGK1iktwxbEfKdtqw5o2Mn31345LYwa7pVoclTuL1tfv81V8YJG+xw6JkfWcOcejwadar2vpimG0QMCrqY084KaOqKGTtYFT9LqgvUVo0HSAxWkNF8i5BdOhxoRsSs9077heeQedQzB+7hScTv1Cs+xigKLmagGRCYmAkGiKJ7owztR5qGnixEk2V.MBVlp29vt.IKcNC0UXSSWZEJR3y0F3R1n87mZJXeIOpXs+Edyye+G89qWoX0ECtk3AM6+duc9VPNstcrNbc6ofDMF+Bn9mGIIPMQ57I4GK3hHeAm4TLCX.UIYiFQkEwdoDpkRM2q2tydCnATRwr4uYuifrPhD7SzkzWTew8EWW75qsxfKRexD8eiJ7q9+yJ7CDIJFezwDHQ8WxdN7PnvpCM+ALvFYYtht3X13Z5wYUV4toC9C3Stx55wl4JqOQ4+H6QHwQJdoSVyO5b4OMUBvad5a+W25X8XTciz15f4YUCWyHDpH9RGGs696.+S4yowRLmsVh4r8RLmcVh4b+kXNMWh4r60NG8kQsRThvrihff9cx9UhLm9iVYtpweBedasBA
          

          Can't help pressing F5 in the forum...

          1 Reply Last reply Reply Quote 2
          • ustkU
            ustk @griffinboy
            last edited by ustk

            @griffinboy The list can be written in a file with File.writeMidiFile(var eventList, var metadataObject)

            Link Preview Image
            HISE | Docs

            favicon

            (docs.hise.dev)

            Except for TimeSignature, I couldn't find any other relevant properties to put inside the metadataObject (for instance to know the exact syntax like Tempo vs tempo )

            Can't help pressing F5 in the forum...

            griffinboyG 1 Reply Last reply Reply Quote 1
            • griffinboyG
              griffinboy @ustk
              last edited by

              @ustk

              Thank you very much! I am very glad I asked, thanks for your effort! This does make it much easier for me 😄

              ustkU 1 Reply Last reply Reply Quote 0
              • ustkU
                ustk @griffinboy
                last edited by

                @griffinboy The pleasure is mine! You know, I'm trying to improve my skills lately... This way I will be... 😝

                Can't help pressing F5 in the forum...

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post

                48

                Online

                1.7k

                Users

                11.7k

                Topics

                102.1k

                Posts