Re: New partcombineUp and partcombineDown functions (issue 4514042)

2011-09-30 Thread bordage . bertrand

Pushed as bb7cac7b276bd7d1335523f3be8df815cf894ece.

http://codereview.appspot.com/4514042/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: New partcombineUp and partcombineDown functions (issue 4514042)

2011-09-24 Thread pkx166h

passes make and reg tests

http://codereview.appspot.com/4514042/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: New partcombineUp and partcombineDown functions (issue 4514042)

2011-09-01 Thread bordage . bertrand

Reviewers: J_lowe, dan_faithful.be,

Message:
I updated the patch and added a regtest.
Dan, I don't have time for now to rewrite the whole part combiner. Do
you want to do it ? If so, I can help you (at my level).

Bertrand

Description:
New partcombineUp and partcombineDown functions

Fix issue 1321

Please review this at http://codereview.appspot.com/4514042/

Affected files:
  A input/regression/part-combine-3voices.ly
  M lily/part-combine-iterator.cc
  M ly/music-functions-init.ly
  M scm/part-combiner.scm


Index: input/regression/part-combine-3voices.ly
diff --git a/input/regression/part-combine-3voices.ly  
b/input/regression/part-combine-3voices.ly

new file mode 100644
index  
..8dcb00966b4eec2b882b4562d9da3e49d79c96ab

