Index: cpp/tests/multiline_f0_test-fS.goal
===================================================================
--- cpp/tests/multiline_f0_test-fS.goal	(revision 1009)
+++ cpp/tests/multiline_f0_test-fS.goal	(revision 1033)
@@ -1,41 +1,35 @@
 
-Source genotype: '1.1:ssC[S;S;S]{ry=-0.214;ty=0.781}fSC[S;S;*;M'4:-5.154;M'0]fE[M;Gpart]{rx=0.603;ry=-0.9391;rz=0.3034;tx=0.6534;ty=0.6856;tz=-0.166;x=1;z=1}ttC[*;*;Gpart]{st=0.262}fTE{rx=0.603;ry=-0.9391;rz=0.3034;tx=0.6534;ty=0.6856;tz=-0.166;x=1;y=1;z=1}ftC[*;*;N'0'2'3'9'12'14]{ry=-0.199;y=0.828;z=0.806}'
+Source genotype: '1.1,0,0.4:C[Gpart]{x=0.806,y=0.806,z=2.295}(C[N;M:p=0.899]{x=0.806,z=0.806}(E{rx=1.3416,ry=-1.3967,rz=1.1368,tx=-0.7694,ty=1.0496,tz=-0.1275,x=1,y=1,z=1},bIE[N,1]{rx=-1.277,ry=-1.087,rz=-0.9208,tx=1.189,ty=1.1182,tz=-0.1494,x=1,y=1,z=1}E{rx=0.4085,ry=1.0807,rz=0.5977,tx=0.4698,ty=0.3333,tz=1.4408,x=1,y=1,z=1}E{rx=-0.9279,ry=-0.2806,rz=-0.7292,tx=1.1498,ty=-0.6195,tz=0.0121,x=1,y=1,z=1}),biR[N]{ry=0.271,x=1.0144,y=0.903,z=0.903}(R{rx=0.3229,ry=-0.3828,rz=1.5117,tx=0.7618,ty=1.3803,tz=1.354,x=0.8736,y=0.8736,z=0.8736},E{rx=1.3416,ry=-1.3967,rz=1.1368,tx=-0.7694,ty=1.0496,tz=-0.1275,x=1,y=1,z=1}),iC{rx=-0.9744,ry=-1.5695,rz=1.1659,tx=-0.9065,ty=-1.2759,tz=-0.0857,x=1.273,y=0.133,z=1.509},R{rx=0.3229,ry=-0.3828,rz=1.5117,tx=0.7618,ty=1.3803,tz=1.354,x=0.8736,y=0.8736,z=0.8736},iE{rx=1.3416,ry=-1.3967,rz=1.1368,tx=-0.7694,ty=1.0496,tz=-0.1275,x=1,y=1,z=1})'
                   ( format S )
 Converted to f0:
-p:sh=2, sx=0.8264462809917354, sy=0.8264462809917354, sz=0.8264462809917354, ry=-0.214
-p:1.84400826446281, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.36363636363636365
-p:3.4488812833580815, -0.26888325253375556, 1.3310278019498911, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942, rx=0.603, -0.9391, 0.3034
-p:5.053754302253353, -0.5377665050675111, 2.6620556038997822, sh=2, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3305785123966942
-p:5.552059067218389, -1.6581236294201593, 4.369698100138417, sh=1, sx=0.9090909090909091, sy=0.9090909090909091, sz=0.9090909090909091, fr=0.3005259203606311, rx=0.603, -0.9391, 0.3034
-p:5.983025350431394, -2.6270811423738007, 5.846578096885344, sh=2, sx=0.9090909090909091, sy=0.7527272727272727, sz=0.7327272727272728, fr=0.27320538214602824, ry=-0.199
+p:sh=2, sx=0.806, sy=0.806, sz=2.295
+p:1.6610658177212956, sh=2, sx=0.806, sz=0.806
+p:2.669522581015868, -0.12927953115999094, 1.770803754024758, sh=1, rx=1.3416, -1.3967, 1.1368
+p:2.5149067817465802, -0.12852148117052686, 1.7757109168238943, sh=1, ing=0.275, rx=-1.277, -1.087, -0.9208
+p:3.491120795397971, 0.0627093264475479, 3.542562176271334, sh=1, rx=0.4085, 1.0807, 0.5977
+p:4.82498021179015, -1.4556859677056804, 3.7057221690326423, sh=1, rx=-0.9279, -0.2806, -0.7292
+p:2.044122892122303, sh=3, sx=1.0144, sy=0.903, sz=0.903, ing=0.22727272727272727, ry=0.271
+p:2.1225041839451873, 0.3558613626799459, 1.8896569415253044, sh=3, sx=0.8736, sy=0.8736, sz=0.8736, rx=0.3229, -0.3828, 1.5117
+p:3.2159989925040344, -0.15022914055334208, 2.057760603467444, sh=1, rx=1.3416, -1.3967, 1.1368
+p:1.0846131653683386, -0.09317957887309433, -3.5838606901740344, sh=2, sx=1.273, sy=0.133, sz=1.509, ing=0.22727272727272727, rx=-0.9744, -1.5695, 1.1659
+p:0.1364642552368182, 0.619565647570761, 3.289951226640109, sh=3, sx=0.8736, sy=0.8736, sz=0.8736, rx=0.3229, -0.3828, 1.5117
+p:1.6422082610960242, -0.21052356609516198, 2.883642273506047, sh=1, ing=0.22727272727272727, rx=1.3416, -1.3967, 1.1368
 j:0, 1, sh=1
 j:1, 2, sh=1
