Old 03-06-2018, 07:13 PM   #1
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,643
Default Use your mouse as a MIDI controller



This FX enables a standard three button wheel mouse to be used as a crude MIDI controller. To use:

Place the mouse cursor over FX graphics window.
Use the mouse wheel, or click (middle button) and vertical drag to send continuous output.
Use left or right buttons to send momentary output.

Output can be either Pitch Bend or CC.

The sensitivity of the mouse controls can be adjusted. The default setting works OK for me, but may not suit every mouse.

You can use multiple instances of this FX to control multiple parameters. The FX will only react if the mouse cursor is inside the graphics window, so just arrange the FX instances in floating windows on your screen.

When output is set to Pitch Bend the slider position has a sticky spot at the mid point (MSB 64). CC output is high res paired CCs.

The main purpose of this FX is to smooth out the mouse action. I find that if using a mouse to adjust parameters the movement is often fairly jerky, so there is some code in here that attempts to smooth that out. The smoothing function will cause an override if you move the wheel slowly or drag slowly. To halt the movement, release the mouse wheel if dragging, or click the mouse wheel if using it as the control.

If anyone finds this FX useful, let me know and I will add it to ReaPack.

Currently available in the stash here: https://stash.reaper.fm/v/33047/Time...IDI-Mouse.jsfx
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth

Last edited by Time Waster; 03-06-2018 at 07:16 PM. Reason: Added a link to the FX
Time Waster is offline   Reply With Quote
Old 03-06-2018, 11:05 PM   #2
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

WOW, this is so awesome !

Cause i don't have a hardware midi cc controller, this is incredibly useful to me.
Thanks so much !

I will wait till it gets in ReaPack
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 03-06-2018, 11:35 PM   #3
zappadave
Human being with feelings
 
zappadave's Avatar
 
Join Date: Jan 2008
Posts: 1,257
Default

Works very smoothly
Thanks very much
I have a 7 button logitech mouse and it works perfectly
Nice addition for my drum pad
__________________
Music is the best
เพลง ที่ดีที่สุดคือ
zappadave is offline   Reply With Quote
Old 03-07-2018, 03:35 AM   #4
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,643
Default

Thanks for the feedback. I've submitted it to the ReaPack team for inclusion under JSFX/Utility.
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 09-21-2020, 04:11 PM   #5
sebacamposs
Human being with feelings
 
Join Date: Sep 2020
Posts: 2
Default I cant record with the MIDI mouse

I know this is a relatively old thread, but I would appreciate some help. I cant seem to record what I do with the MIDI mouse. I can hear the pitch changes in the moment I'm moving the mouse wheel, but when I play it back I only hear the midi note i played.
Thanks in advance to anyone who can direct me into recording the pitch changes, as this plugin is exactly what I need
sebacamposs is offline   Reply With Quote
Old 09-21-2020, 04:27 PM   #6
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,107
Default

Quote:
Originally Posted by sebacamposs View Post
I know this is a relatively old thread, but I would appreciate some help. I cant seem to record what I do with the MIDI mouse. I can hear the pitch changes in the moment I'm moving the mouse wheel, but when I play it back I only hear the midi note i played.
Thanks in advance to anyone who can direct me into recording the pitch changes, as this plugin is exactly what I need
Welcome to Reaper forums.
On the track you want to record the pitch changes: Record arm the track, rightclick on the track's record arm button and choose 'Record: output > Record: output (MIDI)' then it should work.

(The unfortunate thing is that Reaper doesn't have a Record: output (MIDI) overdub mode...).
nofish is offline   Reply With Quote
Old 09-23-2020, 11:42 AM   #7
sebacamposs
Human being with feelings
 
Join Date: Sep 2020
Posts: 2
Default

It worked perfectly, thank you very very much
sebacamposs is offline   Reply With Quote
Old 09-23-2020, 03:30 PM   #8
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

Hmm, should be possible via ReaScript too. I wonder if I should attempt onr, just for the lols...
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-26-2020, 08:58 AM   #9
Jae.Thomas
Human being with feelings
 
Join Date: Jun 2006
Posts: 22,572
Default

I couldn't seem to get this working, I would try and learn parameters, put this before the plugin, and nothing. Can it be used with automation or just midi?
Jae.Thomas is offline   Reply With Quote
Old 10-26-2020, 11:07 AM   #10
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,008
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Hmm, should be possible via ReaScript too. I wonder if I should attempt onr, just for the lols...
how would you send the MIDI the script generates to a track input?
daniellumertz is offline   Reply With Quote
Old 10-26-2020, 12:55 PM   #11
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

You send it using StuffMidiMessage like any other midi device. So you send a midi note on midi-channel 1 and if the record input on track 1 is midi all channels or midi channel 1, it will be recognized by the track.

There's a Midi Controller script I wrote just for fun, which shows how it works.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-26-2020, 02:06 PM   #12
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,008
Default

glad to know about StuffMidiMessage() thanks mespotines!

is this the midi controller ?? https://forum.cockos.com/showthread.php?t=242740

Will study it thanks

edit
Also: what are my options when it comes to receive MIDI in* a script?
daniellumertz is offline   Reply With Quote
Old 10-26-2020, 02:44 PM   #13
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

It would be cool if this would work also in UI embedded mode in TCP for example. Quickly tried here, it does not behave same as in floating window mode. I used it for pitchbend, holding middle mouse button (the top left corner button on my trackball mouse, kensington expert, with my left hand, yes trackball is on the left side of my qwerty, then moving a second mouse with my right hand, Razer Deathadder. Works nicely on floating windows, but not on UI embedded in TCP, as mentioned above. Maybe there is a magic setting for the mouse I need to find so it will work also in the embedded case? Mouse button clicks work there as well.

I prefer holding middle mouse button, moving the mouse because this seems to be more precise with the default settings at least.

How many mouse buttons can this support at maximum? Only 3 (left,middle,right) or are more possible as well? 20 buttons? 40 buttons?

Thanks for sharing this cool tool.

UPDATE: Are the cctarget values correct, it seems there is a misbehaviour.
Example: Try output: 0 Bank Sel M, its output will be cc 1. Because it is in second position in slider1 or cctarget.

Last edited by TonE; 10-26-2020 at 03:11 PM.
TonE is offline   Reply With Quote
Old 10-26-2020, 02:54 PM   #14
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

Quote:
Originally Posted by daniellumertz View Post

edit
Also: what are my options when it comes to receive MIDI in* a script?
Only some values sent as Midi shortcut that can be read at scriptstart using get_action_context.
Aside from that, nothing possible.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-26-2020, 02:56 PM   #15
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

Quote:
Originally Posted by TonE View Post
It would be cool if this would work also in UI embedded mode in TCP for example. Quickly tried here, it does not behave same as in floating window mode. I used it for pitchbend, holding middle mouse button (the top left corner button on my trackball mouse, kensington expert, with my left hand, yes trackball is on the left side of my qwerty, then moving a second mouse with my right hand, Razer Deathadder. Works nicely on floating windows, but not on UI embedded in TCP, as mentioned above. Maybe there is a magic setting for the mouse I need to find so it will work also in the embedded case? Mouse button clicks work there as well.

I prefer holding middle mouse button, moving the mouse because this seems to be more precise with the default settings at least.

How many mouse buttons can this support at maximum? Only 3 (left,middle,right) or are more possible as well? 20 buttons? 40 buttons?

Thanks for sharing this cool tool.
I think it has the same limitations as ReaScript's gfx-variables so left, right, mousewheel and hmousewheel+keyboard modifiers.

Edit: the jsfx supports middle mousebutton?
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 10-26-2020, 04:12 PM   #16
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,008
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Only some values sent as Midi shortcut that can be read at scriptstart using get_action_context.
Aside from that, nothing possible.
ah
daniellumertz is offline   Reply With Quote
Old 10-27-2020, 07:16 PM   #17
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,643
Default

Quote:
Originally Posted by Jae.Thomas View Post
I couldn't seem to get this working, I would try and learn parameters, put this before the plugin, and nothing. Can it be used with automation or just midi?
The FX sends out MIDI CC messages (just like a hardware midi controller), so you need set the parameter modulation for MIDI CC control. It's not difficult, but I don't have reaper in front of me right now, so I can't lead you through the steps. Just click on the 'Param' button on the target FX and dig around until you find it.

Yes, you can use it for recording automation.
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 10-27-2020, 07:20 PM   #18
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,643
Default

Quote:
Originally Posted by TonE View Post
It would be cool if this would work also in UI embedded mode in TCP for example. Quickly tried here, it does not behave same as in floating window mode. I used it for pitchbend, holding middle mouse button (the top left corner button on my trackball mouse, kensington expert, with my left hand, yes trackball is on the left side of my qwerty, then moving a second mouse with my right hand, Razer Deathadder. Works nicely on floating windows, but not on UI embedded in TCP, as mentioned above. Maybe there is a magic setting for the mouse I need to find so it will work also in the embedded case? Mouse button clicks work there as well.

I prefer holding middle mouse button, moving the mouse because this seems to be more precise with the default settings at least.

How many mouse buttons can this support at maximum? Only 3 (left,middle,right) or are more possible as well? 20 buttons? 40 buttons?

Thanks for sharing this cool tool.

UPDATE: Are the cctarget values correct, it seems there is a misbehaviour.
Example: Try output: 0 Bank Sel M, its output will be cc 1. Because it is in second position in slider1 or cctarget.
JSFX only supports three mouse buttons.

I'll look into those errors.
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 11-02-2020, 05:58 AM   #19
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,643
Default

@TonE, I finally got around to looking at my code. Have you got the latest version? The initial beta version had the bug you mention. It was fixed in version 1.00.
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 11-02-2020, 09:52 AM   #20
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

Indeed my version shows 0.1.0, but wondering why I did not get the latest as I am using reapack as well. Which reapack address should I use?
TonE is offline   Reply With Quote
Old 11-03-2020, 01:53 PM   #21
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,008
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Only some values sent as Midi shortcut that can be read at scriptstart using get_action_context.
Aside from that, nothing possible.
mespotine I was thinking in how this script manage to put MIDI notes it captures with and JSFX?

Quote:
Originally Posted by obogz View Post
Thanks, the script is finished btw, I'm waiting for aproval to be added in the ReaPack external repo index.
It is as close to ableton as I could get it using scripts (no state management yet).
Now I'm reteaching how to save a state so I know what happened when the last command was used on this script.

The final script is here: https://github.com/obogz/ReaperScripts


I'm thinking of changin the behaviour of what happens when you are with the cursor in the middle of the note and going back. Ableton deletes what is in the front and shortens what is behind. I'm thinking of leaving what is in the front. Makes more sense.
Is it an exemple of gmem? will open the script to see what is going under the hood. IDK If it is passing MIDI info to the scripts with the JSFX, if so it would be very haandy.


EDIT: Opening the script found the part that shows more less how to do it
Code:
function getHeldNotes(track)

	local iHelper = getOrAddInputFx(track, jsfx, true)

	-- read the notes of the helper fx
	local heldNoteCount = reaper.TrackFX_GetParam(track, iHelper, jsfx.paramIndex_NotesInBuffer)

	if heldNoteCount < 1 then
		return {}
	end

  local pitches={}

  for i = 1, heldNoteCount, 1 do
    reaper.TrackFX_SetParam(track, iHelper, jsfx.paramIndex_NoteQueryIndex, i - 1)
    -- now the plugin updates its sliders to give us the values for this index.
    pitches[#pitches+1] = {}
    pitches[#pitches].note, _, _ = reaper.TrackFX_GetParam(track, iHelper, jsfx.paramIndex_NoteValue)
    pitches[#pitches].chan = reaper.TrackFX_GetParam(track, iHelper, jsfx.paramIndex_Channel)
    pitches[#pitches].velocity = reaper.TrackFX_GetParam(track, iHelper, jsfx.paramIndex_Velocity)
    --DBG("   held note "..pitches[#pitches].note.." / vel "..pitches[#pitches].velocity)
  end
  return pitches
end
Now must open JSFX

Last edited by daniellumertz; 11-03-2020 at 02:20 PM.
daniellumertz is offline   Reply With Quote
Old 11-03-2020, 02:26 PM   #22
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

To my knowledge, JSFX can read MIDI-Notes. You could receive them that way(maybe as inputFX) and send them via gmem to ReaScript.
You would need to synchronize them properly, as JSFX are updated far more often than ReaScript, so if done wrong, you could miss notes.
So you need to have a "midi-note-buffer" via gmem you can read time and again and clear afterwards.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-03-2020, 02:43 PM   #23
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,008
Default

as I am trying to understand the script it seems to store the info about the notes in sliders ( parameters ) and then the script get it looking at them. I havent found Gmem in the script, wondering if it would be better to make this way...

Yes the JSFX is in the inputFX

Hmm yeah script have an loop to request info about the notes.

Basically
Get {number of held notes slider]
if > 1
Loop 0 , #notes-1
setParameter(Notes Query Index, i)-- this updates the pitch, vel, channel sliders)
Get the parameters

Last edited by daniellumertz; 11-03-2020 at 02:50 PM.
daniellumertz is offline   Reply With Quote
Old 11-03-2020, 03:36 PM   #24
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

I don't think the jsfx discussed in here uses nor needs gmem(haven't looked into it as I don't have actual MIDI-stuff to work with in the first place ) as gmem is probably only useful, when you want to share values between jsfx/video processor and ReaScript.

I just was referring to your earlier post, where you asked about the possibility to listen to MIDI inside of ReaScript. Gmem could be a possible solution for it.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 11-03-2020, 08:40 PM   #25
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 2,008
Default

hahah yes, as I never tried Gmem before I was wondering if with gmem there would be more possibilites/preferable to code with.

Will try to rearrange his script and jsfx to get the basic/essence of it so other people might use... Is an very smart idea I thought ! Maybe adapt to CC also
daniellumertz is offline   Reply With Quote
Old 11-03-2020, 09:46 PM   #26
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,643
Default

Quote:
Originally Posted by TonE View Post
Indeed my version shows 0.1.0, but wondering why I did not get the latest as I am using reapack as well. Which reapack address should I use?
I probably haven't updated the ReaPack version. I didn't even know I had put it there
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 11-03-2020, 09:58 PM   #27
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

I checked the version but did not try it yet, today later maybe, but I am sure it will work. Thanks for your help.

While being at tcp usage of jsfx, do we have already an xy-2D version, which we could use with a pen + tablet, and if that could work as well on tcp controls, plus multiple of them at the same time, side by side, this could be very cool, just add as many as you want there, directly draw with your pen, if you have a graphics tablet.
TonE is offline   Reply With Quote
Old 05-01-2021, 10:37 PM   #28
Suganthan
Human being with feelings
 
Join Date: Jan 2016
Posts: 8
Default Great!

This is a very great utility. I use this to test Fluid Pitch MIDI FX whenever I'm on the move and do not have the access to a MIDI controller. The resolution is super fine that sometimes, it causes spikes in my CPU with some VST, anyway to reduce this would be super cool.
Suganthan is offline   Reply With Quote
Old 05-02-2021, 09:08 AM   #29
SNJUK2
Human being with feelings
 
SNJUK2's Avatar
 
Join Date: Feb 2017
Location: Zhytomyr,Ukraine
Posts: 449
Default

Hi. Nice plug
Midi mouse dont work with midi learn?
Is it possible?
Thanks
SNJUK2 is offline   Reply With Quote
Old 05-05-2021, 09:23 AM   #30
Suganthan
Human being with feelings
 
Join Date: Jan 2016
Posts: 8
Default Some minor bug fixes

I found some bugs, fixed them. I needed a slider which can reduce the amount of output MIDI messages also which I have implemented.

Changes in TimeWaster MIDI-Mouse, v1.1.0:
* Added an Output MIDI Rate slider to give the option to reduce the output MIDI messages per unit time when needed.
* Fixed a bug with Toggle CC not toggling correctly under certain scenario.
* Fixed a bug where when channels were set to All, the MIDI was not sent accordingly

PS: In continuous mode, it outputs high resolution paired CC messages which means it utilizes two traditional CCs (for LSB and MSB).
Attached Files
File Type: txt TimeWaster MIDI-Mouse v1.1.0.txt (11.7 KB, 168 views)
Suganthan is offline   Reply With Quote
Old 01-25-2022, 02:01 AM   #31
mcconnor
Human being with feelings
 
Join Date: Feb 2020
Posts: 89
Default

I have been looking to use my laptops touchpad as a midi controller (mainly as modulation wheel) as I normaly use my laptop with bluetooth mouse and therefore the touchpad is idle and could be put to better use than just sitting around. I imagine moving a finger up the pad would increase modulation CC value, moving down would decrease it.

this could really come in handy to controll vst during live gigs - laptop is well within reach all the time...

is something like this within the scope of this plugin?
mcconnor is offline   Reply With Quote
Old 04-23-2023, 05:55 AM   #32
Sid
Human being with feelings
 
Join Date: Apr 2018
Posts: 516
Default

Quote:
Originally Posted by nofish View Post
(The unfortunate thing is that Reaper doesn't have a Record: output (MIDI) overdub mode...).
I use this plugin by putting it on the Input FX. Then I can still use Record: MIDI overdub mode...
Sid is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.