silentsugar / abc4j

Automatically exported from code.google.com/p/abc4j
1 stars 0 forks source link

Chord Tie and Slurs #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
Being able to tie and slur exisiting chords 

What version of the product are you using? On what operating system?
Windows Vista, abc4j

Please provide any additional information below.

Ive attempted to add slurs and ties to chords which i have already created 
or chords which i have created but not added to the staff.
So far my code is as of follows for a tie but producing no results, as for 
a slur ive tried the methods it has but to no avail! 

        Vector v = new Vector();
        v.addElement(new Note(Note.f));
        v.addElement(new Note(Note.D));
        v.addElement(new Note(Note.C, AccidentalType.SHARP, ONE));

        MultiNote ms = new MultiNote(v);
        MultiNote mn = new MultiNote(v);

        TieDefinition tie = new TieDefinition();
        tie.setStart(ms.getLowestNote());
        tie.setEnd(mn.getLowestNote());
        ms.getLowestNote().setTieDefinition(tie);
        mn.getLowestNote().setTieDefinition(tie);

        music.addElement(ms);
        music.addElement(mn);

Cheers

Original issue reported on code.google.com by look_at_...@hotmail.com on 11 Feb 2009 at 3:56

GoogleCodeExporter commented 9 years ago
Furthermore you answered a question previously about play back and changing the 
colours of the notes as it plays but i think you might have deleted it i cant 
seem 
to find it?

Original comment by look_at_...@hotmail.com on 11 Feb 2009 at 3:58

GoogleCodeExporter commented 9 years ago
Hi,
In your example you share the same notes instances between the two multinotes.
Could you please try to have dedicated Note instances for each MultiNote ?
Notes are not cloned when being given to the multiNote constructor.
Try something like this and tell me :
Vector v = new Vector();
        v.addElement(new Note(Note.f));
        v.addElement(new Note(Note.D));
        v.addElement(new Note(Note.C, AccidentalType.SHARP, ONE));
Vector v2= new Vector();
v2.add...
..
..

        MultiNote ms = new MultiNote(v);
        MultiNote mn = new MultiNote(v2);

Colors of the note are changed using 
http://abc4j.googlecode.com/svn/trunk/docs/api/abc/ui/swing/JScoreComponent.html
#setSelectedItem(abc.notation.MusicElement)
or
http://abc4j.googlecode.com/svn/trunk/docs/api/abc/ui/swing/JScoreComponent.html
#setSelectedItem(abc.ui.swing.JScoreElement)

Cheers

Original comment by lionel.g...@gmail.com on 11 Feb 2009 at 4:12

GoogleCodeExporter commented 9 years ago
Cheers thats brilliant i knew it would be something trivial like that! As for 
chord 
slurs how would you go about that, ive tried a few ways and again it doesnt 
seem to 
be working? 

Original comment by look_at_...@hotmail.com on 11 Feb 2009 at 4:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Strange issue surrounding chord slur definitions       

        MultiNote ms = new MultiNote(v);
        MultiNote mn = new MultiNote(v2);

        SlurDefinition secondSlur = new SlurDefinition();
        secondSlur.setStart(ms);
        secondSlur.setEnd(mn);
        ms.setSlurDefinition(secondSlur);
        mn.setSlurDefinition(secondSlur);

        System.out.println(ms.isBeginingSlur()); //returns true
        System.out.println(mn.isEndingSlur()); //returns true

        Note s  = new Note(Note.A);
        music.addElement(ms);
        music.addElement(new BarLine());
        music.addElement(s);
        music.addElement(mn);

But no slur definition is displayed?? Any ideas?

Original comment by look_at_...@hotmail.com on 5 Mar 2009 at 11:33