Пример #1
0
func messM(d *encore.Data) {
	raw := make([]byte, len(d.Raw))
	copy(raw, d.Raw)

	encore.ReadData(raw)

	err := ioutil.WriteFile("mess.enc", raw, 0644)
	if err != nil {
		log.Fatalf("WriteFile:", err)
	}

}
Пример #2
0
func main() {
	debug := flag.Bool("debug", false, "debug")
	flag.Parse()
	content, err := ioutil.ReadFile(flag.Arg(0))
	if err != nil {
		log.Fatal("ReadFile", err)
	}

	d, err := encore.ReadData(content)
	if err != nil {
		log.Fatalf("readData %v", err)
	}

	if *debug {
		analyze(d)
	} else {
		Convert(d)
	}
}
Пример #3
0
func mess(d *encore.Data) {
	fmt.Printf("mess\n")
	for i := 0; i < 13; i++ {
		raw := make([]byte, len(d.Raw))
		copy(raw, d.Raw)

		for _, m := range d.Measures[5:6] {
			for _, e := range m.Elems {
				if e.GetStaff() == 6 {
					raw[e.GetOffset()+5+i] += 3
				}
			}
		}

		encore.ReadData(raw)
		fmt.Printf("messed\n")

		err := ioutil.WriteFile(fmt.Sprintf("mess%d.enc", i), raw, 0644)
		if err != nil {
			log.Fatalf("WriteFile:", err)
		}
	}
}