private static void AddBeatWithChordToVoice(Voice voice, SongChord2014 sourceChord, Duration duration)
        {
            var beat = new Beat();
            beat.duration = duration;
            voice.addBeat(beat);
            beat.chordId = sourceChord.ChordId.ToString();
            var chord = beat.chord();

            var chordString = chord == null ? "null" : "not null";
            var sourceChordString = sourceChord.ChordNotes != null ? sourceChord.ChordNotes.Length.ToString() : "null";

            Debug.WriteLine(beat.chordId + " - chord: " + chordString + ", sourceChord.ChordNotes: " + sourceChordString);

            //if (chord != null && sourceChord.ChordNotes.Any())
            //{
            //    DbgAssert(false);
            //}

            //Will be non-null if predefined chord exist (and predefined chord should exist if ChordId is present in ChordTemplates)
            if (chord == null)
            {
                beat.chordId = null;
                //chord = new global::alphatab.model.Chord();
                //voice.bar.track.chords.set(beat.chordId, chord);
                
                //Set notes in beat from this chord
                if (sourceChord.ChordNotes != null)
                {
                    foreach (var sourceNote in sourceChord.ChordNotes)
                    {
                        var note1 = NoteFromNote(sourceNote);
                        beat.addNote(note1);
                    }
                }
            }
            else
            {
                //Set notes in beat from predefined chord
                for (int i = 0; i < chord.strings.length; i++)
                {
                    var tmpstrFret = chord.strings[i];
                    if (tmpstrFret > -1)
                    {
                        var note1 = new Note();
                        note1.fret = tmpstrFret;
                        note1.@string = i + 1;
                        beat.addNote(note1);
                    }
                }          
            }


        }
        private static void AddBeatAndNoteToVoice(Voice voice, SongNote2014 note, Duration duration)
        {
            var beat = new Beat();
            beat.duration = duration;
            voice.addBeat(beat);
            if (note != null)
            {
                var destNote = NoteFromNote(note);
                beat.addNote(destNote);

                if (note.HammerOn == 1 && _prevConvertedNote != null)
                {
                    _prevConvertedNote.isHammerPullOrigin = true;
                    //_prevConvertedNote.slideTarget = destNote;
                    //_prevConvertedNote.slideType = SlideType.Shift;
                    destNote.isHammerPullDestination = true;
                    destNote.isGhost = true;
                    //_prevConvertedNote.hammerPullOrigin = destNote;// _prevConvertedNote;
                    destNote.hammerPullOrigin = _prevConvertedNote;
                }
                _prevConvertedNote = destNote;
            }
        }