michael-smith

command
v0.0.0-...-e04bdec Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2015 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Go Challenge 1

A solution to Go Challenge 1

Michael Smith https://github.com/msmith

Running the tests

$ go test drum
ok  	drum	0.004s

Running the benchmarks

$ go test -bench=. -benchmem drum
PASS
Benchmark1	  200000	      6936 ns/op	     856 B/op	      41 allocs/op
Benchmark2	  300000	      5256 ns/op	     648 B/op	      32 allocs/op
Benchmark3	  200000	      6972 ns/op	     856 B/op	      41 allocs/op
Benchmark4	  300000	      5249 ns/op	     648 B/op	      32 allocs/op
Benchmark5	  500000	      4137 ns/op	     472 B/op	      23 allocs/op
ok  	drum	8.305s

Building & running the decoder

$ go build decode.go
$ ./decode src/drum/fixtures/*.splice
src/drum/fixtures/pattern_1.splice:

Saved with HW Version: 0.808-alpha
Tempo: 120
(0) kick        |x---|x---|x---|x---|
(1) snare       |----|x---|----|x---|
(2) clap        |----|x-x-|----|----|
(3) hh-open     |--x-|--x-|x-x-|--x-|
(4) hh-close    |x---|x---|----|x--x|
(5) cowbell     |----|----|--x-|----|


src/drum/fixtures/pattern_2.splice:

Saved with HW Version: 0.808-alpha
Tempo: 98.4
(0) kick        |x---|----|x---|----|
(1) snare       |----|x---|----|x---|
(3) hh-open     |--x-|--x-|x-x-|--x-|
(5) cowbell     |----|----|x---|----|


src/drum/fixtures/pattern_3.splice:

Saved with HW Version: 0.808-alpha
Tempo: 118
(40) kick       |x---|----|x---|----|
(1) clap        |----|x---|----|x---|
(3) hh-open     |--x-|--x-|x-x-|--x-|
(5) low-tom     |----|---x|----|----|
(12) mid-tom    |----|----|x---|----|
(9) hi-tom      |----|----|-x--|----|


src/drum/fixtures/pattern_4.splice:

Saved with HW Version: 0.909
Tempo: 240
(0) SubKick     |----|----|----|----|
(1) Kick        |x---|----|x---|----|
(99) Maracas    |x-x-|x-x-|x-x-|x-x-|
(255) Low Conga |----|x---|----|x---|


src/drum/fixtures/pattern_5.splice:

Saved with HW Version: 0.708-alpha
Tempo: 999
(1) Kick        |x---|----|x---|----|
(2) HiHat       |x-x-|x-x-|x-x-|x-x-|

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL