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 28 Mar 2017 09:49:05 AM UTC  
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment(Rich Markup)

You are not logged in

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


Mon 14 Aug 2017 08:12:48 AM UTC, comment #2:

Now in the Input->PC Keyboard menu as "Simulate MIDI"

Richard Shann <rshann>
Project Administrator
Tue 28 Mar 2017 04:29:56 PM UTC, 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
(set! SimulateMidi::active #f)
(d-InfoDialog (_ "MIDI simulator end")))
(d-InputFilterNames "Simulated MIDI Filter")
(let loop ()
(define key (d-GetKeypress))
((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"))
(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:

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;
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 28 Mar 2017 09:49:05 AM UTC, 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 Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    Do you think this task is very important?
    If so, you can 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):



    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    Mon 14 Aug 2017 08:12:48 AM UTC rshann StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top

    Powered by Savane 3.3