MIDI displayed onNote

Post topics about HALion scripting.
Post Reply
User avatar
abject39
Member
Posts: 303
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

MIDI displayed onNote

Post by abject39 » Sun Nov 04, 2018 3:27 am

Tried to create a basic parameter that goes from 0 to 1 when a note is played. I figured it would be easy but this is my first time writing code that isn't addressing a parameter from the parameter list so I'm not completely sure how to do it. Can anyone assist with this? The goal is create the parameter so that the user can see it on my macro page.

Code: Select all

function onNote(event)
  if noteOn then
      MIDIdisplay = 1
  else
      MIDIdisplay = 0
  end
end

defineParameter("MIDIdisplay", nil, 0,0,1,1, onNote)
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

misohoza
Member
Posts: 834
Joined: Sun Oct 05, 2014 12:18 am
Contact:

Re: MIDI displayed onNote

Post by misohoza » Sun Nov 04, 2018 12:26 pm

Maybe try something like this:

Code: Select all

function onNote(event)
  MIDIdisplay = 1
  postEvent(event)
  wait(100)
  MIDIdisplay = 0
end

defineParameter("MIDIdisplay", nil, 0,0,1,1)
Or if you want the animation parameter to be read only:

Code: Select all

function onNote(event)
  MIDIdisplay = 1
  postEvent(event)
  wait(100)
  MIDIdisplay = 0
end

defineParameter{
  name = "MIDIdisplay",
  default = 0,
  min = 0,
  max = 1,
  increment = 1,
  readOnly = true
}
Win 10 Home, 64 bit, 8 gb ram,
Cubase Pro 9, Wavelab Pro 9, Halion 6, Dorico,
NI Komplete 10 Ultimate, Ozone 7,
UR 44

User avatar
abject39
Member
Posts: 303
Joined: Sat Jan 17, 2015 8:20 pm
Location: Ventura, Ca
Contact:

Re: MIDI displayed onNote

Post by abject39 » Sun Nov 04, 2018 4:55 pm

Oh nice! I didn't know "wait" was a function. I looked into the references and found "waitForRelease", which works even better for my purpose. Might be useful for you as well. Thank you!
My vision is uncompromising: to transcend my clients dreams by mesmerizing their audience with the world's finest audio arrangements and products.

Post Reply

Return to “Halion Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest