Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Wulfheart committed Jun 20, 2020
1 parent 1a0f968 commit f11d961
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 23 deletions.
66 changes: 65 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
![Img](./midi2csv/beethoven_9.png)


# Brahms

Brahms is a command line utility written in Go that quickly generates good-looking visuals of midi-files.

It is inspired by [Off the staff](https://www.c82.net/offthestaff/) by Nicholas Rougeux.

Feel free to open PRs, issues, etc. I'm glad to help.

## Example

Below you can see an example of Beethoven's Symphony Nr. 9:

![Img](./midi2csv/beethoven_9.png)

Generated some other nice visualisation? Share it [here](https://github.com/Wulfheart/brahms/issues/new?assignees=&labels=showcase&template=showcase.md&title=) with the world in the project's showcase.

## Installation

### Prerequisites

Please ensure that you have installed [midicsv](https://www.fourmilab.ch/webtools/midicsv/) and made it available in your ``PATH`` variable so you can call it directly from the command-line.

You can test your midicsv installation by calling ``midicsv -u`` in your console. The expected output has to be similar to this:

```
Usage: Your\Path\Where\It\Is\Midicsv.exe [ options ] [ midi_file ] [ csv_file ]
Options:
-u Print this message
-v Verbose: dump header and track information
Version 1.1 (January 2008)
```

### with go tools

```
go install github.com/Wulfheart/brahms
```

### Windows

1. Download the latest ``.exe`` release [here](https://github.com/Wulfheart/brahms/releases).
2. Add the downloaded executable to your ``PATH`` variable.

## Usage

````
NAME:
brahms - visualize your music
USAGE:
brahms -i path/to/midi [global options]
VERSION:
v0.1.0
GLOBAL OPTIONS:
--in infile, -i infile infile
--out outfile, -o outfile outfile
--colors hex, -c hex case-insensitive comma-separated string of hexcolors, e.g. '#40e0d0,#ff8c00,#ff0080'
--fill-opacity value (default: 0.5)
--help, -h show help (default: false)
--version, -v print the version (default: false)
````


2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module wulfheart/brahms
module github.com/Wulfheart/brahms

go 1.14

Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mingrammer/cfmt v1.1.0 h1:fAALVQC+aa20fCvghuB5W6zBAAsGWKGdcZmexpPrvwo=
github.com/mingrammer/cfmt v1.1.0/go.mod h1:Jqg1Lq43AMo3ggnIEpvIDbca1VSvdHDg0H13eDG+/ys=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
Expand Down
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"bufio"
"bytes"
"fmt"
"github.com/Wulfheart/brahms/score"
"github.com/Wulfheart/brahms/viz"
"github.com/mingrammer/cfmt"
"github.com/urfave/cli/v2"
"os"
"path/filepath"
"strings"
"wulfheart/brahms/score"
"wulfheart/brahms/viz"
)

func main() {
Expand Down Expand Up @@ -76,8 +76,8 @@ func main() {
Hidden: true,
},
&cli.Float64Flag{
Name: "fill-opacity",
Value: 0.5,
Name: "fill-opacity",
Value: 0.5,
// Hidden: true,
},
},
Expand Down Expand Up @@ -140,7 +140,6 @@ func main() {
panic(err)
}


}

func existingFilepath(p string) (path string, err error) {
Expand Down
Binary file modified midi2csv/beethoven_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion score/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package score
import (
"encoding/csv"
"fmt"
"github.com/Wulfheart/brahms/score/midicsv"
"io/ioutil"
"strconv"
"strings"
"wulfheart/brahms/score/midicsv"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion tinker.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package main

import (
"github.com/Wulfheart/brahms/viz"
"image"
"image/draw"
"image/png"
"os"
"wulfheart/brahms/viz"
)

func main() {
Expand Down
13 changes: 0 additions & 13 deletions viz/circles.go

This file was deleted.

2 changes: 1 addition & 1 deletion viz/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package viz

import (
"fmt"
"github.com/Wulfheart/brahms/score"
svg "github.com/ajstarks/svgo"
"github.com/lucasb-eyer/go-colorful"
"io"
"math"
"wulfheart/brahms/score"
)

type CircleConfig struct {
Expand Down

0 comments on commit f11d961

Please sign in to comment.