func NewNoteMap(indices string, note core.HasValue) (NoteMap, error) {
	idx := []int{}
	var parsed [][]int
	format := formatNumbers
	var maxIndex int
	if strings.ContainsAny(indices, "!.") {
		parsed = parseIndices(convertDotsAndBangs(indices))
		format = formatDotAndBangs
		maxIndex = len(indices)
	} else if strings.ContainsAny(indices, "1234567890 ") {  
		parsed = parseIndices(indices)
	} else {
		return NoteMap{}, errors.New("bad syntax NoteMap; must have digits,spaces OR dots and exclamation marks")
	}
	for _, each := range parsed {
		idx = append(idx, each[0])
	}
	max := sliceMax(idx)
	if max > maxIndex {
		maxIndex = max
	}
	return NoteMap{
		Target:  note,
		Indices: idx,
		indicesFormat: format,
		maxIndex:      maxIndex,
	}, nil
}
NewNoteMap returns a NoteMap that creates a sequence from occurrences of a note.
The format of indices can be one of:
1 2 4 ; each number is an index in the sequence where the note is present; rest notes are placed in the gaps.
! . ! ; each dot is a rest, each exclamation mark is a presence of a note.
package op
import (
	"bytes"
	"errors"
	"fmt"
	"strings"
	"github.com/emicklei/melrose/core"
	"github.com/emicklei/melrose/notify"
)
const (
	formatDotAndBangs = iota
	formatNumbers
)
type NoteMap struct {
	Target        core.HasValue
	Indices       []int
	indicesFormat int
	maxIndex      int
}