Forum

    • Register
    • Login
    • Search
    • Categories

    Simple Note Player (not Arpeggiator)

    General Questions
    6
    18
    328
    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.
    • hisefilo
      hisefilo last edited by

      How can I do to do a note to be played based on tempo. Let's say C1 on quarters, D1 on half, F1 on triplets? Can't find anything related on forum!

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

        I've not done it but I would assume a combination of Timer Callback, one of the tempo functions such as Engine.getQuarterBeatsForMilliSecondsWithTempo(double milliSeconds, double bpm), and probably Engine.getHostBpm() or Engine.setHostBpm(double newTempo) as needed.

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

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

          @d-healey Yes I was diving in API, but can't figure out yet.

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

            @hisefilo Get the BPM you want in milliseconds and set the timer interval. Then in the timer callback use Synth.playNote();

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

            1 Reply Last reply Reply Quote 1
            • Christoph Hart
              Christoph Hart last edited by

              You can use a MidiPlayer and create this sequence by script.

              Dan Korneff 1 Reply Last reply Reply Quote 3
              • Dan Korneff
                Dan Korneff @Christoph Hart last edited by

                @Christoph-Hart said in Simple Note Player (not Arpeggiator):

                You can use a MidiPlayer and create this sequence by script.

                Do we have documentation yet?? 🙂

                Dan Korneff - Producer / Mixer / Audio Nerd

                hisefilo 1 Reply Last reply Reply Quote 0
                • hisefilo
                  hisefilo @Dan Korneff last edited by

                  @dustbro Can't find anything. 😞 A simple snippet maybe? @Christoph-Hart

                  Also I'm trying to get this buttons light on and off on mouse click. But cant get it working. Any ideas guys?

                  Screen Shot 2019-08-13 at 5.35.07 PM.png
                  Screen Shot 2019-08-13 at 5.34.20 PM.png

                  
                  const var BD = Content.getComponent("BD");
                  
                  inline function onBDControl(component, value)
                  {
                  	Synth.playNote(36, 127);
                  	Message.delayEvent(5000);
                  	BD.setValue(0);
                  };
                  
                  Content.getComponent("BD").setControlCallback(onBDControl);
                  
                  1 Reply Last reply Reply Quote 0
                  • Christoph Hart
                    Christoph Hart last edited by

                    https://github.com/christophhart/hise_documentation/blob/new_docs/hise-modules/midi-processors/list/midiplayer.md

                    https://github.com/christophhart/hise_documentation/tree/new_docs/scripting/scripting-api/midiplayer

                    These are the markdown files which will be rendered in the doc system (subject to HISE 3.0).

                    Dan Korneff 1 Reply Last reply Reply Quote 2
                    • Dan Korneff
                      Dan Korneff @Christoph Hart last edited by

                      @Christoph-Hart Any chance you'll have a Tutorial posted for this feature? Im digging in tonight

                      Dan Korneff - Producer / Mixer / Audio Nerd

                      1 Reply Last reply Reply Quote 1
                      • S
                        Steve Mohican last edited by

                        By the way, the midi player sync is not working properly.

                        When I open a 4 bar midi loop, the loop plays 4 or 8 times faster.

                        ulrik Dan Korneff 2 Replies Last reply Reply Quote 1
                        • ulrik
                          ulrik @Steve Mohican last edited by

                          @Steve-Mohican said in Simple Note Player (not Arpeggiator):

                          By the way, the midi player sync is not working properly.

                          When I open a 4 bar midi loop, the loop plays 4 or 8 times faster.

                          I've noticed that too

                          Hise Develop branch
                          MacOs 13, Xcode 14.0.1
                          http://musikboden.se

                          1 Reply Last reply Reply Quote 1
                          • Dan Korneff
                            Dan Korneff @Steve Mohican last edited by

                            @Steve-Mohican @ulrik
                            Do you guys have a snippit of how you're implementing the feature? Looking for some programming inspiration.

                            Dan Korneff - Producer / Mixer / Audio Nerd

                            S ulrik 2 Replies Last reply Reply Quote 1
                            • S
                              Steve Mohican @Dan Korneff last edited by

                              @dustbro For midi player I used drag and drop feature to load midi files. But every time I load different midi files, midi player began to so so speedy (as I mentioned above, 8 times faster). So I haven't got any special snippet yet, but I can share when I will.

                              1 Reply Last reply Reply Quote 0
                              • Christoph Hart
                                Christoph Hart last edited by

                                Hmm works for me well in a project I am currently working on.

                                Can you send me the MIDI file, perhaps there is some metadata in my files that I am expecting to be standard, but are missing in yours?

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

                                  @Christoph-Hart here's a midi file that I use inside Hise, the original tempo is quarter note = 200bpm, but when I play it in Hise I have to set global tempo to half the tempo, 100bpm.
                                  Miss Karting.mid

                                  Hise Develop branch
                                  MacOs 13, Xcode 14.0.1
                                  http://musikboden.se

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

                                    @dustbro I use it for demoing the sample library so the user can can chose one of many built in midi files to play, it looks like this:

                                    inline function onDemoSongsControl(component, value)
                                    {
                                        MIDIPlay.stop(0);
                                    	DemoTimer.stopTimer();
                                    	Engine.setHostBpm(-1);
                                        DemoSongs.set("items", DemoSongsArr.join("\n"));
                                        
                                        if(value < SongInfo.length)
                                        {
                                            MIDIPlay.setFile("{PROJECT_FOLDER}"+DemoSongsArr[value]+".mid", true, true);
                                            SongInfoPnl.set("visible", true);
                                            SongInfoLbl.set("text", SongInfo[value]);
                                            Engine.setHostBpm(DemoSongsTempi[value]);
                                            MIDIPlay.play(50000);
                                            DemoTimer.startTimer(7000);
                                            DemoOnBtn.setValue(1);
                                        }
                                        else
                                        {
                                            SongInfoPnl.set("visible", false);
                                            DemoSongsPnl.set("visible", false);
                                            label7.set("enabled", false);
                                            DemoOnBtn.setValue(0);
                                        }
                                    };
                                    
                                    Content.getComponent("DemoSongs").setControlCallback(onDemoSongsControl);
                                    

                                    Hise Develop branch
                                    MacOs 13, Xcode 14.0.1
                                    http://musikboden.se

                                    1 Reply Last reply Reply Quote 1
                                    • Christoph Hart
                                      Christoph Hart last edited by

                                      Ah, thanks, it's what I thought, you're using a MIDI resolution of 480ppq, while I am expecting 960ppq, which I thought was standard.

                                      Unfortunately fixing this is not as trivial as I hoped, I need to convert them manually if the resolution doesn't match (because internally I am doing everything in 960ppq).

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

                                        @Christoph-Hart I see, is there a command to apply in the code when loading a midi file, that will half the tempo of the midi file, like "Engine.setHostBpm("midiFile.getResolution() * 2)"...
                                        I mean "Engine.setHostBpm("midiFile.getTempo() / 2)". or something?

                                        Hise Develop branch
                                        MacOs 13, Xcode 14.0.1
                                        http://musikboden.se

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

                                        18
                                        Online

                                        985
                                        Users

                                        6.6k
                                        Topics

                                        60.9k
                                        Posts