@@ -13,7 +13,7 @@ import Bar from '../models/bar';
1313import Part from '../models/part' ;
1414import Tune from '../models/tune' ;
1515
16- import { getKeys , getVexDuration , addDecorations , getTabPosition , generateBeamsCompound } from '../utils' ;
16+ import { getKeys , getVexDuration , addDecorations , getTabPosition , generateBeamsCompound , getCurves } from '../utils' ;
1717import { VEX_ACCIDENTAL_FROM_ABCJS } from '../constants' ;
1818
1919/**
@@ -120,6 +120,8 @@ export default function generateVexObjects(partRegions, tuneAttrs, renderOptions
120120 if ( accidental ) { noteToAdd . addAccidental ( i , new Vex . Flow . Accidental ( accidental ) ) ; }
121121 } ) ;
122122
123+ currentPart . curves = getCurves ( currentPart . curves , obj , noteToAdd ) ;
124+
123125 // this is mostly duplicated with below. maybe can be put in a separate function
124126 if ( obj . gracenotes ) {
125127 const graceNotesArray = [ ] ;
@@ -162,65 +164,6 @@ export default function generateVexObjects(partRegions, tuneAttrs, renderOptions
162164 const tabGraceNoteGroup = new GraceNoteGroup ( tabGraceNotesArray , false ) ;
163165 tabNoteToAdd . addModifier ( tabGraceNoteGroup ) ;
164166 }
165-
166- if ( obj . startSlur ) {
167- obj . startSlur . forEach ( ( ) => {
168- currentPart . curves . push ( {
169- startNote : noteToAdd
170- } ) ;
171- } ) ;
172- }
173- if ( obj . endSlur ) {
174- obj . endSlur . forEach ( ( ) => {
175- let i = currentPart . curves . length - 1 ;
176- while ( i >= 0 ) {
177- if ( ! currentPart . curves [ i ] . endNote ) {
178- currentPart . curves [ i ] . endNote = noteToAdd ;
179- break ;
180- }
181- i -= 1 ;
182- }
183- } ) ;
184- }
185-
186- obj . pitches . forEach ( ( pitch ) => {
187- if ( pitch . startTie ) {
188- currentPart . curves . push ( {
189- startNote : noteToAdd
190- } ) ;
191- }
192- if ( pitch . endTie ) {
193- currentPart . curves [ currentPart . curves . length - 1 ] . endNote = noteToAdd ;
194- let i = currentPart . curves . length - 1 ;
195- while ( i >= 0 ) {
196- if ( ! currentPart . curves [ i ] . endNote ) {
197- currentPart . curves [ i ] . endNote = noteToAdd ;
198- break ;
199- }
200- i -= 1 ;
201- }
202- }
203- if ( pitch . startSlur ) {
204- pitch . startSlur . forEach ( ( ) => {
205- currentPart . curves . push ( {
206- startNote : noteToAdd
207- } ) ;
208- } ) ;
209- }
210- if ( pitch . endSlur ) {
211- pitch . endSlur . forEach ( ( ) => {
212- let i = currentPart . curves . length - 1 ;
213- while ( i >= 0 ) {
214- if ( ! currentPart . curves [ i ] . endNote ) {
215- currentPart . curves [ i ] . endNote = noteToAdd ;
216- break ;
217- }
218- i -= 1 ;
219- }
220- } ) ;
221- }
222- } ) ;
223-
224167 currentBar . tabNotes . push ( tabNoteToAdd ) ;
225168 } else { // IS a rest
226169 noteToAdd = new StaveNote ( {
0 commit comments