Page 1 of 7

ruby keyboard

Posted: Fri Oct 24, 2014 10:39 pm
by Nubeat7
hi all,
here is a keyboard built with ruby,

i tried to comment the code with sense but some parts will be a bit confusing because it has 2 area containers one for black notes and one for white notes - it was the only way for me to make it work, maybe there are some better ways to built it up

its fully resizeable and also offers a latch mode where you can turn notes on with one click and off with a second click on the note.

v.04 : fixed out of range bug when dragging out of keyboard area
v.06 : last fix did just half of its job (4.3.15)
rubykeyboard_006.fsm
(29.98 KiB) Downloaded 1642 times


v.08 bmp: the bitmap version which uses images for the the keys
rubykeyboard_008bmp.fsm
(45.28 KiB) Downloaded 1553 times

key.png
key.png (30.97 KiB) Viewed 38477 times

Re: ruby keyboard

Posted: Fri Oct 24, 2014 11:35 pm
by Exo
Nice work NuBeat, resizable too :)

I think the structure is fine, keeping the black and white keys separate makes sense to me.

Thanks for sharing.

Re: ruby keyboard

Posted: Fri Oct 24, 2014 11:50 pm
by RJHollins
Just a fast check ... Man you do nice work NuBeat ! 8-)

Will take a closer look later tonite ... thanks for posting !

Re: ruby keyboard

Posted: Sat Oct 25, 2014 1:19 am
by nix
Thanks so much mate!
Structure looks clean IMO
Very nicely done- much appreciated.

DJ Brynte check this mod out man!
Brynte- I can try and hack MIDI in if you like,
but I'm not sure I will succeed,
it will be very difficult for me,
as even simple things in Ruby-
it's hard to find the method, then the right syntax
Let's use this keyboard though prolly hmm

Let's talk about MIDI in if you'd like peeps-
anyone want to get it going?
the first thing to do is parse the MIDI message hash and get the keys IMO
Will perhaps do this tonight. I've done that before with NB's help.
I will get that up in the next few days if this doesn't progress.
I may use some hacks- ie. MIDI split will tell us what we need to know about the incoming MIDI.
I think it functions semi-polyphonically___hmm maybe not ideal though

Re: ruby keyboard

Posted: Sat Oct 25, 2014 9:36 am
by djbrynte
Nubeat your the Geek ;) of the geeks :P awesome man i will check this out. Hope it works. Let me let you know later i will test now.

Re: ruby keyboard

Posted: Sat Oct 25, 2014 11:08 am
by djbrynte
Btw you can stop doing pianos it wont work in flowstone. Because if you wana see the midi when its playing it has a bugg. So its useless having a piano in this program. Seem like waste of time. Will always be 100 buggs.

I mean if we should have a piano. Then you wana see when the midi is pressed. Otherwise we can have an image instead. So this piano shit is just to leave.

Re: ruby keyboard

Posted: Sat Oct 25, 2014 11:09 am
by djbrynte
But anyway thanx for the thing :)

Re: ruby keyboard

Posted: Sat Oct 25, 2014 11:13 am
by Exo
Just to give some details of what djbrynte means.

The bug comes when the keyboard is being redraw while notes are playing and you open a drop down selector, it causes the audio to freeze and loop. This is Flowstones thread protection working and look like only way to avoid such a situation is to not redraw the notes with incoming midi.

Re: ruby keyboard

Posted: Sat Oct 25, 2014 11:30 am
by djbrynte
thank you exo. I dont know mybe its working some way. I hope some one have a smart idea for this. Because if flowstone have a working keyboard will be +.

Re: ruby keyboard

Posted: Sat Oct 25, 2014 2:06 pm
by tulamide
Exo wrote:This is Flowstones thread protection working and look like only way to avoid such a situation is to not redraw the notes with incoming midi.
Has anyone already tried Ruby's Thread.new in this context?