Announcement

Collapse
No announcement yet.

Sending pitch in midi note

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sending pitch in midi note

    So today I finally purchased a copy of OSCulator. I was sick of the pausing and that dialog ha ha.

    I need some help. I'm using NodeJS and the osc4node package to send OSC data to the machine running OSCulator. All working well.

    But, what I want to be able to do is send a midi not that contains:

    * pitch
    * velocity
    * trigger

    I don't want to have to create hundreds of notes in OSCulator as I'm designing a chord application. I would rather have 1 message that has pitch attached to it and be able to send the notes as an integer value. I'm not sure if this is possible.

    Any help would be much appreciated.

  • #2
    Ok so I'm half way there. The solution is to use Midi Note w/ Params I believe. But I'm having issues. OSCulator is getting the message fine, but I'm unsure on how to use this to generate midi data.

    Now that I have the message received by OSCulator how do I generate midi data? I've read the docs but it's still confusing.

    H2hFy3F.png


    Here is how I'm sending the OSC data:

    Code:
    new osc.Message('/midi/note/1', [
        65,    // midi note
        100,  // velocity
        1      // Note on
    ]);

    Comment


    • #3
      Ok moving forward I've got it to work. The only thing is am I going to have to manually enter the values for all 127 notes on OSCulator?

      Currently I have to send the note (such as 68), then modify the values for trigger and velocity for this note. Is there a quicker way to do this?

      zIbKqGN.png

      Comment


      • #4
        Hi,

        The message /midi/note/1 is used internally by OSCulator when it received MIDI messages. You can send a message named like this to OSCulator, but I don't recommend that. You'd rather want to send any message you like that clearly identifies your device (e.g. /my/nodejs/app), and make it a 3 arguments message just like you did.

        Now,
        - assign to the first argument (midi note) an event of type 'Note Params', and value 'Pitch'
        - second argument (velocity) an event of type 'Note Params', and value 'Velocity'
        - third argument (Note on)an event of type 'MIDI Note w/ Params', and value 'Velocity' and choose the message /my/nodejs/app. Of course, /my/nodejs/app is fictional and only used in this example.

        See page 34 of the manual for more explanations, there's also a lot of threads about MIDI Note w/ Params.


        Best,
        Cam

        Comment


        • #5
          I replied while you were sending your third message.
          Please follow my previous hints and you should be fine. The configuration you showed in the screenshots will not work unfortunately.

          Comment


          • #6
            Thanks for the advice camille. I will check out page 34 now.

            Comment


            • #7
              Ah all works fine thank you. What values are the pitch? If I specify the pitch of say C2 for example the pitch is very high.

              Comment


              • #8
                No worries, page 34 explains it all. Many thanks for your help

                Comment


                • #9
                  You are welcome.
                  For reference, you can control the range of input values, by adjusting the "scalings" in the Scalings Page.
                  For instance, if your nodejs program sends integers from 0 to 127, you should change the input range to [0 127]. By default OSCulator expect floats between 0.0 and 1.0.

                  Best,
                  Cam

                  Comment


                  • #10
                    I am so glad you replied, I was scratching my head for a moment. This software is so powerful, I'm glad I finally understand it.

                    Comment


                    • #11
                      Originally posted by camille View Post
                      You are welcome.
                      For reference, you can control the range of input values, by adjusting the "scalings" in the Scalings Page.
                      For instance, if your nodejs program sends integers from 0 to 127, you should change the input range to [0 127]. By default OSCulator expect floats between 0.0 and 1.0.

                      Best,
                      Cam
                      Sorry I'm having troubles again. I had it working fine, now suddenly no data is being sent to Ableton. When I send the OSC data from my laptop to the Mac I can see a yellow flash in OSCulator on the top checkbox (check image below). But no data is sent to Ableton. I haven't changed any settings in Ableton and it was working fine.

                      T4woSH9.png

                      My code. Note that I haven't used scaling yet. Eventually I'll have it create chords, but for now I'm just testing to get it working. I have it send over UDP.

                      Code:
                      let MidiMessage = function(pitch, vel, trigger) {
                          return new osc.Message('/chordial/chord', [pitch, vel, trigger]).toBuffer();
                      };
                      
                      let send = function(message) {
                          client.send(message, PORT, HOST, function(err, bytes) {
                              if(err) throw new Error(err);
                              console.log('Message Sent');
                          });
                      };
                      
                      ...
                      
                      send(MidiMessage(0.9, 0.9, 1);
                      
                      setTimeout(function(){
                          send(MidiMessage(0.9, 0.9, 0); // Note off
                          client.close();
                      }, 1000);
                      ...

                      Comment


                      • #12
                        A yellow light means that data is received, but no event is triggered.

                        I don't know why it is not working as you like, but maybe this will help: before sending another note-on, make sure you send a note-off first. This may explain the yellow light.

                        Also, something I noticed in your code: are you sure you want to close the OSC client after 1 second?

                        Comment


                        • #13
                          Hi Camille, will test now. I'm just testing with the setTimeout. I do have a SITINT event that closes when I hit CTRL + C.

                          Comment


                          • #14
                            You was correct. Setting the note off before the note on makes it work. Many thanks for all of your help and time it's much appreciated.

                            Comment

                            Working...
                            X