bugDenemo - Bugs: bug #50661, Commands to enter notes from PC...

 
 

bug #50661: Commands to enter notes from PC keyboard

Submitted by:  Richard Shann <rshann>
Submitted on:  Tue Mar 28 09:49:05 2017  
 
Category: NoneSeverity: 1 - Wish
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue Mar 28 16:29:56 2017, comment #1:

This script sets up a UK keyboard to act as a MIDI simulator:

;;;;;;;SimulateMidi keys a, w etc respond like a piano keyboard with notes from Middle C to G in the next octave. US keyboards need the top few names adjusting, other keyboards even more.

(define-once SimulateMidi::active #f)
(if SimulateMidi::active
(begin
(set! SimulateMidi::active #f)
(d-InfoDialog (_ "MIDI simulator end")))
(begin
(d-InputFilterNames "Simulated MIDI Filter")
(let loop ()
(define key (d-GetKeypress))
(cond
((equal? key "a") (d-PutMidi #xFF3C90))
((equal? key "w") (d-PutMidi #xFF3D90))
((equal? key "s") (d-PutMidi #xFF3E90))
((equal? key "e") (d-PutMidi #xFF3F90))
((equal? key "d") (d-PutMidi #xFF4090))
((equal? key "f") (d-PutMidi #xFF4190));f
((equal? key "t") (d-PutMidi #xFF4290))
((equal? key "g") (d-PutMidi #xFF4390))
((equal? key "y") (d-PutMidi #xFF4490))
((equal? key "h") (d-PutMidi #xFF4590))
((equal? key "u") (d-PutMidi #xFF4690))
((equal? key "j") (d-PutMidi #xFF4790));b
((equal? key "k") (d-PutMidi #xFF4890))
((equal? key "o") (d-PutMidi #xFF4990))
((equal? key "l") (d-PutMidi #xFF4A90))
((equal? key "p") (d-PutMidi #xFF4B90))
((equal? key "semicolon") (d-PutMidi #xFF4C90))
((equal? key "apostrophe") (d-PutMidi #xFF4D90))
((equal? key "bracketright") (d-PutMidi #xFF4E90))
((equal? key "numbersign") (d-PutMidi #xFF4F90))
)
(if (not (equal? key "Escape"))
(loop)))
(set! SimulateMidi::active #f)
(d-InputFilterNames "No MIDI Filter")
(TimedNotice (_ "MIDI simulator end"))))

;;;;;;;;end of script

The script ends the simulated MIDI when Escape is pressed. Other keys are ignored. It would be nice to have other keys passed back to be actioned (e.g. arrow keys for correcting notes ...)
This would require a new functionality in C.
The procedure (in scheme-callbacks.c) could take a parameter to say put back the last event. Here is the current code:

SCM
scheme_get_keypress (void)
{
GdkEventKey event;
gboolean success = intercept_scorearea_keypress (&event);
if (success)
{
gchar *str = dnm_accelerator_name (event.keyval, event.state);
SCM scm = scm_from_locale_string (str);
g_free (str);
return scm;
}
else
return SCM_BOOL (FALSE);
}

event would need to be static and calling with #f as parameter could lookup the command for the event lookup_command_for_keyevent (&event)
and then execute the command, if any.

Richard Shann <rshann>
Project Administrator
Tue Mar 28 09:49:05 2017, original submission:

A set of them could be devised that issued MIDI key numbers (so D-flat and c-sharp are the same command with the result depending on the enharmonic set)
You would blu-tak a template over your pc-keyboard to make a piano style keyboard from it and create short cuts for the new commands to match.

Richard Shann <rshann>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rshann (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1