-j:2, 3, sh=1, stif=0.2165289256198347, rotstif=0.2165289256198347
-j:3, 4, sh=1, stif=0.9090909090909091, rotstif=0.9090909090909091
-j:4, 5, sh=1, stif=0.8264462809917354, rotstif=0.8264462809917354
-n:p=0, d=S
-n:p=0, d=S
-n:p=0, d=S
-n:p=1, d=S
-n:p=1, d=S
-n:p=1, d=*
-n:j=0, d=M
-n:j=0, d=M
-n:j=1, d=M
-n:p=2, d=Gpart
-n:p=3, d=*
-n:p=3, d=*
-n:p=3, d=Gpart
-n:p=5, d=*
-n:p=5, d=*
-n:p=5
-c:6, 4, -5.154
-c:7, 0
-c:15, 0
-c:15, 2
-c:15, 3
-c:15, 9
-c:15, 12
-c:15, 14
+j:1, 3, sh=2
+j:3, 4, sh=1
+j:4, 5, sh=1
+j:0, 6, sh=2
+j:6, 7, sh=1
+j:6, 8, sh=1
+j:0, 9, sh=1
+j:0, 10, sh=1
+j:0, 11, sh=1
+n:p=0, d=Gpart
+n:p=1
+n:j=0, d=M:p=0.899
+n:p=3
+n:p=6
+c:3, 1
 
 
@@ -53,7 +47,7 @@
 sh:2
 s:1.0
-sx:0.8264462809917354
-sy:0.8264462809917354
-sz:0.8264462809917354
+sx:0.806
+sy:0.806
+sz:2.295
 h:0.0
 dn:1.0
@@ -62,5 +56,5 @@
 as:0.25
 rx:0.0
-ry:-0.214
+ry:0.0
 rz:0.0
 i:
@@ -72,15 +66,15 @@
 
 p:
-x:1.84400826446281
+x:1.6610658177212956
 y:0.0
 z:0.0
 sh:2
 s:1.0
-sx:0.9090909090909091
-sy:0.9090909090909091
-sz:0.9090909090909091
-h:0.0
-dn:1.0
-fr:0.36363636363636365
+sx:0.806
+sy:1.0
+sz:0.806
+h:0.0
+dn:1.0
+fr:0.4
 ing:0.25
 as:0.25
@@ -96,92 +90,236 @@
 
 p:
