HISE Logo Forum
    • Categories
    • Register
    • Login

    Still problems with Message.sendToMidiOut();

    Scheduled Pinned Locked Moved Bug Reports
    74 Posts 8 Posters 4.1k 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.
    • lalalandsynthL
      lalalandsynth @ulrik
      last edited by

      @ulrik We are indeed compiling as fx.

      https://lalalandaudio.com/

      https://lalalandsynth.com/

      https://www.facebook.com/lalalandsynth

      https://www.facebook.com/lalalandsynth

      ulrikU 1 Reply Last reply Reply Quote 1
      • ulrikU
        ulrik @lalalandsynth
        last edited by

        @lalalandsynth ok, Davids snippet works when compiled as fx but not my snippet.
        The difference between them is that David has the Message.sendToMidiOut() in the NoteOn callback and I have it in an inline function, the TransportHandlers onGridChange function, and I have to have it there to be able to send on 4 midi channels from 4 MidiPlayers... ;(

        Hise Develop branch
        MacOs 15.3.1, Xcode 16.2
        http://musikboden.se

        d.healeyD 1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @ulrik
          last edited by

          @ulrik Did you try changing Message.sendToMidiOut() to m.sendToMidiOut()?

          Libre Wave - Freedom respecting instruments and effects
          My Patreon - HISE tutorials
          YouTube Channel - Public HISE tutorials

          ulrikU jonhallurJ 2 Replies Last reply Reply Quote 0
          • ulrikU
            ulrik @d.healey
            last edited by

            @d-healey No, will do right away, thanks

            Hise Develop branch
            MacOs 15.3.1, Xcode 16.2
            http://musikboden.se

            1 Reply Last reply Reply Quote 0
            • jonhallurJ
              jonhallur @d.healey
              last edited by jonhallur

              @d-healey said in Still problems with Message.sendToMidiOut();:

              @ulrik Did you try changing Message.sendToMidiOut() to m.sendToMidiOut()?

              I did try to use the Engine.createMessageHolder() method but with no luck. What I ended up doing was to just use the Synth.addNoteOn|NoteOff|Controller() and making a child script that had the Message.sendToMidiOut() in both onNoteOn() and onNoteOff() and onController() callbacks which would take all the Synth.add... events and pass them to the midi output.

              What it looked like if I added it to your setup.

              f97f4639-991f-41a6-8330-c8ba2497d1a6-image.png

              ulrikU d.healeyD 2 Replies Last reply Reply Quote 2
              • ulrikU
                ulrik @jonhallur
                last edited by ulrik

                @jonhallur @d-healey @lalalandsynth @ps

                heros.gif

                Now we need to get rid of the NoteOn number 60 coming from the TransportHandler, see this thread

                Hise Develop branch
                MacOs 15.3.1, Xcode 16.2
                http://musikboden.se

                ulrikU 1 Reply Last reply Reply Quote 2
                • ulrikU
                  ulrik @ulrik
                  last edited by

                  @ulrik I used the extra script processor as @jonhallur suggested and it works both in Live and Reaper :)

                  Hise Develop branch
                  MacOs 15.3.1, Xcode 16.2
                  http://musikboden.se

                  P 1 Reply Last reply Reply Quote 2
                  • P
                    ps @ulrik
                    last edited by

                    @ulrik so you are saying that you are getting different MIDI sent out than the input notes? I used to have it in my script processor before already - added the message to controller as well and hoped this did the trick. But still only getting the input messages to show up on the midi track I set my dummy plugin as midi input.
                    Getting a plugin to pass through the midi was possible also by setting the midi out flag even before sentToMidiOut() was implemented.

                    I'm talking about getting artificial notes outputted.

                    The most simple scenario would be an instrument with a sine wave generator and an arpeggiator outputting the arpeggiator notes instead of the input notes.

                    If somebody get's that to work - this person will be forever my personal hero haha

                    ulrikU 1 Reply Last reply Reply Quote 0
                    • ulrikU
                      ulrik @ps
                      last edited by

                      @ps said in Still problems with Message.sendToMidiOut();:

                      @ulrik so you are saying that you are getting different MIDI sent out than the input notes?
                      I'm talking about getting artificial notes outputted.

                      The most simple scenario would be an instrument with a sine wave generator and an arpeggiator outputting the arpeggiator notes instead of the input notes.

                      Yes I'm getting Artificial notes outputted, however I'm not using an Arpeggiator, I'm using the TransportHandlers onGridChange function so I don't know about Arps.
                      I'm modifying the pressed notes and output the modified notes, and the "real" events is ignored.

                      Hise Develop branch
                      MacOs 15.3.1, Xcode 16.2
                      http://musikboden.se

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        ps @ulrik
                        last edited by

                        @ulrik ok wow. can you send me the snippet that outputs artificial notes so I can see if there is anything different than in my approach that doesn't work?

                        ulrikU 1 Reply Last reply Reply Quote 0
                        • ulrikU
                          ulrik @ps
                          last edited by

                          @ps Yes, here it is, it's cluttered with logging functions and other stuff.

                          This is my setup
                          Skärmavbild 2022-10-26 kl. 09.18.57.png

                          so in the "SendToMidiOut" scripts NoteOn, NoteOff & Controller callbacks I just set the

                          Skärmavbild 2022-10-26 kl. 09.20.28.png

                          In Hise preferences

                          Skärmavbild 2022-10-26 kl. 09.21.24.png

                          Skärmavbild 2022-10-26 kl. 09.25.52.png

                          Beware of using "Synth.getNumPressedKeys()" though, because the TransportHandler sends a midi note 60 with eventId 0, and it's making the NumPressed function go +1

                          In this snippet I'm only transposing the pressed keys but I guess you can do whatever you want using Synth....... functions

                          A big thanks goes to @jonhallur for contributing with important information!! 🙏🏻

                          HiseSnippet 2068.3oc6Y0saabbEdWIstlr1tNnE4phh0DHAqhYnIkbrUSpqokDkMg0OzkLBonn0YztyRNUKmgc1gxhMvEBEnuG8Qw.819FzaxiPdCZOmYWxcWRtTzJwEHAQvPF6Lmyb9luyOyYF0RJboggBogYgNiFPMLugU6QbUuc5QXbil6ZXdMqNMZ2wX6QCHggTOCSyUeJNmYg0Lz+7MOdaR.g6RSFxv3XAyktOqOSkLZq5OmEDrGwi1g0Okz2udSWAeGQfXHfiUspZLf3dJoK8PBJ1JV.HZ3wTBYaEQQCMLWaag2n18DuhGI+wrP1IAT7iZFsgEJZ38DAdHhwQM1oGKvq038anggoUqjc+pQ69eg0ALO1jwSXgaqmvNQiz7g4JYg2pYfWszvqZJ3MGHYlBRqEAo2ypsqjMPkLChmepUSthJ8I.smFJQxZrxKJZsi.jfqpzmbJcOI7wDMbdP0pksges9mUrHP8gJ6yHR6mJYd6K5t+IA1Oxdr1copcD8GH3vGNkRDoDnahpsjTDAOmNJbQpmUrrKwgG+bt3jbUMZ5rprOk2U0agpkHRVUOlFrP8hmOqRM4dLWB3n2m5kqloEZJ3J5VKefBSNi3arHw2XFw2bQhuIJ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4QkFLns2qaE0LfgFwIWr32V2XIz9FVIMKjYEdyu5e7ed7xrBErhalXJ.bwAKI.RNwc5s.7ym2bWnFLd4fXVAXpATHQBcBl6ROCtoUzUEJXsKM7THLyv7lSZkCnmHKeyXKuO4DZPrgSNW137IFstn9nDD76q+JlmpW5A5QYc6k5hcGV2GPVa1eMEv2pNFFCQIl+KSsC8xgyssx1lTJHAFMARW3OMjFMMjt3EK.R+Dqs1r7CeXFPU7xCtNO8pmfluLbJzT+KmgfZVue1aL2mjYuEpnCxh0u4wiwZmFGz5nLXsvxEJedZ9YA303OMO7B8WYX99VGJj8IA.z7ZQktf4gZpFgC88YmiIuefQelGzneKQHCqhjrDe8iWNHmj6jBu72d7lO+9lWNW9MM7tV1PxVDdbH4srR2NY5Pf+R5bjCmFh6NCD2s9b3iYyAtYpTxZooDvIleN4EmtT4jUiS.rsl9dZg5K+uW7YAFTnPOQWK2b02ZXuQtvt42NX+KsvCQfqtPkirURVWcep32.19VA4MyCxyTp4sDx2ZbIM6SgZZ4BxbKIdMKrU2bQ2WME5dyeeNwcQHYEKiYg48qu7nHW25+7us7n3VVoZpo5khnBK2Yl4T4v9Uu0UN15MYpLu0kV4XwbVtwUe8EKOm8ysloyw4Sby91g21Btm7v.r7U5mxDe+13Ivr8zueHZFNTKeT5M72Yuu4xBw2ypES41a9Xbk4fQn6n2EXL9UguoUCeepqJAfqYs2W7t4IfSa9qmySxeC8a6BeQk09t3g4GrzOLu4puKdH909d7Cw+yrZS4dcDHpNZnZdOFu4+1x9RdGjvzqgyLWoKy80WRc9A00.uRWB5GKH9ChBhQuca2CHPKevwoXGDsgBRtT7YggF0wXPyUvnknuqheiL.lXp+3+B+DOYM7ay3IqMdx+uXi9DWo3ktQYWXMlqqGA12b8emyBVGfeaWa7a.XYUsRU7BVrW55hT7GCIIyWmMtB5r4UPm6eEz4StB57fqfNO7JnyVKTGr15SFpD8iR4fAZ0PWFxzL5OmkNR23+ANs.eUB
                          

                          Let me know how it goes.

                          Hise Develop branch
                          MacOs 15.3.1, Xcode 16.2
                          http://musikboden.se

                          ulrikU 1 Reply Last reply Reply Quote 0
                          • ulrikU
                            ulrik @ulrik
                            last edited by

                            @ulrik proof of concept

                            MidiOut Video

                            Hise Develop branch
                            MacOs 15.3.1, Xcode 16.2
                            http://musikboden.se

                            P 1 Reply Last reply Reply Quote 0
                            • P
                              ps @ulrik
                              last edited by ps

                              @ulrik wait. what is happening here? Is this an audio effect? What I see on this video goes beyond any logic that I can come up with hahah
                              As I couldn't believe it I compiled your snippet as vst3 Effect with exact same settings and I couldn't replicate this crazy magic.

                              So you have your effect on one Midi track set to IN and on the second one an Instrument with the channel (not the plugin) set as Midi input and record on the same track?

                              So basically you are modifying the midi stream for the whole project?

                              But I'm also wondering why this doesn't work here on my end.

                              ulrikU 1 Reply Last reply Reply Quote 0
                              • ulrikU
                                ulrik @ps
                                last edited by

                                @ps hmm..what extra definitions do you have in the Hise preferences?

                                I think I had the

                                ENABLE_ALL_PEAK_METERS=1
                                

                                before, but I had to remove that to get it to work

                                Hise Develop branch
                                MacOs 15.3.1, Xcode 16.2
                                http://musikboden.se

                                P 1 Reply Last reply Reply Quote 0
                                • P
                                  ps @ulrik
                                  last edited by

                                  @ulrik had nothing else in there :/

                                  As I believe Midi Out is a pretty important topic - especially for commercial developers (A user / client will not understand why it's not possible as it is a pretty basic thing with most plugins eg. Kontakt) we have to have a "typical" case working in a DAW so we can say HISE can do MIDI OUT.

                                  By typical case I mean a virtual instrument that is modifying the input midi and you are able to fetch that generated midi on another Midi track. This is at least what I got hundreds of request for.

                                  So the most simple scenario would be a sine wave generator and for example an arpeggiator or any other artificial note generation - and what we wanna be able to record as midi is the notes that we hear not that we input.

                                  I'm clearly failing to make it work and got left with maximum confusion as it works in the JUCE Plugin Host but not in the DAW.

                                  @d-healey @Christoph-Hart @ulrik any pointers where the missing link might be? It seems to work in the JUCE plugin host but not in the DAW.
                                  In the DAW I always get the input notes passed. (And I'm sure I'm routing it properly)

                                  ulrikU 2 Replies Last reply Reply Quote 0
                                  • ulrikU
                                    ulrik @ps
                                    last edited by

                                    @ps Agree, it's important, I wish it was easy and a no brainer to code.

                                    Hise Develop branch
                                    MacOs 15.3.1, Xcode 16.2
                                    http://musikboden.se

                                    1 Reply Last reply Reply Quote 0
                                    • d.healeyD
                                      d.healey @jonhallur
                                      last edited by d.healey

                                      @jonhallur I still can't get it to work. Could you try with this snippet and if you get it to work let me know what you changed? Also are you exporting as a MIDI FX?

                                      HiseSnippet 1258.3oc6Xs0aaaCElxNrn1Y25VwvvdRnXO3fkEXklkKqXn4hsyBZbiQra5dYnfQh1lHxjZTTN0nnureY8w8vdX+T5+frCojijRU7xLVKVGZdHHma77QdtpzQJboggBIxpRuIATj0Gg6NgqFt2PBiiNnAx513NRZHUg1cR.ILj5grrJuuVpUkEPled8C2k3S3tzTVHzIBlK8P1HlJkamseDy2uEwi1iMJi1qs8AtB9dBeQDfjx35n.h6YjAzGSzpUBirtUSOlRH6pHJZHxZgcEdS5NTbNOV+SXgrS8oZBGTW3fhY2R36oQrlKZugLeuNSuwgHjEtS58ub78+t31LO1k7SeG9Li.6TKx9dXUJO7JmCdNYgW8Lvq.HYkARKDCo6f65JYApTIZ7rH9.thJ6Sfm8rPIVWj0qv6I.E3pUFQNi1RBDWZPs0qWeYa3WK8f9QbWESvsE7GKTzi30Vp5KpVo5KqZeUQ86WnLsajBeeprPw5HsbVFViGM5TpbY6wD+H5kJBW+7uo3q+MMaH2M9VmQQA+.NScT.kecIBnjmJ3udxAMHJhNPjvCzKfJULMDrZPGCY0wgkJ3FzvyTh.itiBDb8IXsnJIOJNPzxWPTL9fdL.pLHB8o3rrbPOOaQyjrDI.H1aUwOhN4TAQ5gNcvzJkJ2xyy6BstLEcTJ2Kt3huNO2USXaTVQetJU4otybuK8KV3WT019df2dJySM7d+fsyZqTeYMuFrv.exjibUjwzGahZf39D+PpQ9ghyAy.VaYH+IVLkypaXn2KJTIFsujDLj4FlyxFz9jHe0NAAThT2IAjpjQwB20GZF.G0wvql.DTek02x7ylaVeispugiQqdhAC7osEdzbmrtnEJh4bpuFJFdOIjdB0ERsxfkK8FHrkOQ0UMw+JmTmlSCAWkOjhJUodY0o7ax8x360q9Rz452zKCxu521F8l06PmFgWDfg7sez8bSD.0O4p40E17PlZR1dx+q0S5lBw6f6vTtCKFikJ.iPU1aCLlzI+iwM62GByo.bAbqe9sSa6rt+Shc+h3tLN0LL037uzPa+TnzwdeJmJ0OdNyXp5edSmpFbimpFW41CpvBCDg4N3tzQrdPKrvrL00BR5uZJ7x2YhHKTzqeXK3RVnMcIpHoIsXmQhHtJWZP4YMc2YNmtuv+8ltW5lNc+KR3lhnUKZJeoe2BaeMivaClAqPsBa.WHoMGCiRpo6xszCpVwW3R7scs+Q6oZMfNsAVsTE34UPe5ws8yny375bBEXCU4FMLY+qP77Rvk6xvQ9sv.AXX+x1v1GyZMi2QX7pnDbeFX9lX7Cq6fl+j36W3pp+weaNbHk60SnKQOJRUa14M2Pa9Pb78fUOx84PUlhwtrQA9zl7wPcLvQiwOGmrB4Tt4mr1VvEACEbla1wNGSUR1fATYVrW3EZGkB1AMkyc29XpOkjcD52r8gvnOhTuA5b9V37O9SCKLd8U3X3Zqygse+ckwx++dkwiEQ5uBrMARBgOBDCSs5Bap4RSlwo6cXURWkGSWWSGupF2yPn+dtDgNZZqDgNSE9NwGiHtRwybi6JpySusgCbu4l+6MUvs0z1NHSmRvNb8UpiFAMlelqq9I96flaEaypygM2eNrYs4vlueNrY84vlMlCa1bl1nmItSD7s3wkb.iNMMiOrrZxIP1qISG8W.T2wiNB
                                      

                                      Libre Wave - Freedom respecting instruments and effects
                                      My Patreon - HISE tutorials
                                      YouTube Channel - Public HISE tutorials

                                      ulrikU lalalandsynthL 2 Replies Last reply Reply Quote 0
                                      • ulrikU
                                        ulrik @ps
                                        last edited by

                                        @ps Here's the project, try with that
                                        TEST PROJECT

                                        Hise Develop branch
                                        MacOs 15.3.1, Xcode 16.2
                                        http://musikboden.se

                                        1 Reply Last reply Reply Quote 0
                                        • ulrikU
                                          ulrik @d.healey
                                          last edited by

                                          @d-healey Do you have "JucePlugin_ProducesMidiOutput=1" as an extra definition in the preferences?

                                          And I see you don't use "Message.sendToMidiOut()"?

                                          Hise Develop branch
                                          MacOs 15.3.1, Xcode 16.2
                                          http://musikboden.se

                                          d.healeyD 1 Reply Last reply Reply Quote 0
                                          • d.healeyD
                                            d.healey @ulrik
                                            last edited by

                                            @ulrik

                                            JucePlugin_ProducesMidiOutput=1

                                            Yes.

                                            And I see you don't use "Message.sendToMidiOut()"?

                                            Ah crap. Something went weird and it's duplicated my script. I'll fix it an update the snippet.

                                            Libre Wave - Freedom respecting instruments and effects
                                            My Patreon - HISE tutorials
                                            YouTube Channel - Public HISE tutorials

                                            P 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            15

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            102.4k

                                            Posts