Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Process MIDI data?

For general discussion related FlowStone

Process MIDI data?

Postby daslicht » Wed Dec 24, 2014 5:37 pm

Hi,
is it possible to craete a Plugin (vst instrument) which i can load on a instruemnt track in studio one which
limits the incoming velocity values eg by 80 to 100? and outputs it to another instrument track, please?
Or is therer maybe something ready like this?
daslicht
 
Posts: 14
Joined: Mon Aug 16, 2010 2:11 pm

Re: Process MIDI data?

Postby KG_is_back » Wed Dec 24, 2014 7:12 pm

Midi can easily be processed with ruby component. Following code will do the job:
3 inputs are required: midi in, integer for min, integer for max and midi output.
Code: Select all
def event i,v,t
note=@ins[0].to_array
if note[0]==144 #if note-on massage 
note[3]=[[@ins[1],note[3]].max,@ins[2]].min

end
note=Midi.new(note[0],note[1],note[2],note[3])
output 0,note,t
end

In order for it to work, you just create module with this ruby component inside and put midi input and output to it. VST plugin must also have one or two mono inputs and outputs in order to be valid VST.
Your DAW should have a way to route midi into the effect and out of it. I'm not familiar with Studio One, but it's possible in FL studio and Cubase as far as I know.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Process MIDI data?

Postby daslicht » Thu Dec 25, 2014 2:50 pm

Thank you ,
I set it up as you described, but the forwared notes seam not to have a note off ?
I just get hung notes.?
daslicht
 
Posts: 14
Joined: Mon Aug 16, 2010 2:11 pm

Re: Process MIDI data?

Postby daslicht » Thu Dec 25, 2014 3:06 pm

I added a fader as int source, but now when i move teh fade it will also send notes:) Thats teh source of teh hung note

I keep fiddeling :)
daslicht
 
Posts: 14
Joined: Mon Aug 16, 2010 2:11 pm

Re: Process MIDI data?

Postby daslicht » Thu Dec 25, 2014 3:35 pm

How do I just craete notes when the input came from teh midi in and not when something is coming in the 2 other inputs, please?
daslicht
 
Posts: 14
Joined: Mon Aug 16, 2010 2:11 pm

Re: Process MIDI data?

Postby oddson » Thu Dec 25, 2014 7:10 pm

daslicht wrote:...I just get hung notes.?

If you limit the minimum value you will get hung notes if your keyboard uses note-on with velocity=0 in place of note-off messages (which many seem to do).
daslicht wrote:How do I just create notes when the input came from the midi in and not when something is coming in the 2 other inputs, please?
Do you mean physical inputs form the external device you're filtering with Flowstone - you'd have to make sure they're coming in on different MIDI channels and make the code sensitive to that.

Before Ruby, Flowstone (and it predecessor SynthMaker) could do this sort of processing with a MIDI splitter and MIDI event primitives and in conjunction with math and logic components without having to code.

While these can be easy to understand when simple they can get pretty messy once you start including complex behaviour.

This module would pass everything except channel 2 note-on messages unaffected and limit velocity on channel 2 note-on messages to 100.
Attachments
capture.png
capture.png (39.38 KiB) Viewed 17492 times
oddson
 
Posts: 36
Joined: Sun Jul 25, 2010 12:13 am

Re: Process MIDI data?

Postby daslicht » Thu Dec 25, 2014 7:39 pm

oddson wrote:If you limit the minimum value you will get hung notes if your keyboard uses note-on with velocity=0 in place of note-off messages (which many seem to do).

Yeh looks like my controler do not send NoteOff values
I am using Abpletonb Push + PXT General via MIDI Loop

oddson wrote:eDo you mean physical inputs form the external device you're filtering with Flowstone - you'd have to make sure they're coming in on different MIDI channels and make the code sensitive to that.
?

By inputs i was refering to the script above wihc has 3 inputs: midi, int1, int2

Code: Select all
def event i,v,t
   note=@ins[0].to_array
   if note[0]==144  #if note-on massage 
      note[3]=[[@ins[1],note[3]].max,@ins[2]].min   
      note=Midi.new(note[0],note[1],note[2],note[3])   
      output 0,note,t
   end
end
daslicht
 
Posts: 14
Joined: Mon Aug 16, 2010 2:11 pm

Re: Process MIDI data?

Postby daslicht » Thu Dec 25, 2014 7:55 pm

Ok hung notes are solved at least when playing, but when I move slider 1 the else branch is fired.

so essential I am looking for something like :
Code: Select all
if some value comes from input 1 or 2 (0 is the midi input) do not fire any midi event


idea?
seeL: http://i.imgur.com/2pKcVlR.png


Code: Select all
def event i,v,t
   note=@ins[0].to_array
   min = 50
   max = 100
   watch @ins[1]
      
   if note[0]==144 &&  note[3] > 0  #if note-on massage 
      #note[3]=[[@ins[1],note[3]].max,@ins[2]].min   
      note=Midi.new(144,note[1],note[2],100)   
      output 0,note,t
   else
      note=Midi.new(128,note[1],note[2],100)   
      output 0,note,t
   end
end
daslicht
 
Posts: 14
Joined: Mon Aug 16, 2010 2:11 pm

Re: Process MIDI data?

Postby tulamide » Thu Dec 25, 2014 8:42 pm

Code: Select all
def event i,v,t

   if i != 1 && i != 2   ### i tells either the name or the index of the input   ###
                  ### that fired the event. Alternatively you could set    ###
                  ### 'if i == 0', but I followed exactly what you wrote   ###
      note = v.to_array if v != nil
      if note[0] == 144
         if note[3] > 0
            note=Midi.new(144,note[1],note[2],100)
         else
            note=Midi.new(128,note[1],note[2],100)
         end
         output 0,note,t
      end
   end
end
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: Process MIDI data?

Postby tulamide » Thu Dec 25, 2014 8:57 pm

oddson wrote:This module would pass everything except channel 2 note-on messages unaffected and limit velocity on channel 2 note-on messages to 100.

Clean and easy-to-follow green solution. Good job!
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Next

Return to General

Who is online

Users browsing this forum: No registered users and 84 guests