chordToNote.. but generating specific voicings
Thinking about modifying chordToNote for my own use.
I haven't written a plugin before, so just a curious where the best documentation of the API lives and which plugins might offer the best examples of:
- Modifying the frequency of a note (for example, moving a note up or down an octave).
- Changing the Clef, in a Grand Staff, that a note is on (Taking a Chord from the Treble clef to Bass)
Comments
Figured out number one.. still trying to figure out "2"
It is "sort of" listed as a todo in the original (chordToNote) source -> //todo create in new staff though I think the intention is probably to create the entire chord in a separate staff . But I'm hoping there is a way to uniquely identify bass vs treble in a grand staff.
In reply to Figured out number one… by akinsgre
Each staff has 4 tracks (one for each voice); so for a grand staff instrument, you can reach the same voice in the 2nd staff by increasing the track by 4.
In reply to Each staff has 4 tracks (one… by jeetee
Thanks.. I think I understand what you're saying.
So if I have a single staff (perhaps a voice) and a second grand staff above it, will I have 3 staves total, with tracks 1 - 12 so that staff:voice matching will be like I have shown below?
Staff Track Voice
1 1 1
1 2 2
1 3 3
1 4 4
2 5 1
2 6 2
2 7 3
2 8 4
3 9 1
3 10 2
3 11 3
3 12 4
In reply to Thanks.. I think I… by akinsgre
Below are the results of adding notes with Voice 3 & voice 4 respectively. Why it's changing staff after the first measure, when the voice equal to 4, I have no idea.
In reply to Below are the results of… by akinsgre
Voice 4 is the first voice of the second staff. Everything is 0-based. So, the first staff is staff 0, voices 0-3; the next staff is staff 1, voices 4-7, etc.
In reply to Voice 4 is the first voice… by Marc Sabatella
Right. So in the first image, I set cursor.voice=3, and the voice appears as voice $ on the Trumpet Staff.
However, when I set cursor.voice=4, the first measure gets a note in the first voice of the Treble clef of the grand staff (which is what I expect). But the 2nd, 3rd, and 4th measure get notes in the first voice of the Bass clef of the grand staff.
So I don't understand why, when cursor is = 4, that all the notes I create aren't in the Treble clef.
In reply to Right. So in the first… by akinsgre
Hard to say without seeing the code, but it sure looks you are incrementing the track number in each measure. Notice the first measure shows the note being added in track 4 (first voice of second staff) but the next measure actually shows it being added in track 5 (second voice of second staff). I can see this because of the rest that appears for the first voice. I'm guessing the next measure is actually track 6, and the next track 7.