-x:3.4488812833580815
-y:-0.26888325253375556
-z:1.3310278019498911
-sh:1
-s:1.0
-sx:0.9090909090909091
-sy:0.9090909090909091
-sz:0.9090909090909091
-h:0.0
-dn:1.0
-fr:0.3305785123966942
-ing:0.25
-as:0.25
-rx:0.603
-ry:-0.9391
-rz:0.3034
-i:
-Vstyle:part
-vs:0.2
-vr:1.0
-vg:1.0
-vb:1.0
-
-p:
-x:5.053754302253353
-y:-0.5377665050675111
-z:2.6620556038997822
+x:2.669522581015868
+y:-0.12927953115999094
+z:1.770803754024758
+sh:1
+s:1.0
+sx:1.0
+sy:1.0
+sz:1.0
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.25
+as:0.25
+rx:1.3416
+ry:-1.3967
+rz:1.1368
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:2.5149067817465802
+y:-0.12852148117052686
+z:1.7757109168238943
+sh:1
+s:1.0
+sx:1.0
+sy:1.0
+sz:1.0
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.275
+as:0.25
+rx:-1.277
+ry:-1.087
+rz:-0.9208
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:3.491120795397971
+y:0.0627093264475479
+z:3.542562176271334
+sh:1
+s:1.0
+sx:1.0
+sy:1.0
+sz:1.0
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.25
+as:0.25
+rx:0.4085
+ry:1.0807
+rz:0.5977
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:4.82498021179015
+y:-1.4556859677056804
+z:3.7057221690326423
+sh:1
+s:1.0
+sx:1.0
+sy:1.0
+sz:1.0
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.25
+as:0.25
+rx:-0.9279
+ry:-0.2806
+rz:-0.7292
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:2.044122892122303
+y:0.0
+z:0.0
+sh:3
+s:1.0
+sx:1.0144
+sy:0.903
+sz:0.903
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.22727272727272727
+as:0.25
+rx:0.0
+ry:0.271
+rz:0.0
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:2.1225041839451873
+y:0.3558613626799459
+z:1.8896569415253044
+sh:3
+s:1.0
+sx:0.8736
+sy:0.8736
+sz:0.8736
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.25
+as:0.25
+rx:0.3229
+ry:-0.3828
+rz:1.5117
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:3.2159989925040344
+y:-0.15022914055334208
+z:2.057760603467444
+sh:1
+s:1.0
+sx:1.0
+sy:1.0
+sz:1.0
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.25
+as:0.25
+rx:1.3416
+ry:-1.3967
+rz:1.1368
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:1.0846131653683386
+y:-0.09317957887309433
+z:-3.5838606901740344
 sh:2
 s:1.0
-sx:0.9090909090909091
-sy:0.9090909090909091
-sz:0.9090909090909091
-h:0.0
-dn:1.0
-fr:0.3305785123966942
-ing:0.25
-as:0.25
-rx:0.0
-ry:0.0
-rz:0.0
-i:
-Vstyle:part
-vs:0.2
-vr:1.0
-vg:1.0
-vb:1.0
-
-p:
-x:5.552059067218389
-y:-1.6581236294201593
-z:4.369698100138417
-sh:1
-s:1.0
-sx:0.9090909090909091
-sy:0.9090909090909091
-sz:0.9090909090909091
-h:0.0
-dn:1.0
-fr:0.3005259203606311
-ing:0.25
-as:0.25
-rx:0.603
-ry:-0.9391
-rz:0.3034
-i:
-Vstyle:part
-vs:0.2
-vr:1.0
-vg:1.0
-vb:1.0
-
-p:
-x:5.983025350431394
-y:-2.6270811423738007
-z:5.846578096885344
-sh:2
-s:1.0
-sx:0.9090909090909091
-sy:0.7527272727272727
-sz:0.7327272727272728
-h:0.0
-dn:1.0
-fr:0.27320538214602824
-ing:0.25
-as:0.25
-rx:0.0
-ry:-0.199
-rz:0.0
+sx:1.273
+sy:0.133
+sz:1.509
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.22727272727272727
+as:0.25
+rx:-0.9744
+ry:-1.5695
+rz:1.1659
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:0.1364642552368182
+y:0.619565647570761
+z:3.289951226640109
+sh:3
+s:1.0
+sx:0.8736
+sy:0.8736
+sz:0.8736
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.25
+as:0.25
+rx:0.3229
+ry:-0.3828
+rz:1.5117
+i:
+Vstyle:part
+vs:0.2
+vr:1.0
+vg:1.0
+vb:1.0
+
+p:
+x:1.6422082610960242
+y:-0.21052356609516198
+z:2.883642273506047
+sh:1
+s:1.0
+sx:1.0
+sy:1.0
+sz:1.0
+h:0.0
+dn:1.0
+fr:0.4
+ing:0.22727272727272727
+as:0.25
+rx:1.3416
+ry:-1.3967
+rz:1.1368
 i:
 Vstyle:part
@@ -238,19 +376,19 @@
 
 j:
-p1:2
+p1:1
 p2:3
