Documentation ¶
Overview ¶
Package smfimage converts a Standard MIDI File (SMF) to an image (PNG), based on keys and timing; separated by channel.
Index ¶
- Constants
- Variables
- func New(input io.Reader, options ...Option) (im *smfimage, trackNames []string, err error)
- func NoteToNumber(name string) int
- func SMF2PNG(inFile string, outFile string, options ...Option) (trackNames []string, err error)
- type ColorMapper
- type Interval
- type Note
- type Option
- func Background(name string) Option
- func BaseNote(n Note) Option
- func BeatsInGrid() Option
- func Colors(cm ColorMapper) Option
- func Curve() Option
- func Height(height int) Option
- func Monochrome() Option
- func NoBackground() Option
- func NoBarLines() Option
- func Overview() Option
- func SingleBar() Option
- func SkipTracks(tracks ...int) Option
- func TrackBorder(border int) Option
- func TrackOrder(order ...int) Option
- func Verbose() Option
- func Width(width int) Option
Constants ¶
View Source
const ( Prime Interval = 0 MinSecond Interval = 1 MajSecond Interval = 2 MinThird Interval = 3 MajThird Interval = 4 Fourth Interval = 5 Tritone Interval = 6 Fifth Interval = 7 MinSixth Interval = 8 MajSixth Interval = 9 MinSeventh Interval = 10 MajSeventh Interval = 11 Unison = Prime Octave = Prime C Note = 0 CSharp Note = 1 D Note = 2 DSharp Note = 3 E Note = 4 F Note = 5 FSharp Note = 6 G Note = 7 GSharp Note = 8 A Note = 9 ASharp Note = 10 B Note = 11 DFlat = CSharp EFlat = DSharp ESharp = F FFlat = E GFlat = FSharp AFlat = GSharp BFlat = ASharp BSharp = C CFlat = B )
View Source
const VERSION = "0.20.2"
Variables ¶
View Source
var ( ColorYellow = color.RGBA{255, 255, 0, 255} // yellow ColorElectricLime = color.RGBA{201, 255, 0, 255} // yellow-green ColorSpringBud = color.RGBA{148, 255, 0, 255} // light green ColorHarlequin = color.RGBA{81, 255, 0, 255} // green ColorMalachite = color.RGBA{0, 232, 83, 255} // dark green ColorCaribbeanGreen = color.RGBA{0, 206, 133, 255} // turkis ColorRobinsEggBlue = color.RGBA{0, 196, 190, 255} // blue-green ColorDeepSkyBlue = color.RGBA{0, 173, 236, 255} // sky blue ColorDodgerBlue = color.RGBA{0, 130, 255, 255} // light blue ColorBlue = color.RGBA{0, 57, 255, 255} // blue ColorDarkBlue = color.RGBA{0, 0, 255, 255} // dark blue ColorIndigoBlue = color.RGBA{90, 0, 252, 255} // indigo blue ColorElectricIndigo = color.RGBA{105, 0, 210, 255} // indigo ColorDarkViolet = color.RGBA{153, 0, 202, 255} // violet ColorDeepMagenta = color.RGBA{201, 0, 195, 255} // magenta ColorRazzmatazz = color.RGBA{247, 0, 117, 255} // pink ColorRed = color.RGBA{255, 0, 0, 255} // red ColorOrangeRed = color.RGBA{255, 60, 0, 255} // orange red ColorSafetyOrange = color.RGBA{255, 106, 0, 255} // orange ColorDarkOrange = color.RGBA{255, 149, 0, 255} // dark orange ColorSelectiveYellow = color.RGBA{255, 176, 0, 255} // yellow-orange ColorTangerineYellow = color.RGBA{255, 202, 0, 255} // dark yellow ColorGoldenYellow = color.RGBA{255, 227, 0, 255} // deep yellow // names according to https://www.htmlcsscolor.com PrimeColor = ColorYellow // C hellgelb 255 255 0 ffff00 Yellow // 201 255 0 c9ff00 Electric Lime MinSecondColor = ColorSpringBud // C# hellgrün 148 255 0 94ff00 Spring Bud // 81 255 0 51ff00 Harlequin MajSecondColor = ColorMalachite // D dunkelgrün 0 232 83 00e853 Malachite // 0 206 133 00ce85 Caribbean Green MinThirdColor = ColorRobinsEggBlue // oliv D# türkis 0 196 190 00c4be Robin's Egg Blue // 0 173 236 00adec Deep Sky Blue MajThirdColor = ColorDodgerBlue // türkis E hellblau 0 130 255 0082ff Dodger Blue // 0 83 255 0053ff Navy Blue FourthColor = ColorBlue // activ red F dunkelblau 0 57 255 0039ff Blue // 0 0 255 0000ff Blue TritoneColor = ColorIndigoBlue // F# violet 90 0 252 5a00fc Electric Indigo // 105 0 210 6900d2 Electric Indigo FifthColor = ColorDarkViolet // activ blue G purple 153 0 202 9900ca Dark Violet // 201 0 195 c900c3 Deep Magenta MinSixthColor = ColorRazzmatazz // burgunder rot-brown G# pink 247 0 117 f70075 Razzmatazz // 255 0 0 ff0000 Red MajSixthColor = ColorOrangeRed // A rot 255 60 0 ff3c00 Orange Red // 255 106 0 ff6a00 Safety Orange MinSeventhColor = ColorDarkOrange // dark/deep blue A# orange 255 149 0 ff9500 Dark Orange // 255 176 0 ffb000 Selective Yellow MajSeventhColor = ColorTangerineYellow // H dunkelgelb255 202 0 ffca00 Tangerine Yellow // 255 227 0 ffe300 golden yellow // C hellgelb 255 255 0 ffff00 yellow /* PrimeColor = color.RGBA{255, 255, 0, 255} // yellow prime/oktave (c) MinSecondColor = color.RGBA{189, 252, 201, 255} // mint kl. sekunde (des) MajSecondColor = color.RGBA{255, 165, 0, 255} // orange gr sekunde (d) MinThirdColor = color.RGBA{135, 206, 255, 255} // sky blue kl terz (es) MajThirdColor = color.RGBA{0, 205, 102, 255} // spring green große terz (e) FourthColor = color.RGBA{0, 245, 255, 255} // cyan/türkis, quarte (f) TritoneColor = color.RGBA{127, 255, 0, 255} // lime/chartreuse tritonus (ges) FifthColor = color.RGBA{72, 118, 255, 255} // royalblue quinte (g) MinSixthColor = color.RGBA{255, 192, 203, 255} // pink kl. sexte (as) MajSixthColor = color.RGBA{155, 48, 255, 255} // violett/purple gr sexte (a) MinSeventhColor = color.RGBA{255, 0, 255, 255} // magenta kl. septe (b) MajSeventhColor = color.RGBA{255, 0, 0, 255} // red gr sept (h) */ LightGrey = color.RGBA{187, 187, 187, 255} DarkGrey = color.RGBA{120, 120, 120, 255} )
View Source
var ColorPalette = &palette{color.Palette{ color.Black, color.White, color.Transparent, PrimeColor, MinSecondColor, MajSecondColor, MinThirdColor, MajThirdColor, FourthColor, TritoneColor, FifthColor, MinSixthColor, MajSixthColor, MinSeventhColor, MajSeventhColor, LightGrey, DarkGrey, }}
View Source
var RainbowColors colorMapper = map[Interval]color.RGBA{ Prime: PrimeColor, MinSecond: MinSecondColor, MajSecond: MajSecondColor, MinThird: MinThirdColor, MajThird: MajThirdColor, Fourth: FourthColor, Tritone: TritoneColor, Fifth: FifthColor, MinSixth: MinSixthColor, MajSixth: MajSixthColor, MinSeventh: MinSeventhColor, MajSeventh: MajSeventhColor, }
Functions ¶
func NoteToNumber ¶
Types ¶
type ColorMapper ¶
ColorMapper maps an interval (counted from basenote) to a color
type Option ¶
type Option func(*smfimage)
func Background ¶
func BeatsInGrid ¶
func BeatsInGrid() Option
func Colors ¶
func Colors(cm ColorMapper) Option
func Monochrome ¶
func Monochrome() Option
func NoBackground ¶
func NoBackground() Option
func NoBarLines ¶
func NoBarLines() Option
func SkipTracks ¶
func TrackOrder ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.