removeNote
Hello,
I'd like to remove some note from a partition with a plugin.
I made all the note i don't want invisible, but when i export in musicxml format or midi format they are still here;
chord.removeNote(i) don't do anything.
Can someone point me in the right direction or post a solution ?
regards,
Comments
chord.removeNote works fine for me - I assume you are talking about 1.3? But you need to realize, it isn't meant for removing *chords*, but rather removing *individual notes from within chords*. That is, if you start with a chord of several notes, and do removeNote on one of those notes, it will remove that note from the chord, leaving the others intact. I am not sure there is a way to remove the entire chord, so one a chord of only one note, I wouldn't be surprised if removeNote was disabled.
It might helkp if you explained more what you are trying to do - why your score has all these invisible notes that you want removed - and perhaps someone can suggest an alternate solution.
In reply to chord.removeNote works fine by Marc Sabatella
thank you for the help. I wrote a program that work for marking all the notes invisible.
I wrote this to no avail :
function run()
{
if (typeof curScore === 'undefined')
return;
var cursor = new Cursor(curScore);
for (var staff = 0; staff < curScore.staves; ++staff) {
cursor.staff = staff;
for (var v = 0; v < 4; v++) {
cursor.voice = v;
cursor.rewind(); // set cursor to first chord/rest
while (!cursor.eos()) {
if (cursor.isChord()) {
var chord = cursor.chord();
var n = chord.notes;
for (var i = 0; i < n-1; i++)
if (chord.note(i).visible == false) {
chord.removeNote(i);
}
}
cursor.next();
}
}
}
}
Some notes should be wiped out. nothing happens.
regards,
In reply to chord.removeNote works fine by Marc Sabatella
Re-reading your post, i realised that i have to remove the chord and replace it with one -or towo - rests and one or more note between rest.
I still don't know how to do it but i thank you for enlighting me.
In reply to chord.removeNote works fine by Marc Sabatella
Why would you want to remove invisible notes in the first place?
In reply to Why would you want to remove by Jojo-Schmitz
I want to have a midi file without them playing or a music sheet.
In reply to I want to have a midi file by jrp.nop
Mark them silent or just delete them, or don't enter them in the first place?
There must be more to it, there got to be a reason why you are having this 'excess' notes, but so far I have no idea why, can you share the score and describe what you want to achieve?
In reply to Mark them silent or just by Jojo-Schmitz
Thank you M. Sabatella for pointing me in the rigt direction.
Everything is working now.
regards.