General

slider to adjust note velocity of any midi exiting Lemur?

Started by eross21 on .

Sign in or create an account to join the conversation.

14 posts

Topic starter
I have a drum kit template set up in lemur. I can finger drum Midi notes out of Lemur to drum apps, it works great. However, they are all at max velocity. I want to put a single fader all alongside of my drum pads in Lemur. All I want it to do is to adjust the velocity of and midi note coming out of Lemur. How can I do this?
eross21
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Hey you will need to do it with scripting because on the standard midi out the velocity is tied to the x values of the pads and then scaled to 127.

you will use the command noteout()

I can try and work out an example later and you can analyze it, it is not very complex.

There are other methods too, but noteout() works nice


In the meantime try searching for it in the manual and all, but I will post later
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Ok wow it was a little more of a handful than I thought to make because of getting the pitches to ascend correctly and not have stuck notes.

But yea, this is a pretty solid example. To see how it works go to the DrumPads object and look inside the script called "Press()"

If you are new to scripting, none it may make sense and if you want to figure it out you will have to learn some scripting. Otherwise if you have questions let me know!

Also don't change the lowest pitch knob if notes are still sustaining.


**(Moved file over to modules section)
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
awesome. I am going to try it out as soon as I get home from work. I can't wait!! As far as beginning to learn scripting, where can I go to learn? what kind should I learn? C, C+, Java? or is there a specific lemur scripting language. I'd like to learn to do very basic scripting. thanks again
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Nicolas,
I saw your template you made for me on the forum. it works great! However, I am having getting the right pads were i want them on your grid. I really dont need the pitch wheel. I am attaching my ergonomic drum layout template i made up. Can you add or explain to me how to add just the velocity slider you had on your template, to mine? I tried copying and pasting, but it doesn't work. do i have to copy scripting over for velocity? were can i see the scripting. thanks again, your awesome.

erdrumsvelocity.jzml
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Ok for this you can do it in a few ways.
One way is to individually put in a script that sends a simplified noteout() expression.
Another way is to manage them all in one array.
and more

ok I will show you in a bit. And you can look at the script, maybe it will make more sense when it is individual like this.

Fun design! If you learn some scripting, in the future you could draw something like this in canvas, and then have the freedom to move it around and do whatever else. Just liked your design and thought I'd say that.

My name is Dillon by the way
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Ok here you go. I started the work for you, but I won't finish.

Super easy though.
-- So go to the pad called "kick" (in the scripting explorer on the bottom right section of the editor).
--it will have a script called "act()" and an expression called "pitch"
--copy and paste these two things into every Drum Pad object. (I think I did 4 of them for you)
--then change the "pitch" expression of each one to the pitch you want to send out.
--while you do this, uncheck the "x" variable (important!!) that will prevent it from being sent out and clashing with the noteout() command

that should do it! Let me know if you have questions

If you want to change the target or channel of them, use the "channel" and "target" expressions I made int he scripting menu

erdrumsvelocity.jzml
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
I think you can figure out the scripting easier now that they are individual scripts.
It's pretty simple:
-It's a condition saying if the "x" variable equals one, then it will send a MIDI note with those 4 arguments (target,pitch,velocity,channel). In this case the velocity will be 127 (vel.x*127)
-and then "else" meaning if x doesn't equal one (x equals 0) it will send out a MIDI note but with the velocity at 0 (a note off).

and at the top of the script you will see it is executed o"n expression" "x"
-so the script happens whenever the "x" expression value changes (when you press the pad and release it)

You can also see how having all the drum pads on one object makes the scripting easier and cleaner (like the first thing I sent you)
-so if you drew al these squares o canvas, you could manage all the scripts in one place like before. Just saying lol
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
so I guess I am confused with scripting. were to I type the scripting ? does it get typed into each drum pads settings, or into the slider settings, or does scripting all go onto its own page? sorry, I have never done scripting, so I'm kind of confused as to how it gets laid out. Can the scripting be done on my iPad,or do I have to do all of this through the computer lemur designer? is there any way you could script the velocity slider to the last template I sent you, then I can see we're the scripting comes into play? thanks your awesome. I feel like I'm learning a lot from all your help.
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
sorry, I just your 2 post above. I will defiantly try the scripting, and let you know how it goes. thanks for the compliments on the design. I love that layout. I can drums very quick and precisely with that layout.
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
also sorry about typing your name wrong Dillon. I don't know if it was the autocorrect, or what happened. lol. thanks again for all your help
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Hey so will need to do it on your lemur editor on the computer.

-Open the layout up on the editor.
-On the bottom right side of the screen will be a section with all the objects, expressions and their scripts (n more).
-If you click the Pad called "Kick" it will take you right to that object in the scripting section.
-Most objects have an arrow next to them that shows the scripts and expressions they use.
-So open up the "Kick" object and you will see the script called "act()" and an expression called "pitch" (expressions have green dots, scripts have the orange-red color)
-To copy a script or expression, simply highlight it and use the normal copy paste shortcuts. You can only copy and paste one item at a time
-you will paste them into the other Pad objects (I think after the 2 kicks, everything else is called "Pads#"
-To paste into an object, just click on the object, or one of the scripts/expressions inside it and paste (ctrl v)
-Follow my directions in the previous post

If you are confused about the layout of the editor, look it up in the user guide. If that's not good enough, try searching the forums
It really is a simple task to finish, you just need to know where to go
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
dude that worked perfectly. i am so happy to have my controller exactly how i like it. i have 2 questions. 1. what scripting language should i learn, and were, links, videos..etc.? the area were i pasted the act() and pitch,….how do you add that in without copy and paste? and how do you know that adding those 2 things can make such a big difference. I think i need to learn coding, cause that is really cool.
thanks again, I'm super excited to have it all working finally
Subject: Re: slider to adjust note velocity of any midi exiting Lemur
Hey dude,
You can read the user manual or do some searching around here for some lessons/tutorials in scripting on lemur.
I'm sure someone knows some good links for starting out... GUYs anyone got a link????


on the editor in the bottom right section (where you were copy and pasting scripts), at the bottom there are 5 buttons. The furthest button to the right creates a new script (has an orange/red/tan dot next to it when created). The one in the middle (x=?) creates a new expression (they have a green dot next to them). An expression is like a variable/value or it can be an array (list of values).

When you create a script, you can click it, and then in the bottom middle section of the editor you can see what is inside the script (the code).
At the top of the code you can determine when the script is executed (when the code does it's thing). Use the user guide to discover what commands of code you can use. Also at the bottom of the scripting section (bottom right of editor) will be a drop down menu called "internal". Inside will be a list of a lot of commands you can use and their arguments (arguments are kind of like variables for the command, IE in the noteout() command it had arguments for target,pitch, velocity and channel).

Other useful things to learn for the lemur scripting would be:
-decl (declare variables)
-if conditional
-for loop (and stuff for it like "break")

There are some lessons for these things under the jazzmutant site. So search "jazzmutant" and "if then" or something

hope that heps