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
ruby keyboard
Re: ruby keyboard
Here's a very quick hack (about 30 seconds) for a velocity sensitivity. Should work, but no warranty
- Attachments
-
- rubykeyboard_008bmp_maudio [tula].fsm
- (40.21 KiB) Downloaded 1105 times
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: ruby keyboard
Nubeat7 wrote:glad you like it spogg, please try this version with your m-audio keyboard if it works.. just a fast hack and i'm not very used to program in ruby the last time - i commented the code lines which should do the job
you find it in the event methode under the "when :midi in"
the velocity thing will need a bit more investigation, don't know when i will find time for it..
Brilliant! It works perfectly with my M-Audio Keystation 61. I'm so grateful for this
It looks from the Ruby coding (and I don't know Ruby other than trivial editing of others' work) that this version will work with the more conventional MIDI note on / note off keyboard as well. If this is the case we don't need a parameter for "M-Audio" do we?
If you do ever have time to do the velocity thing (and I have NO expectations) I would humbly suggest that you don't do the normal thing and make the whole key length sensitive to the mouse-to-velocity conversion. I reckon that only the lower half of the white and black keys shoulld respond to mouse position. This way the mouse pointer can remain in the usual operation range for on-screen playing. I've never seen this on a screen keyboard before so I think it would add some kudos and be more practical and musical.
As ever, thank you so much for sharing.
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: ruby keyboard
tulamide wrote:Here's a very quick hack (about 30 seconds) for a velocity sensitivity. Should work, but no warranty
Mein Gott!
That came in while I was typing my response to Nubeat. I can't believe you did that so fast. Respect!!
I suggested to Nubeat that the range on the keys for velocity response should be limited just to the lower half of each key, but I'm not going to push my luck with that request!
Thank you so much for turning your talent to this.
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: ruby keyboard
Thank you, wise Vulcan Spogg!
If you can live with a limit that is not relative to all the keys, but just to the white keys, then this little hack will do. Look inside the Keyboard module. In the RubyEdit you'll find 2 methods, mouseLDown and mouseMoveCaptured. In both of them you will find this line:
Replace them both with this version.
The "* 0.5" determines the relative length for the velocity range (here half the size of the white keys).
If you can live with a limit that is not relative to all the keys, but just to the white keys, then this little hack will do. Look inside the Keyboard module. In the RubyEdit you'll find 2 methods, mouseLDown and mouseMoveCaptured. In both of them you will find this line:
- Code: Select all
velocity = (y / (@h - 1)) * 127
Replace them both with this version.
- Code: Select all
velocity = [(y / ((@h - 1) * 0.5)), 1].min * 127
The "* 0.5" determines the relative length for the velocity range (here half the size of the white keys).
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: ruby keyboard
Spogg wrote:It looks from the Ruby coding (and I don't know Ruby other than trivial editing of others' work) that this version will work with the more conventional MIDI note on / note off keyboard as well. If this is the case we don't need a parameter for "M-Audio" do we?
yes it works for both..
thanks tulamide for chippin in, to get the right hight for black and white keys its better to get the velocity directly in the getSelection methode.. that should be all.. not so much investigation
- Attachments
-
- rubykeyboard_008bmp_maudio_velocity.fsm
- (38.46 KiB) Downloaded 1194 times
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: ruby keyboard
Nubeat7 wrote:thanks tulamide for chippin in, to get the right hight for black and white keys its better to get the velocity directly in the getSelection methode.. that should be all.. not so much investigation
You're welcome. And you are right, getSelection is the correct place for it - that's what you miss when you do such quick and dirty hacks
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: ruby keyboard
Well I must say I'm so impressed and many thanks to both Nubeat and tulamide.
I just find it so remarkable that you achieved in such a short time what I would have thought would be a major re-write.
This confirms even more your Wizard statuses and also implies, to me, the wonderful flexibility of the Ruby language.
What we now have is a virtual keyboard that can do what a real player couldn't. Namely make chromatic glissando with full control over velocity and make it equal volume for black and white keys. It sounds really expressive to me and nice to play.
I've mentioned elsewhere that when I first came to FS I was surprised there was no stock keyboard (unlike SynthEdit).
In my opinion this keyboard deserves to have that honour, even though it does far more than I would expect for a stock toolbox item.
Guys, you've made my weekend. Have a good one yourselves.
Cheers
Spogg
I just find it so remarkable that you achieved in such a short time what I would have thought would be a major re-write.
This confirms even more your Wizard statuses and also implies, to me, the wonderful flexibility of the Ruby language.
What we now have is a virtual keyboard that can do what a real player couldn't. Namely make chromatic glissando with full control over velocity and make it equal volume for black and white keys. It sounds really expressive to me and nice to play.
I've mentioned elsewhere that when I first came to FS I was surprised there was no stock keyboard (unlike SynthEdit).
In my opinion this keyboard deserves to have that honour, even though it does far more than I would expect for a stock toolbox item.
Guys, you've made my weekend. Have a good one yourselves.
Cheers
Spogg
-
Spogg - Posts: 3358
- Joined: Thu Nov 20, 2014 4:24 pm
- Location: Birmingham, England
Re: ruby keyboard
D*mn ... wish I could see it
The display is blank. I went in and looked at the BITMAPS. The images ARE there.
Just not showing up in my version. oh well ....
The display is blank. I went in and looked at the BITMAPS. The images ARE there.
Just not showing up in my version. oh well ....
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Re: ruby keyboard
RJHollins wrote:D*mn ... wish I could see it
The display is blank. I went in and looked at the BITMAPS. The images ARE there.
Just not showing up in my version. oh well ....
hmm, its done in 3.06..
try a afterload on the bitmaps
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: ruby keyboard
Hi NuBeat ...
It's strange. You already have an AfterLoad in place.
I've tried to re-trigger, redo connections, and added 'redraw' in RUBY ... no keyboard.
It PLAYS as expected.
I'll try again ...
It's strange. You already have an AfterLoad in place.
I've tried to re-trigger, redo connections, and added 'redraw' in RUBY ... no keyboard.
It PLAYS as expected.
I'll try again ...
- RJHollins
- Posts: 1571
- Joined: Thu Mar 08, 2012 7:58 pm
Who is online
Users browsing this forum: No registered users and 26 guests