Sample Player midi problem

Post any examples or modules that you want to share here
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Sample Player midi problem

Post by kortezzzz »

I guess this is what you're looking for?
Attachments
(OCTAVE CHANGER - MIDI STAGE).fsm
(1.03 MiB) Downloaded 973 times
User avatar
StereoSpace
Posts: 78
Joined: Sat Feb 21, 2015 12:59 am

Re: Sample Player midi problem

Post 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)))
GUI designer
newdsp
Posts: 88
Joined: Fri Dec 11, 2020 1:57 am

Re: Sample Player midi problem

Post 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.
Attachments
WaveArp.fsm
This one works with FS 309b2. (v3.0.9b2-3319-gd51130b)
(272.57 KiB) Downloaded 975 times
MonoSampler.fsm
This one works with FS 309b2. (v3.0.9b2-3319-gd51130b)
(721.94 KiB) Downloaded 1006 times
WSS.fsm
This one works with FS 309b2. (v3.0.9b2-3319-gd51130b)
(1.98 MiB) Downloaded 1002 times
newdsp
Posts: 88
Joined: Fri Dec 11, 2020 1:57 am

Re: Sample Player midi problem

Post 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.
Attachments
OctaveShift.fsm
(22.61 KiB) Downloaded 965 times
newdsp
Posts: 88
Joined: Fri Dec 11, 2020 1:57 am

Re: Sample Player midi problem

Post 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.
Attachments
OctaveShiftNotesOff v0.02.fsm
(26 KiB) Downloaded 959 times
OctaveShiftNotesOff.fsm
(22.89 KiB) Downloaded 953 times
newdsp
Posts: 88
Joined: Fri Dec 11, 2020 1:57 am

Re: Sample Player midi problem

Post 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.
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Sample Player midi problem

Post 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.
newdsp
Posts: 88
Joined: Fri Dec 11, 2020 1:57 am

Re: Sample Player midi problem

Post 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
User avatar
kortezzzz
Posts: 763
Joined: Tue Mar 19, 2013 4:21 pm

Re: Sample Player midi problem

Post 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.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Sample Player midi problem

Post 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
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply