hydrogen 1.2.3
LilyPond Class Reference

A class to convert a Hydrogen song to LilyPond format. More...

#include <Lilypond.h>

Public Member Functions

 LilyPond ()
 
void extractData (const Song &song)
 
void write (const QString &sFilename) const
 

Private Types

typedef std::vector< std::vector< std::pair< int, float > > > notes_t
 

Private Member Functions

void writeLower (std::ofstream &stream, unsigned nMeasure) const
 Write lower voice of given measure to stream.
 
void writeMeasures (std::ofstream &stream) const
 Write measures in LilyPond format to stream.
 
void writeUpper (std::ofstream &stream, unsigned nMeasure) const
 Write upper voice of given measure to stream.
 
void writeVoice (std::ofstream &stream, unsigned nMeasure, const std::vector< int > &whiteList) const
 

Static Private Member Functions

static void addPattern (const Pattern &pattern, notes_t &notes)
 
static void addPatternList (const PatternList &list, notes_t &notes)
 

Private Attributes

float m_fBPM
 BPM of the song.
 
std::vector< notes_tm_Measures
 Representation of the song.
 
QString m_sAuthor
 Author of the song.
 
QString m_sName
 Name of the song.
 

Detailed Description

A class to convert a Hydrogen song to LilyPond format.

Definition at line 40 of file Lilypond.h.

Member Typedef Documentation

◆ notes_t

typedef std::vector<std::vector<std::pair<int, float> > > notes_t
private

Definition at line 64 of file Lilypond.h.

Constructor & Destructor Documentation

◆ LilyPond()

LilyPond ( )

Definition at line 60 of file Lilypond.cpp.

Member Function Documentation

◆ addPattern()

void addPattern ( const Pattern & pattern,
notes_t & notes )
staticprivate

Definition at line 124 of file Lilypond.cpp.

◆ addPatternList()

void addPatternList ( const PatternList & list,
notes_t & notes )
staticprivate

Definition at line 115 of file Lilypond.cpp.

◆ extractData()

void extractData ( const Song & song)

Definition at line 65 of file Lilypond.cpp.

◆ write()

void write ( const QString & sFilename) const

Definition at line 86 of file Lilypond.cpp.

◆ writeLower()

void writeLower ( std::ofstream & stream,
unsigned nMeasure ) const
private

Write lower voice of given measure to stream.

Mapping of GM-kit instrument to LilyPond names.

Definition at line 181 of file Lilypond.cpp.

◆ writeMeasures()

void writeMeasures ( std::ofstream & stream) const
private

Write measures in LilyPond format to stream.

Definition at line 145 of file Lilypond.cpp.

◆ writeUpper()

void writeUpper ( std::ofstream & stream,
unsigned nMeasure ) const
private

Write upper voice of given measure to stream.

Definition at line 165 of file Lilypond.cpp.

◆ writeVoice()

void writeVoice ( std::ofstream & stream,
unsigned nMeasure,
const std::vector< int > & whiteList ) const
private

Definition at line 242 of file Lilypond.cpp.

Field Documentation

◆ m_fBPM

float m_fBPM
private

BPM of the song.

Definition at line 102 of file Lilypond.h.

◆ m_Measures

std::vector<notes_t> m_Measures
private

Representation of the song.

Definition at line 99 of file Lilypond.h.

◆ m_sAuthor

QString m_sAuthor
private

Author of the song.

Definition at line 101 of file Lilypond.h.

◆ m_sName

QString m_sName
private

Name of the song.

Definition at line 100 of file Lilypond.h.