--- /dev/null
+++ b/input/regression/part-combine-3voices.ly
@@ -0,0 +1,18 @@
+\version 2.15.10
+
+\header {
+  texidoc =It is possible to use the part combiner for three
+   voices with \\partcombineUp and \\partcombineDown.
+}
+
+
+soprano = { d''2 f'' g'' }
+alto = { a' c''4 d'' e''2 }
+tenor = { f'2 a'4 b' c''2 }
+basso = { d'4 e' f' g' g'2 }
+
+\new Staff  \partcombineUp \soprano \alto \\ \basso 
+
+\new Staff  \soprano \\ \partcombineDown \tenor \basso 
+
+
Index: lily/part-combine-iterator.cc
diff --git a/lily/part-combine-iterator.cc b/lily/part-combine-iterator.cc
index  
4583d221f646ef9bcdc801dd46c4674366795fb3..9ab0495ae14ce909838c5498e5421d28590fd5bf  
100644

--- a/lily/part-combine-iterator.cc
+++ b/lily/part-combine-iterator.cc
@@ -65,6 +65,11 @@ private:
   Moment start_moment_;

   SCM split_list_;
+  SCM direction_;
+  SCM directionOne_;
+  SCM directionTwo_;
+  SCM horizontalShiftOne_;
+  SCM horizontalShiftTwo_;

   Stream_event *unisono_event_;
   Stream_event *solo_one_event_;
@@ -133,6 +138,11 @@ Part_combine_iterator::Part_combine_iterator ()
   first_iter_ = 0;
   second_iter_ = 0;
   split_list_ = SCM_EOL;
+  direction_ = SCM_BOOL_F;
+  directionOne_ = scm_from_int (1);
+  directionTwo_ = scm_from_int (-1);
+  horizontalShiftOne_ = scm_from_int (0);
+  horizontalShiftTwo_ = scm_from_int (1);
   state_ = APART;
   playing_state_ = APART;
   last_playing_ = APART;
@@ -349,6 +359,17 @@ Part_combine_iterator::construct_children ()
 {
   start_moment_ = get_outlet ()-now_mom ();
   split_list_ = get_music ()-get_property (split-list);
+  direction_ = get_music ()-get_property (direction);
+  if (is_direction (direction_))
+{
+  directionOne_ = direction_;
+  directionTwo_ = direction_;
+  if (scm_is_true (scm_negative_p (direction_)))
+{
+  horizontalShiftOne_ = scm_from_int (1);
+  horizontalShiftTwo_ = scm_from_int (0);
+}
+}

   Context *c = get_outlet ();

@@ -369,6 +390,8 @@ Part_combine_iterator::construct_children ()
   Context *two = handles_[CONTEXT_TWO].get_context ();
   set_context (two);
   second_iter_ = unsmob_iterator (get_iterator (unsmob_music (scm_cadr  
(lst;

+  Context *shared = handles_[CONTEXT_SHARED].get_context ();
+  set_context (shared);

   /* Mimic all settings of voiceOne/voiceTwo for the two separate  
voices...*/

   /* FIXME: Is there any way to use the definition of \voiceOne/\voiceTwo
@@ -391,16 +414,20 @@ Part_combine_iterator::construct_children ()
 {
   SCM sym = ly_symbol2scm (*p);
   execute_pushpop_property (one, sym,
-ly_symbol2scm (direction), scm_from_int  
(1));
+ly_symbol2scm (direction),  
directionOne_);


   execute_pushpop_property (two, sym,
-ly_symbol2scm (direction), scm_from_int  
(-1));
+ly_symbol2scm (direction),  
directionTwo_);

+
+  if (scm_is_number (direction_))
+execute_pushpop_property (shared, sym,
+ ly_symbol2scm (direction), direction_);
 }
   /* Handle horizontal shifts for crossing notes */
   execute_pushpop_property (one, ly_symbol2scm (NoteColumn),
-ly_symbol2scm (horizontal-shift),  
scm_from_int (0));
+ly_symbol2scm (horizontal-shift),  
horizontalShiftOne_);

   execute_pushpop_property (two, ly_symbol2scm (NoteColumn),
-ly_symbol2scm (horizontal-shift),  
scm_from_int (1));
+ly_symbol2scm (horizontal-shift),  
horizontalShiftTwo_);

   /* Also handle MultiMeasureRest positions for voice 1/2 */
   execute_pushpop_property (one, ly_symbol2scm (MultiMeasureRest),
 ly_symbol2scm (staff-position), scm_from_int  
(4));

Index: ly/music-functions-init.ly
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index  
b3a009860753c54d7ab7549617ab4ba6f32d3ae5..1419daa808f7ebf5e65f33cb9116b940d1fdda67  
100644

--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -767,7 +767,21 @@ partcombine =
(_i Take the music in @var{part1} and 

Re: New partcombineUp and partcombineDown functions (issue 4514042)

2011-09-01 Thread Dan Eble
On 2011-09-01, at 17:44 , bordage.bertr...@gmail.com wrote:

 I updated the patch and added a regtest.
 Dan, I don't have time for now to rewrite the whole part combiner. Do
 you want to do it ? If so, I can help you (at my level).

I don't have time either.  If this work is up to current standards, I'm not 
going to complain.  I just wanted to make known what was tried in the past.
-- 
Dan


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


New partcombineUp and partcombineDown functions (issue 4514042)

2011-08-27 Thread pkx166h

When I try to patch to current tree (27 Aug) I get

--snip--
patching file lily/part-combine-iterator.cc
Hunk #2 succeeded at 138 with fuzz 1.
Hunk #4 FAILED at 390.
Hunk #5 FAILED at 412.
2 out of 5 hunks FAILED -- saving rejects to file
lily/part-combine-iterator.cc.rej
patching file ly/music-functions-init.ly
Hunk #1 succeeded at 762 (offset 29 lines).
patching file scm/part-combiner.scm
jlowe@jlowe-lilybuntu2:~/lilypond-git$

--snip--

Make succeeds though, and reg tests pass too.

So I have set this patch to 'review' as I don't know the significance of
these patch messages.

http://codereview.appspot.com/4514042/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: New partcombineUp and partcombineDown functions (issue 4514042)

2011-08-27 Thread Dan Eble

On 2011-08-27, at 04:04 , pkx1...@gmail.com wrote:

 When I try to patch to current tree (27 Aug) I get
 
 --snip--
 --snip--
 
 Make succeeds though, and reg tests pass too.
 
 So I have set this patch to 'review' as I don't know the significance of
 these patch messages.
 
 http://codereview.appspot.com/4514042/

Should there be a few new regression tests added along with this change that 
cover the new \partcombineUp and \partcombineDown?

Also, this patch just seems to set some context properties in a round-about 
way.  Isn't it already possible to do that with something like...

  \context Staff = staffA
  
\partcombine \aNotes \bNotes
\context Voice = one % part combiner output
{
  \override ...
}
  

... as shown in the following patch submission from 2008, which was turned away 
for not being flexible enough, even though it seems more flexible than the 
patch under review?  (Flexible from the standpoint that there are more distinct 
output contexts that can be tweaked than in the current part combiner.)

http://lists.gnu.org/archive/html/lilypond-devel/2008-09/msg00079.html
-- 
Dan


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel