Page 2 of 3

Re: Sample Player midi problem

PostPosted: Thu Jan 14, 2021 9:52 pm
by kortezzzz
I guess this is what you're looking for?

Re: Sample Player midi problem

PostPosted: Fri Jan 15, 2021 12:22 am
by StereoSpace
kortezzzz wrote:I guess this is what you're looking for?


Wow, thanks a lot, this is what I was looking for !!! no words)))

Re: Sample Player midi problem

PostPosted: Fri Jan 15, 2021 1:30 am
by newdsp
If you look at this sampler you can detune or change octaves by changing the root key note but you can also transpose from the midi side. You can also check how the pitch bend works in Chaos. Chaos also has octave shifting and detune. The problem with the mono sampler is that it doesn't have any envelopes and if you want to add 16 or 32 envelopes or a separate envelope for each sampler it can overload the CPU. Most of them use Midi-To-Voices so I don't know which one is supposed to be different.

Re: Sample Player midi problem

PostPosted: Fri Jan 15, 2021 3:27 am
by newdsp
Here is one octave shift done on the midi side but it needs a notes off signal because it's sustaining forever. The envelope is helping stop the sound as long as the sustain is set to zero but it still needs a notes off like in the other example.

Re: Sample Player midi problem

PostPosted: Fri Jan 15, 2021 3:48 am
by newdsp
Here is an octave shift that also has an ALL NOTES OFF included (Midi CC 123). That way all the midi notes stop if you are not holding any keys. So, it's pretty much the same thing as the OCTAVE CHANGER MIDI STAGE just done differently.

Re: Sample Player midi problem

PostPosted: Fri Jan 15, 2021 7:05 am
by newdsp
It looks like the Midi CC 123 (ALL NOTES OFF) is also completely destroying the release from the envelope. The release in the sound is always short no matter how high you set it to be on the envelope. So, it's not a very good solution so far but it's doing the octave shifting on the Midi side instead of the Poly side. The "kortezzzz" example is probably better but it's still using the Midi-To-Voices and Voices-To-Poly just like everything else.

Re: Sample Player midi problem

PostPosted: Fri Jan 15, 2021 7:07 am
by kortezzzz
Just to clarify: The green "midi split" and "midi event" primitives (which split the midi session to green values and then re-build them) won't work after export to dll. in the DAW with anything related to bouncing or exporting to audio (from version 3.0.6 and later). This is an old bug that has been remained quite long time and continues even in the alfa versions. So avoid of using it in your played notes midi chain. Use it only to extract info, but not for playing. That's why we should prefer only Ruby midi manipulators. Ruby does work. I've also converted all my green midi manipulators to Ruby.

Re: Sample Player midi problem

PostPosted: Sat Jan 16, 2021 11:20 am
by newdsp
I see. Well... That's pretty bad. How can I use the last note off from the second script and incorporate it in the first script ? The first script looks way more simple and elegant it just needs the note off part. Or is it it doing the note off automatically as it's received from the input ? I'm talking about this thing here:

def event i,v
m = @midiInput.to_array
shift=@a
output Midi.new m[0],m[1],m[2]+@a,m[3]
end

Re: Sample Player midi problem

PostPosted: Sat Jan 16, 2021 1:01 pm
by kortezzzz
I'm not a Ruby guru and I hope that at least one of the gurus will answer it in details, but seems like as long as you use "m[0]" in your code, you actually get note off automatically, since "m[0]" "listens" to any change that occurs in the midi on\off session.

Re: Sample Player midi problem

PostPosted: Sat Jan 16, 2021 3:49 pm
by trogluddite
Your Ruby code does also handle the note-offs. In fact, it shifts all MIDI messages, which could be a problem, as it will also offset pitch-bend messages and change the index of controller messages. There's also a chance that the code will cause errors when the shift amount is changed (it might call "event" without a MIDI object to handle).

The following code will be more reliable (assuming that @a is your shift amount)...
Code: Select all
def event i, v
  # Exit if the incoming value is not a MIDI message.
  return unless v.is_a?(Midi)

  # Shift the note value only for note-on, note-off, and note-AT messages.
  v.data1 += @a if v.status <= 160

  # Send to output.
  output v
end