rosarygen

package module
v0.0.0-...-bbdc966 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2017 License: MIT Imports: 16 Imported by: 1

README

RosaryGen

===============

GoDoc

Install:

go get github.com/TheGrum/rosarygen

=====

A specialized tool to produce Rosary audio files from a collection of recorded prayers.

This is meant to solve a particular problem. If you just listen to the rosary on your drive home, buying one that you enjoy is usually manageable.

On the other hand, if you are using a recorded rosary as an aid to praying the Rosary yourself, then you may have found that commercially available and public-domain recordings share a set of faults.

They may be:

  • Too fast
  • Too slow
  • Missing preferred additions (Fatima prayers, Flame of Love prayers, Papal additions, etc).
  • Wrong order of additions
  • Pronunciations from other dialects (Hal-lowed vs Hal-low-ed, etc)
  • No time given for meditating on mystery
  • Intro/Outro/Background music
  • Too little breathing space between prayers
  • Too much breathing space between prayers
  • Breathing pattern different from desired
  • Missing the Luminous mysteries
  • Inconsistent (some decades end with Oh My Jesus, others don't, etc.)

RosaryGen supports describing a desired structure of prayers (including adding prayers RosaryGen does not know about out of the box), a desired set of mysteries, specifying several options for selecting how a prayer may be divided into sections (for call/response, etc), and a template for the output filenames.

In turn, it will take this and provide a list of needed audio files (searching a list of directories in the provided order, making it simple to layer customized audio files over a standard set), and when all files are available, will stream the input files into the appropriate set of output files.

Usage

rosarygen Render

Usage of rosarygen:

rosarygen [parameters] command

  -config string
    	Path to ini config for using in go flags. May be relative to the current executable path.
  -configUpdateInterval duration
    	Update interval for re-reading config file set via -config flag. Zero disables config file re-reading.
  -dumpflags
    	Dumps values for all flags defined in the app into stdout in ini-compatible syntax and terminates the app.
  -format string
    	wav or flac (default "wav")
  -gapLength int
    	tenths of seconds of silence to add between prayers (default 5)
  -groups string
    	Mystery decade groupings to generate. Possible values: All, Old (All excluding Luminous), Joyful, Luminous, Sorrowful, Glorious, and Custom (specify list of mysteries with mysteries) (default "All")
  -idirs string
    	Comma separated list of audio data folders, searched in order given (default "data")
  -mysteries string
    	List of mysteries to use in place of group. Use ListMysteries to see options.
  -odir string
    	output folder (default "output")
  -ofilename string
    	Output filename template. Available fields: Group, GroupNum, Mystery, MysteryNum, Prayer, PrayerNum, OutputFileNum, XthGroupMystery (default "{{.GroupNum}} {{.Group}} Mysteries")
  -structure string
    	Rosary structure to use. Use ListStructures to see options. (default "basic")
Commands
  • PrintOptions - This prints the selected prayer options from the options.toml file.

  • ListPrayers - lists all available prayers from the prayers.toml and options.toml file (use to verify that added prayers are being picked up)

  • ListGroups - lists the groups of mysteries that can be specified in the relevant parameters

  • ListMysteries - lists the mysteries that can be specified in the relevant parameters

  • ListStructures - lists the rosary structures the program knows about (use to verify that added structures are being picked up)

Commands below this point actually apply the selected rosary structure, and operate on the result.

  • Prayers - lists the actual prayers specified by the combination of -structure, -group, and -mysteries, in the order they will be output.

  • MissingFiles - does a dry run of the rendering and reports any files that have no matching file in any of the specified -idirs

  • ActualFiles - does a dry run and reports all matched files - use to verify that options are being chosen correctly and that idirs are having the desired effect

  • Render - this is the real deal - opens each actual file in turn, streaming them into the final output file[s]

  • RenderList - even 'realer' deal - if you are composing an MP3 CD as opposed to an Audio one, a rosary will fill only a tiny portion of it. RenderList lets you prepare a file to feed RosaryGen to produce multiple rosaries, chaplets, and prayers to fill such a CD.

Filename Template

The output filename parameter -ofilename uses Go Templates, which need a little explanation. Basically, it uses embedded values of the form {{.FieldName}} that get replaced with values that reflect the state of the output.

Examples:

Default, suitable for one file per group of mysteries (fine for mp3 players/phones): -ofilename "{{.GroupNum}} {{.Group}} Mysteries"

  • 1 Preamble Mysteries.wav
  • 2 Joyful Mysteries.wav
  • . . .
  • 6 Postamble Mysteries.wav

Suitable for CD Track titles: -ofilename "{{.OutputFileNum | printf "%02d"}} {{.XthGroupMystery}}" or -ofilename "{{.ZeroNum .OutputFileNum 2}} {{.XthGroupMystery}}" or -ofilename "{{.CDTrack}}

  • 01 Preamble.wav
  • 02 First Joyful Mystery.wav
  • 03 Second Joyful Mystery.wav
  • etc...

Available Fields:

  • Group - "Preamble", "Postamble", "Joyful", "Luminous", "Sorrowful", "Glorious"
  • DecadeNumWord - "First", "Second", "Third", etc - which mystery in this group are we on
  • Mystery - "Transfiguration", "Scourging", etc...
  • PrayerName - prayer name including spaces, commas, etc.
  • OutputFileNum - this cannot itself trigger a change in output file, but when a change occurs, it is incremented
  • GroupNum - counts up
  • MysteryNum - this is the mystery number from the configuration file, NOT a counting number. It can be out of order.
  • PrayerNum - counts up
  • HailMaryNum - counts Hail Mary's within a Mystery
  • XthGroupMystery - function that returns the commonly used 'First/Second/Third/etc Joyful/Sorrowful/etc Mystery' form of name.
  • XofGroup - "Preamble/First Of Five/Postamble" - useful when using groups one/two/three/four/five,etc
  • CDTrack - provides an easier CD track title using a file number formatted with 2 digits including a leading zero so that alphabetical sorting gives the proper order. If you need 3 or more digits, see the CD Track example above for the in-template way of doing this, where you can change the 02 to the desired number of digits.

Effect

When the filename resulting from applying the current state to the template changes, the OutputFileNum is incremented, the name is recalculated again, and the previous file is closed and the new one opened.

So the filename template directly controls how many files are produced, and how fine grained they are. There is no other option to say you want one file per group of mysteries, or one per mystery. If the filename would differ between mysteries you will get one file per mystery. A simple filename with no template entries will produce a single monolithic output.

Options

RosaryGen expects an options.toml file containing an [options] section with one entry per prayer that has options, and a numeric value selecting which option to use.

[options]
 ourfather = 1
 hailmary = 4
 glorybe = 3
 meditation = 1
 hailholyqueen = 1

A missing option will be interpreted as a 1.

The options.toml file may also contain [prayer] and [structure] entries - see prayers.toml and structures.toml for examples. An entry in the options.toml will replace an identically keyed entry in the prayers.toml or structures.toml file.

Filenames defined on prayers are also templated on the same running status used for the output filename. This is particularly relevant for defining audio files that need to differ for each mystery (such as announcing the mystery, or a meditation for a mystery, etc), and examples of this may also be found in the prayers.toml file.

RenderList

Call with rosarygen RenderList filename, or pipe into rosarygen RenderList. OutputFileNums will increment continually across all rendered files.

The file format understands four line types:

  • Parameter setting - has '=' in it somewhere, parameters are same as on command line, with one addition - filenum will override the current filenum
idirs=rosary/basic,rosary/extended,rosary/extra,rosary/chaplets gap=3 odir=test ofilename={{.CDTrack}} structure=extended

If structure= is present, this will Render that structure to the disk. Spaces in parameters must be escaped with ''.

ofilename={{.ZeroNum\ .OutputFileNum\ 2}}\ {{.PrayerName}}
  • Rendering - has neither '=' nor '[', may have a comma - always in the form 'structure' or 'structure,groups'. As a special bit of magic for RenderList, if structure is the name of a prayer instead of a structure, it will dynamically create a structure with that single prayer in the preamble and Render it.
basic,all
extended,old
  • Literal structure - has '[', no '=' - dynamically creates a structure and then renders it
[signofthecross,ourfather,hailmary,glorybe,signofthecross]
  • Comments - start with '#', are ignored

Example RenderList

idirs=example,rosary/basic,rosary/extended,rosary/extra,rosary/chaplets gap=3 odir=test ofilename={{.CDTrack}}
structure=example
ofilename={{.ZeroNum\ .OutputFileNum\ 2}}\ Chaplet\ of\ Divine\ Mercy\ {{.XofGroup}}
chapletofdivinemercy,five
ofilename={{.ZeroNum\ .OutputFileNum\ 2}}\ Chaplet\ of\ St.\ Michael
chapletofstmichael,none
ofilename={{.ZeroNum\ .OutputFileNum\ 2}}\ {{.PrayerName}}
memorare
magnificat
divinepraises
ohmary
queenofheavenrejoice
queenoftheholyrosary
augustqueenofheaven
comeohcreatorspirit
hailbrightstarofocean
ofilename={{.ZeroNum\ .OutputFileNum\ 2}}\ Common\ Setting
[signofthecross,ourfather,hailmary,glorybe,signofthecross]

Produces:

File test/01 Preamble.wav written.
File test/02 First Joyful Mystery.wav written.
File test/03 Second Joyful Mystery.wav written.
File test/04 Third Joyful Mystery.wav written.
File test/05 Fourth Joyful Mystery.wav written.
File test/06 Fifth Joyful Mystery.wav written.
File test/07 First Luminous Mystery.wav written.
File test/08 Second Luminous Mystery.wav written.
File test/09 Third Luminous Mystery.wav written.
File test/10 Fourth Luminous Mystery.wav written.
File test/11 Fifth Luminous Mystery.wav written.
File test/12 First Sorrowful Mystery.wav written.
File test/13 Second Sorrowful Mystery.wav written.
File test/14 Third Sorrowful Mystery.wav written.
File test/15 Fourth Sorrowful Mystery.wav written.
File test/16 Fifth Sorrowful Mystery.wav written.
File test/17 First Glorious Mystery.wav written.
File test/18 Second Glorious Mystery.wav written.
File test/19 Third Glorious Mystery.wav written.
File test/20 Fourth Glorious Mystery.wav written.
File test/21 Fifth Glorious Mystery.wav written.
File test/22 Postamble.wav written.
File test/23 Chaplet of Divine Mercy Postamble.wav written.
File test/24 Chaplet of Divine Mercy First Of Five.wav written.
File test/25 Chaplet of Divine Mercy Second Of Five.wav written.
File test/26 Chaplet of Divine Mercy Third Of Five.wav written.
File test/27 Chaplet of Divine Mercy Fourth Of Five.wav written.
File test/28 Chaplet of Divine Mercy Fifth Of Five.wav written.
File test/29 Chaplet of Divine Mercy Postamble.wav written.
File test/30 Chaplet of St. Michael.wav written.
File test/31 Memorare.wav written.
File test/32 Magnificat.wav written.
File test/33 The Divine Praises.wav written.
File test/34 Oh, Mary.wav written.
File test/35 Queen of Heaven, Rejoice.wav written.
File test/36 Queen of the Holy Rosary.wav written.
File test/37 August Queen of Heaven.wav written.
File test/38 Come Oh Creator Spirit Blest.wav written.
File test/39 Hail, Bright Star of Ocean.wav written.
File test/40 Common Setting.wav written.
Caveats/Known Problems

The library being used only supports FLAC decoding, not encoding, so currently FLAC is disabled.

WAV files are assumed to be 48000khz - if this is not the case, they should be resampled to that rate prior to use. If output contains chipmunk noises where you expect a prayer, this is the probable culprit.

WAV files are assumed to be stereo. If you hear the prayer expected, but it sounds sped up, this is a possible culprit.

Structure

Depending on your desires, you may not need to touch structures. Three have been provided; one for the traditional simple rosary ('basic'), a slightly extended form, and a Fatima form that includes the prayers added at Fatima.

If you do need to implement your own structure, copying one of the existing ones into options.toml and editing it is the easiest way to proceed. Each structure is simply a collection of lists of prayers:

  • the preamble, which precedes the first decade
  • the group, which precedes/announces a set of mysteries (i.e. "The Joyful Mysteries") and is repeated for each group of mysteries
  • the mystery, which is repeated once for each mystery
  • the postamble, which is the set of prayers that ends the rosary

Any of these groups may be empty; for example, if you were recording your own mystery meditations, you could produce a test file of all of them to listen to with a structure like:

[structure.mysteries]
 name = "Mysteries"
 preamble = []
 group = [ "announcegroup" ]
 mystery = [ "announcemystery", "meditation" ]
 postamble = []
Where do I get the audio files to make a rosary?

There are several worthwhile options:

  • Record your own

Apply a desired structure and use MissingFiles to report what files need to be recorded for your chosen result. A bathroom or a car can provide a quiet environment for recording, while most modern cell-phones have voice recording functions that are suitable. You may need to run the results through a conversion program to get the 48000khz stereo WAV file needed. Recording multiple prayers and takes into a single file and cutting them in an audio editor such as Audacity may be easier than attempting to cleanly start and stop a phone recording.

  • Fix your favorite

If you have a favorite recording of the Rosary that is merely lacking in one of the respects listed above, you can obtain the audio file (either by downloading a file, or ripping a cd/dvd), then use an audio editor to cut out individual prayers and save them. Scan through the file, find the cleanest recording of each prayer to save, and RosaryGen will stitch them all back together, improving consistency.

  • Both at once

Use the -idirs function. Save the audio files from your favorite recording in one folder (or maybe make a pastiche from multiple favorite recordings!), and in a different folder, record the files that MissingFiles still reports, filling in the holes in your favorite recording.

  • From me

I have recorded a fairly complete set of prayers that might be said with or in a rosary that I will eventually get uploaded. They can be used to render a complete rosary (assuming you can stand my accent!), or used to backstop your own recordings or favorites.

Uploaded - Hopefully this link will work: RosaryGen Audio Files

I divided them into three sets - basic is the prayers and elements needed for the basic structure. basic + extended has everything needed for the extended structure. Extra has additional recordings.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(in <-chan audio.Slice, q func(p audio.Slice)) <-chan audio.Slice

func ComplexSliceModulus

func ComplexSliceModulus(Freq []complex128) []float64

func ComplexifyRealSlice

func ComplexifyRealSlice(Freq []float64) []complex128

func CooleyTukeyDITFFT

func CooleyTukeyDITFFT(Freq []complex128, Result []complex128, n, s int)

Cooley-Tukey Decimation In Time Fast Fourier Transform radix-2

func CooleyTukeyDITFFTReal

func CooleyTukeyDITFFTReal(Freq []float64, Result []complex128, n, s int)

func CooleyTukeyDITIFFT

func CooleyTukeyDITIFFT(Freq []complex128, Result []complex128, n, s int)

Cooley-Tukey Decimation In Time Inverse Fast Fourier Transform radix-2

func FFTFreqIndex

func FFTFreqIndex(Freq, SampleRate float64, numBuckets int) int

func FFTIndexFreq

func FFTIndexFreq(i int, SampleRate float64, numBuckets int) float64

func GetBadFilenamesFunc

func GetBadFilenamesFunc(f func(filename string, err error)) func(filename string, p *Prayer, s *StateTracker)

func GetFiles

func GetFiles(ch chan *FileStack) func(filename string, p *Prayer, s *StateTracker)

func MakeTonePattern

func MakeTonePattern(steps ...float64) []float64

Give this a list of alternating steps and lengths [1, 5, 0, 5] and it will make a list of steps [1, 1, 1, 1, 1, 0, 0, 0, 0, 0]

func Merge

func Merge(add ...<-chan audio.Slice) <-chan audio.Slice

func MergeGroups

func MergeGroups(a map[string]*Group, b map[string]*Group) map[string]*Group

func MergeMysteries

func MergeMysteries(a map[string]*Mystery, b map[string]*Mystery) map[string]*Mystery

func MergePrayers

func MergePrayers(a map[string]*Prayer, b map[string]*Prayer) map[string]*Prayer

Merge functions return a with b's entries added, possibly replacing a's entries

func MergeStructures

func MergeStructures(a map[string]*Structure, b map[string]*Structure) map[string]*Structure

func ParseGroups

func ParseGroups(data *toml.TomlTree) map[string]*Group

func ParseMysteries

func ParseMysteries(data *toml.TomlTree) map[string]*Mystery

func ParsePrayers

func ParsePrayers(data *toml.TomlTree) map[string]*Prayer

func ParseStructures

func ParseStructures(data *toml.TomlTree) map[string]*Structure

func PrintActualFilename

func PrintActualFilename(filename string, p *Prayer, s *StateTracker)

func PrintFilename

func PrintFilename(filename string, p *Prayer, s *StateTracker)

Utility functions to pass to ForEachFile Functions should handle being passed "", nil, nil as the last entry

func Split

func Split(in <-chan audio.Slice) (<-chan audio.Slice, <-chan audio.Slice)

func StretchTonePattern

func StretchTonePattern(x int, steps ...float64) []float64

func Transistor

func Transistor(input <-chan audio.Slice, control <-chan audio.Slice, controller func(input audio.F64, control audio.F64) audio.F64) <-chan audio.Slice

Types

type CyclingGoertzelFilter

type CyclingGoertzelFilter struct {
	Freq       float64
	SampleRate float64
	ResetEvery int
	// contains filtered or unexported fields
}

func NewCyclingGoertzelFilter

func NewCyclingGoertzelFilter(Freq float64, SampleRate float64, ResetEvery int, num int) *CyclingGoertzelFilter

func (*CyclingGoertzelFilter) Calculate

func (c *CyclingGoertzelFilter) Calculate(sample audio.F64) float64

type Decade

type Decade struct {
	Name      string
	Group     []*Prayer
	Mysteries []*Mystery
}

func NewDecade

func NewDecade(name string, group []*Prayer, mysteries ...*Mystery) *Decade

func (*Decade) ForEachFile

func (d *Decade) ForEachFile(o OptionProvider, s *StateTracker, f func(filename string, p *Prayer, s *StateTracker))

func (*Decade) GetPrayers

func (d *Decade) GetPrayers() []*Prayer

type FFTProcessor

type FFTProcessor interface {
	Process(p []complex128)
}

type FileStack

type FileStack struct {
	OutputFilename string
	Filenames      []string
}

func NewFileStack

func NewFileStack(filename string) *FileStack

func (*FileStack) AddFilename

func (f *FileStack) AddFilename(filename string)

func (*FileStack) RenderWav

func (f *FileStack) RenderWav(gap int)

type GenProcessor

type GenProcessor struct {
	// contains filtered or unexported fields
}

func NewGenProcessor

func NewGenProcessor(f func(p audio.Slice)) *GenProcessor

func (*GenProcessor) Process

func (g *GenProcessor) Process(p audio.Slice)

type Generator

type Generator struct {
	Prayers    map[string]*Prayer
	Mysteries  map[string]*Mystery
	Groups     map[string]*Group
	Structures map[string]*Structure
	Options    *Options
}

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates and loads a Generator from .toml files

func (*Generator) FindMystery

func (g *Generator) FindMystery(mystery string) *Mystery

func (*Generator) GroupsForRosary

func (g *Generator) GroupsForRosary(groups string, mysteries string) []string

func (*Generator) Init

func (g *Generator) Init()

Init loads Generator with data from .toml files prayers.toml structures.toml options.toml

func (*Generator) NewRosary

func (g *Generator) NewRosary(structure string, groups ...string) *Rosary

func (*Generator) RenderList

func (g *Generator) RenderList(reader io.Reader)

type GoertzelFilter

type GoertzelFilter struct {
	Freq       float64
	SampleRate float64
	// contains filtered or unexported fields
}

based on https://netwerkt.wordpress.com/2011/08/25/goertzel-filter/

func NewGoertzelFilter

func NewGoertzelFilter(Freq float64, SampleRate float64) *GoertzelFilter

func (*GoertzelFilter) Calculate

func (g *GoertzelFilter) Calculate(sample audio.F64) float64

func (*GoertzelFilter) Zero

func (g *GoertzelFilter) Zero()

type GoertzelVolume

type GoertzelVolume struct {
	Freq       float64
	SampleRate float64

	Filter *CyclingGoertzelFilter
}

func NewGoertzelVolume

func NewGoertzelVolume(Freq float64, SampleRate float64, ResetEvery int, num int) *GoertzelVolume

func (*GoertzelVolume) Process

func (g *GoertzelVolume) Process(p audio.Slice)

type Group

type Group struct {
	Order     int
	Key       string
	Name      string
	Mysteries []int
}

func NewGroup

func NewGroup(order int, key string, name string) *Group

func ParseGroup

func ParseGroup(key string, so *toml.TomlTree) *Group

func (*Group) AddMystery

func (g *Group) AddMystery(mystery int)

func (*Group) String

func (g *Group) String() string

type HarmonicTone

type HarmonicTone struct {
	Freq             float64
	SampleRate       float64
	NumHarmonics     int
	HarmonicDistance float64
	VibratoDistance  float64
	VibratoRate      float64
	// contains filtered or unexported fields
}

func NewHarmonicTone

func NewHarmonicTone(Freq, SampleRate float64, num int, distance float64) *HarmonicTone

func (*HarmonicTone) Process

func (a *HarmonicTone) Process(p audio.Slice)

1 2 3 4 1, 2/3 + 2/6, 4/7 + 4/14 + 4/28, 8/15 + 8/30 + 8/60 + 8/120

func (*HarmonicTone) SetFreq

func (a *HarmonicTone) SetFreq(Freq float64)

func (*HarmonicTone) SetVibrato

func (a *HarmonicTone) SetVibrato(VibratoDistance float64, VibratoRate float64)

type Mystery

type Mystery struct {
	Num     int
	Name    string
	Desc    string
	Prayers []*Prayer
}

func NewMystery

func NewMystery(num int, name string) *Mystery

func ParseMystery

func ParseMystery(num int, so *toml.TomlTree) *Mystery

func (*Mystery) ForEachFile

func (m *Mystery) ForEachFile(o OptionProvider, s *StateTracker, f func(filename string, p *Prayer, s *StateTracker))

func (*Mystery) GetPrayers

func (m *Mystery) GetPrayers() []*Prayer

func (*Mystery) SetDesc

func (m *Mystery) SetDesc(desc string)

type OptionProvider

type OptionProvider interface {
	GetOption(prayer string) int
}

type Options

type Options struct {
	Options map[string]int
}

func NewOptions

func NewOptions() *Options

func ParseOptions

func ParseOptions(data *toml.TomlTree) *Options

func (*Options) AddOption

func (o *Options) AddOption(prayer string, choice int)

func (*Options) GetOption

func (o *Options) GetOption(prayer string) int

type Prayer

type Prayer struct {
	Key       string
	Name      string
	Desc      string
	Text      string
	Filename  string
	Filenames []string
	Options   []*Prayer
}

func NewPrayer

func NewPrayer(key string, name string) *Prayer

func ParsePrayer

func ParsePrayer(key string, po *toml.TomlTree) *Prayer

func (*Prayer) AddFilename

func (p *Prayer) AddFilename(filename string)

func (*Prayer) AddOption

func (p *Prayer) AddOption(option *Prayer)

func (*Prayer) ForEachFile

func (p *Prayer) ForEachFile(o OptionProvider, s *StateTracker, f func(filename string, p *Prayer, s *StateTracker))

func (*Prayer) GetChosenFilenames

func (p *Prayer) GetChosenFilenames(o OptionProvider) []string

func (*Prayer) SetDesc

func (p *Prayer) SetDesc(desc string)

func (*Prayer) SetFilename

func (p *Prayer) SetFilename(filename string)

func (*Prayer) SetName

func (p *Prayer) SetName(name string)

func (*Prayer) SetText

func (p *Prayer) SetText(text string)

type Processor

type Processor interface {
	Process(p audio.Slice)
}

type PureTone

type PureTone struct {
	LeftFreq, RightFreq float64
	SampleRate          float64
	// contains filtered or unexported fields
}

func NewPureTone

func NewPureTone(LeftFreq, RightFreq, SampleRate float64) *PureTone

func (*PureTone) Process

func (a *PureTone) Process(p audio.Slice)

func (*PureTone) SetFreq

func (a *PureTone) SetFreq(LeftFreq, RightFreq float64)

type Rosary

type Rosary struct {
	Preamble  []*Prayer
	Decades   []*Decade
	Postamble []*Prayer
}

func NewRosary

func NewRosary(structure *Structure, groups []*Group, mysteries map[string]*Mystery, prayers map[string]*Prayer) *Rosary

func (*Rosary) ForEachFile

func (r *Rosary) ForEachFile(idirs []string, odir string, outputFilename string, format string, o OptionProvider, f func(filename string, p *Prayer, s *StateTracker), s *StateTracker)

func (*Rosary) GetPrayers

func (r *Rosary) GetPrayers() []*Prayer

func (*Rosary) RenderToFiles

func (r *Rosary) RenderToFiles(idirs []string, odir string, outputFilename string, format string, o OptionProvider, gapLength int, s *StateTracker)

type Stack

type Stack struct {
	Processors []Processor
	// contains filtered or unexported fields
}

func NewStack

func NewStack(p Processor) *Stack

func (*Stack) Add

func (s *Stack) Add(p Processor)

func (*Stack) Apply

func (s *Stack) Apply(in <-chan audio.Slice) <-chan audio.Slice

type StateTracker

type StateTracker struct {
	InputDirs []string
	OutputDir string
	Format    string

	Group         string // Preamble/[Group]/Postamble
	DecadeNumWord string
	Mystery       string
	MysteryPhrase string
	Prayer        string
	PrayerName    string

	OutputFileNum int
	InputFileNum  int
	GroupNum      int
	MysteryNum    int
	PrayerNum     int
	HailMaryNum   int

	OutputFilenameTemplate string
	LastFilename           string
}

func NewStateTracker

func NewStateTracker(idirs []string, odir string, outputFilename string, format string) *StateTracker

func (*StateTracker) Apply

func (s *StateTracker) Apply(name string) string

func (*StateTracker) CDTrack

func (s *StateTracker) CDTrack() string

func (*StateTracker) FileNum

func (s *StateTracker) FileNum() int

func (*StateTracker) MatchActualFile

func (s *StateTracker) MatchActualFile(filename string) (string, error)

Searches input dirs in order specified for the file

func (*StateTracker) NumWord

func (s *StateTracker) NumWord(num int) string

func (*StateTracker) SetDecadeNumWord

func (s *StateTracker) SetDecadeNumWord(num int)

func (*StateTracker) UpdateFilename

func (s *StateTracker) UpdateFilename() (filenameChanged bool)

func (*StateTracker) XofGroup

func (s *StateTracker) XofGroup() string

func (*StateTracker) XthGroupMystery

func (s *StateTracker) XthGroupMystery() string

func (*StateTracker) ZeroFileNum

func (s *StateTracker) ZeroFileNum() string

func (*StateTracker) ZeroNum

func (s *StateTracker) ZeroNum(num int, zeroes int) string

type Structure

type Structure struct {
	Key       string
	Name      string
	Preamble  []string
	Group     []string
	Mystery   []string
	Postamble []string
}

func NewStructure

func NewStructure(key string, name string) *Structure

func ParseStructure

func ParseStructure(key string, so *toml.TomlTree) *Structure

func StructureForPrayer

func StructureForPrayer(prayer string) *Structure

func StructureForPrayers

func StructureForPrayers(prayers string) *Structure

func (*Structure) AddGroup

func (s *Structure) AddGroup(group string)

func (*Structure) AddMystery

func (s *Structure) AddMystery(mystery string)

func (*Structure) AddPostamble

func (s *Structure) AddPostamble(postamble string)

func (*Structure) AddPreamble

func (s *Structure) AddPreamble(preamble string)

type TonePattern

type TonePattern struct {
	LeftSteps  []float64
	RightSteps []float64
	// contains filtered or unexported fields
}

func NewSymmetricTonePattern

func NewSymmetricTonePattern(Steps ...float64) *TonePattern

func (*TonePattern) Process

func (t *TonePattern) Process(p audio.Slice)

type VolumeKnob

type VolumeKnob struct {
	Volume float64
}

func (*VolumeKnob) Process

func (v *VolumeKnob) Process(p audio.Slice)

Directories

Path Synopsis
cmd
rosarygen command

Jump to

Keyboard shortcuts

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