Announcement

Collapse
No announcement yet.

Dealing with chords/bundles?

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

  • Dealing with chords/bundles?

    How is it possible to send multiple notes at once?

    I have bundles setup in my application, and I'm able to send them along to OSCulator. I only have one message defined in OSCulator which is:

    PrtsOhG.png

    I was hoping to use this to trigger multiple pitches in a bundle, but it doesn't seem to work. Do I have to define enough messages in OSCulator to handle the bundles? For example if I defined: /osc/note/1, /osc/note/2, /osc/note/3 etc ...

    I'm using the code below to send chords if it's any help:

    Code:
    OSC.prototype.chordOn = function(notes) {
      let self = this; // Use fat arrows to do away with this
      const bundleNotes = _.map(notes, function(note) {
        return new a2rOSC.Message(`/${self.app}/note`, [note.pitch, note.velocity, 1]);
      });
      this.send(new a2rOSC.Bundle(new Date, bundleNotes).toBuffer());
    }

  • #2
    Hi zonedout,

    Depending on what you need to do, you have a couple of possibilities.

    The first is to use the approach you described, that is, work with several of OSC message that handle a single note at a time. So if you need 3 voices polyphony, you will use three difference messages like /osc/note/1, /osc/note/2 and /osc/note/3. OSCulator does decode bundles, but will not attempt to do anything special with regards to MIDI polyphony.

    If you don't know the polyphony degree ahead of time, or if you just don't want to be limited to a fixed number of simultaneously active notes, then you can use the additional Note Parameter named "Voice". This parameter receives an integer number that indicates the voice number in addition to pitch, velocity and aftertouch. This is explained in more details in this discussion: http://www.osculator.net/forum/threa...-UnrealEngine)

    So in your js example, as a data structure, I would recommend you use an array in which you store information about active notes. Turning notes on and off would simply be a matter of traversing that array. You start picking an empty slot of that array, its index gives you the voice number (0 for instance), then the next note has the index 1 and so on. When a note is triggered 'off', you can remove the note from the array (and send an OSC message with the relevant note-off information), leaving an empty space.

    Let me know if you need more info.


    Best,
    Cam

    Comment

    Working...
    X