internal static SongChord2014[] Parse(Sng2014HSL.Sng sngData, Sng2014HSL.NotesSection notesSection) { var chords = new List <SongChord2014>(); for (var i = 0; i < notesSection.Count; i++) { if (notesSection.Notes[i].ChordId == -1) { continue; //Skip single notes (get only chord notes) } var chord = new SongChord2014(); chord.ChordId = notesSection.Notes[i].ChordId; chord.Time = notesSection.Notes[i].Time; // Debug.WriteLine("Song2014 chord.ChordId = " + chord.ChordId); // TECHNIQUES chord.parseChordMask(notesSection.Notes[i], notesSection.Notes[i].NoteMask); // CHORD NOTES (WITHOUT TECHNIQUES) + NOT HIGH DENSITY if (chord.HighDensity != 1) { chord.ParseChordNotes(sngData.Chords.Chords[chord.ChordId]); } // CHORD NOTES (WITH TECHNIQUES) var cnId = notesSection.Notes[i].ChordNotesId; if (cnId != -1) { if (sngData.ChordNotes.ChordNotes.Length > cnId) { chord.ParseChordNotes(sngData.Chords.Chords[chord.ChordId], sngData.ChordNotes.ChordNotes[cnId]); } } chords.Add(chord); } return(chords.ToArray()); }
internal static SongNote2014[] Parse(Sng2014HSL.NotesSection notesSection) { var notes = new List <SongNote2014>(); for (var i = 0; i < notesSection.Count; i++) { if (notesSection.Notes[i].ChordId != -1) { continue; //Skip chord notes (get only single notes) } var note = new SongNote2014(); // BASIC INFO note.Time = notesSection.Notes[i].Time; note.Fret = (sbyte)notesSection.Notes[i].FretId; note.String = notesSection.Notes[i].StringIndex; // TECHNIQUES note.PickDirection = notesSection.Notes[i].PickDirection; note.parseNoteMask(notesSection.Notes[i].NoteMask); //NOTE MASK need to be setup previous get property values // Techniques with own properties if (notesSection.Notes[i].LeftHand != 255) { note.LeftHand = (sbyte)notesSection.Notes[i].LeftHand; } if (notesSection.Notes[i].SlideTo != 255) { note.SlideTo = (sbyte)notesSection.Notes[i].SlideTo; } if (notesSection.Notes[i].SlideUnpitchTo != 255) { note.SlideUnpitchTo = (sbyte)notesSection.Notes[i].SlideUnpitchTo; } if (notesSection.Notes[i].Tap != 255) { note.Tap = notesSection.Notes[i].Tap; } if (notesSection.Notes[i].Slap != 255) { note.Slap = (sbyte)notesSection.Notes[i].Slap; } if (notesSection.Notes[i].Pluck != 255) { note.Pluck = (sbyte)notesSection.Notes[i].Pluck; } if (notesSection.Notes[i].Vibrato != 0) { note.Vibrato = notesSection.Notes[i].Vibrato; } if (notesSection.Notes[i].Sustain != 0) { note.Sustain = notesSection.Notes[i].Sustain; } if (notesSection.Notes[i].MaxBend != 0) { note.Bend = notesSection.Notes[i].MaxBend; } note.BendValues = BendValue.Parse(notesSection.Notes[i].BendData.BendData); notes.Add(note); } return(notes.ToArray()); }