-sh:1
-hx:0.0
-hy:0.0
-hz:0.0
-hrx:0.0
-hry:0.0
-hrz:0.0
-hxn:-1.5708
-hxp:1.5708
-hyn:-1.5708
-hyp:1.5708
-stif:0.2165289256198347
-rotstif:0.2165289256198347
+sh:2
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
 stam:0.25
 i:
@@ -274,6 +412,6 @@
 hyn:-1.5708
 hyp:1.5708
-stif:0.9090909090909091
-rotstif:0.9090909090909091
+stif:1.0
+rotstif:1.0
 stam:0.25
 i:
@@ -297,6 +435,144 @@
 hyn:-1.5708
 hyp:1.5708
-stif:0.8264462809917354
-rotstif:0.8264462809917354
+stif:1.0
+rotstif:1.0
+stam:0.25
+i:
+Vstyle:joint
+vr:1.0
+vg:1.0
+vb:1.0
+
+j:
+p1:0
+p2:6
+sh:2
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
+stam:0.25
+i:
+Vstyle:joint
+vr:1.0
+vg:1.0
+vb:1.0
+
+j:
+p1:6
+p2:7
+sh:1
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
+stam:0.25
+i:
+Vstyle:joint
+vr:1.0
+vg:1.0
+vb:1.0
+
+j:
+p1:6
+p2:8
+sh:1
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
+stam:0.25
+i:
+Vstyle:joint
+vr:1.0
+vg:1.0
+vb:1.0
+
+j:
+p1:0
+p2:9
+sh:1
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
+stam:0.25
+i:
+Vstyle:joint
+vr:1.0
+vg:1.0
+vb:1.0
+
+j:
+p1:0
+p2:10
+sh:1
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
+stam:0.25
+i:
+Vstyle:joint
+vr:1.0
+vg:1.0
+vb:1.0
+
+j:
+p1:0
+p2:11
+sh:1
+hx:0.0
+hy:0.0
+hz:0.0
+hrx:0.0
+hry:0.0
+hrz:0.0
+hxn:-1.5708
+hxp:1.5708
+hyn:-1.5708
+hyp:1.5708
+stif:1.0
+rotstif:1.0
 stam:0.25
 i:
@@ -309,19 +585,5 @@
 p:0
 j:-1
-d:S
-i:
-Vstyle:neuro
-
-n:
-p:0
-j:-1
-d:S
-i:
-Vstyle:neuro
-
-n:
-p:0
-j:-1
-d:S
+d:Gpart
 i:
 Vstyle:neuro
@@ -330,19 +592,5 @@
 p:1
 j:-1
-d:S
-i:
-Vstyle:neuro
-
-n:
-p:1
-j:-1
-d:S
-i:
-Vstyle:neuro
-
-n:
-p:1
-j:-1
-d:*
+d:N
 i:
 Vstyle:neuro
@@ -351,26 +599,5 @@
 p:-1
 j:0
-d:M
-i:
-Vstyle:neuro
-
-n:
-p:-1
-j:0
-d:M
-i:
-Vstyle:neuro
-
-n:
-p:-1
-j:1
-d:M
-i:
-Vstyle:neuro
-
-n:
-p:2
-j:-1
-d:Gpart
+d:M:p=0.899
 i:
 Vstyle:neuro
@@ -379,38 +606,10 @@
 p:3
 j:-1
-d:*
+d:N
 i:
 Vstyle:neuro
 
 n:
-p:3
-j:-1
-d:*
-i:
-Vstyle:neuro
-
-n:
-p:3
-j:-1
-d:Gpart
-i:
-Vstyle:neuro
-
-n:
-p:5
-j:-1
-d:*
-i:
-Vstyle:neuro
-
-n:
-p:5
-j:-1
-d:*
-i:
-Vstyle:neuro
-
-n:
-p:5
+p:6
 j:-1
 d:N
@@ -419,51 +618,9 @@
 
 c:
-n1:6
-n2:4
-w:-5.154
-i:
-
-c:
-n1:7
-n2:0
+n1:3
+n2:1
 w:1.0
 i:
 
-c:
-n1:15
-n2:0
-w:1.0
-i:
-
-c:
-n1:15
-n2:2
-w:1.0
-i:
-
-c:
-n1:15
-n2:3
-w:1.0
-i:
-
-c:
-n1:15
-n2:9
-w:1.0
-i:
-
-c:
-n1:15
-n2:12
-w:1.0
-i:
-
-c:
-n1:15
-n2:14
-w:1.0
-i:
-
-
-
+
+
