Hi!

I'd like to propose functions for the plugin API for creating and deleting 
notes:

Current state:

Cursor.addNote(pitch) actually replaces whatever is at the current cursor 
position with a note of the duration, that the user selected via the GUI (keys 
1-9). This seems to be of limited use.

There seems to be no way for a plugin to create a note or rest of a given 
duration.

Proposal:

Note* Cursor.addNote(pitch)
this should only add a note to a chord already present.
Since there seems to be no sensible default value for the duration, I wouldn't 
offer a function, that creates a new note without explicitly setting its 
duration.

Note* Cursor.setNote(pitch, Duration_denominator)
Note* Cursor.setNote(pitch, Duration_nominator, Duration_denominator)
this should replace whatever is at the current cursor position with a note of 
given pitch and duration.

Rest* Cursor.setRest(pitch, Duration_denominator)
Rest* Cursor.setRest(pitch, Duration_nominator, Duration_denominator)
this should replace whatever is at the current cursor position with a rest of 
given duration.

About duration:
I first thought about using just one parameter 'duration' using the same 
numbers as in the GUI (e.g. 5 = quarter). But then we'd still need a third 
parameter to allow for dotted notes, and to copy a note with a given duration 
would be harder to implement. If Duration_nominator is not given it's 
considered to be 1 of course.

Tuplets:
I do not (yet) know how tuplets are created and thus have not included them in 
the current proposal. Maybe something like Cursor.createTuplet(…) could be 
added to do this.


About implementing:

I thought of implementing Cursor.addNote(pitch, Duration.nom, Duration.denom) 
and Cursor.addRest(Duration.nom, Duration.denom) using calls to 
Score::setNoteRest(). I don't know if this would also work for creating 
tuplets. 

For Cursor.addNote(pitch):
I'd try if (besides checking if we've got a valid Chord already) changing the 
second parameter Score::addPitch(NoteVal,bool) from false to true would already 
does the job.


heuchi




------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to