Group Admins

  • Profile picture of Karim
  • Profile picture of Jean

OpenMusic

Public Group active 3 minutes ago

User group for OpenMusic and computer-aided composition. Visit the Forum for discussions.

note-of bug

Author 2 Subscribed Users |
Jérôme
Jérôme

hello

As you can see in the patch, with w10 & linux, I generate a note at note-out (normal) but also at note-of (not normal) : OM 6.12.1, what else ?

Cheers~

………………………………….. jerome

Attachments:
  1. midi-in.omp
March 21, 2017 at 22:57 #21973
Jérôme
Jérôme

sorry ! I meant

As you can see in the patch, with w10 & linux, I generate a note at NOTE-IN (normal) but also at note-of (not normal) : OM 6.12.1, what else ?

my bad…..

March 21, 2017 at 23:17 #21976
Profile photo of anders
anders

Hi Jérôme.

Testing your patch here there’s only note-on’s passed through the #’preprocess filter as prescribed.

Perhaps the device you’re using sends keyoffs as keyons with vel=0?

You can check by putting a ‘print object after the input in the “preprocess” lambda-patch.

Or just evaluate this in your listener/lisp

(defmethod test-Type :before ((self MidiEvent) type)
(print (ev-type self)))

Any of the approaches will print the midi-ev type coming in. Here it prints :keyon followed by :keyoff.

-anders

March 22, 2017 at 16:10 #21977
Jérôme
Jérôme

Hi Anders,

It is a strange thing because I didn’t have this problem with this patch with OM 6.10.(windows, osx, linux) with the same keyboard

(see attached) As you can see, I generate :keyon even when I make a :keyoff…

>>Perhaps the device you’re using sends keyoffs as keyons with vel=0? : Maybe… So why did it work with OM 6.10 ?

Any hint ?

Same behavior with Ubuntu and W10

…………………………………… jerome

Attachments:
  1. listener

    listener.png

March 22, 2017 at 18:09 #21980
Jérôme
Jérôme

hi Anders,

I’ve just monitored my keyboard (a really simple digital piano) and It sends both :keyon and :keyoff

……………………………………………… jerome

March 22, 2017 at 23:51 #21983
Profile photo of anders
anders

Hi Jéröme. I’m not sure what you want here.

I’ve just monitored my keyboard (a really simple digital piano) and It sends both :keyon and :keyoff

The dump you sent shows only :keyon. (Using the :before method i sent you and your patch, any :keyoff events would be printed as such.)

You can add a check for velocity!=0 inside ‘preprocess’ if it’s just in this patch you want to filter out :keyons with vel=0.

If you want this behavior in all of OM you can hack something like this (which changes all :keyon’s created with vel=0 to :keyoff’s) and place it in a file inside your /user/ folder:

(defmethod initialize-instance :after ((self midievent) &rest l &key (mode 0))
  (when (and (eql (ev-type self) :keyon)
	     (listp (ev-fields self))
	     (typep (second (ev-fields self)) '(real 0 0)))
    (setf (ev-type self) :keyoff))
  self)

But take care! This will make all :keyon events with zero velocity actually be :keyoffs in this workspace.

-anders

March 23, 2017 at 08:36 #21992
Jérôme
Jérôme

OK,

So, you mean that, no ? (see attached) 😉

Thanks, Anders

………………………………………………… jerome

Attachments:
  1. fix-noteoff.lisp
March 23, 2017 at 22:34 #21995
Jérôme
Jérôme

not really,

my bad….

March 23, 2017 at 22:48 #21998

You must be logged in to reply to this topic.

Log in now