Skip to content

Commit

Permalink
Readme and cleanupo
Browse files Browse the repository at this point in the history
  • Loading branch information
ncirocco committed Aug 20, 2020
1 parent b64cd0b commit 18e02bf
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
# Dependency directories (remove the comment below to include it)
# vendor/
samples/
/build/*
!/build/.gitkeep
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: build

build:
go build -o build/midino main.go
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# midi-player
# MIDINO player

**MIDINO** is a Linux CLI MIDI player for MIDI sound modules, like the [Roland Sound Canvas](https://en.wikipedia.org/wiki/Roland_Sound_Canvas) and the [Yamaha MU-series](https://en.wikipedia.org/wiki/Yamaha_MU-series).

## Development requirements
Have GoLang installed and configured in your local environment. More information can be found [here](https://golang.org/doc/install).

### libportmidi-dev
`apt install libportmidi-dev`

## Run
./midino midi-file.mid
Empty file added build/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ncirocco/midi-player
module github.com/ncirocco/midino

go 1.14

Expand Down
Binary file removed main
Binary file not shown.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"os"

"github.com/ncirocco/midi-player/midiparser"
"github.com/ncirocco/midi-player/midiplayer"
"github.com/ncirocco/midino/midiparser"
"github.com/ncirocco/midino/midiplayer"

"github.com/algoGuy/EasyMIDI/smfio"
)
Expand Down
2 changes: 1 addition & 1 deletion midiparser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"

"github.com/algoGuy/EasyMIDI/smf"
"github.com/ncirocco/midi-player/miditiming"
"github.com/ncirocco/midino/miditiming"
)

const tempoMetaType uint8 = 0x51
Expand Down
10 changes: 7 additions & 3 deletions midiplayer/player.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"syscall"
"time"

"github.com/ncirocco/midi-player/midimessages"
"github.com/ncirocco/midi-player/midiparser"
"github.com/ncirocco/midi-player/miditiming"
"github.com/ncirocco/midino/midimessages"
"github.com/ncirocco/midino/midiparser"
"github.com/ncirocco/midino/miditiming"
"github.com/rakyll/portmidi"
)

Expand All @@ -25,6 +25,8 @@ func PlayMIDI(midi *midiparser.Midi) {
defer out.Close()
defer portmidi.Terminate()

// In case that the user interrupts the program (ctrl+c)
// this will stop properly all the playing notes.
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
go func() {
Expand Down Expand Up @@ -63,6 +65,8 @@ func PlayMIDI(midi *midiparser.Midi) {
)
}
}

StopAllNotes(out)
}

// StopAllNotes stops all the notes in all the channels inmidiatelly
Expand Down

0 comments on commit 18e02bf

Please sign in to comment.