Skip to content

Commit

Permalink
Work in progress pending chord-symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
infojunkie committed Oct 20, 2024
1 parent 536ce82 commit 984a8d0
Show file tree
Hide file tree
Showing 44 changed files with 2,028 additions and 101,247 deletions.
19 changes: 0 additions & 19 deletions .babelrc.json

This file was deleted.

11 changes: 0 additions & 11 deletions .eslintrc

This file was deleted.

1 change: 0 additions & 1 deletion .mocharc.yaml

This file was deleted.

17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ireal-musicxml

iReal Pro to MusicXML converter
iReal Pro to MusicXML converter.

[![npm version](https://badge.fury.io/js/ireal-musicxml.svg)](https://badge.fury.io/js/ireal-musicxml)
![GitHub Build Status](https://github.com/infojunkie/ireal-musicxml/workflows/Test/badge.svg)
Expand All @@ -12,10 +12,10 @@ iReal Pro to MusicXML converter
# Usage

```javascript
import * as iReal2MusicXML from 'ireal-musicxml'
import * as iRealMusicXml from 'ireal-musicxml'
const ireal = // Content of HTML file generated by iReal Pro or irealb:// URI
const playlistSync = iReal2MusicXML.convertSync(ireal)
const playlistAsync = await iReal2MusicXML.convert(ireal)
const playlistSync = iRealMusicXml.convertSync(ireal)
const playlistAsync = await iRealMusicXml.convert(ireal)
// => {
// name: // Playlist name
// songs: [{
Expand All @@ -33,23 +33,22 @@ const playlistAsync = await iReal2MusicXML.convert(ireal)
// }]
// }

const playlistManual = new iReal2MusicXML.Playlist(ireal)
const playlistManual = new iRealMusicXml.Playlist(ireal)
// => Same as above minus `musicXml` attribute
const musicXml = iReal2MusicXML.MusicXML.convert(playlistManual.songs[0])
const musicXml = iRealMusicXml.MusicXML.convert(playlistManual.songs[0])
// => MusicXML output
```

# Development

`xmllint` is required to run tests (but NOT at runtime). Tests are used to ensure that the generated MusicXML is valid.
`xmllint` is required to run tests and the demo cli tool (but NOT for the library). Tests are used to ensure that the generated MusicXML is valid.

```
npm install
npm run test
./demo/cli/ireal-musicxml.js test/data/jazz.txt --songs=Blues --validate
```

Check out the demos for example usage under `demo/`.

# Documentation
- More information [about the iReal Pro format](doc/irealpro.md).
- More information [about the MusicXML format](https://w3c.github.io/musicxml/).
36 changes: 34 additions & 2 deletions lib/ireal-musicxml.d.ts → build/ireal-musicxml.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,47 @@ export class ConversionOptions {
*/
notehead?: string;
/**
* Log level (default: Warn).
* Size of note head to use for the chord note (default: large).
* https://www.w3.org/2021/06/musicxml40/musicxml-reference/data-types/font-size/
*/
noteheadSize?: string;
/**
* Whether to output encoding date (default: yes).
* https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/encoding-date/
*/
date?: boolean;
/**
* Whether to display the clef (i.e. set its @print-object attribute) (default: no).
* https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/clef/
*/
clef?: boolean;
/**
* Whether to display the key signature (i.e. set its @print-object attribute) (default: no).
* https://www.w3.org/2021/06/musicxml40/musicxml-reference/elements/key/
*/
keySignature?: boolean;
/**
* Page width in millimeters (default: A4 = 210mm).
*/
pageWidth?: number;
/**
* Page height in millimeters (default: A4 = 297mm).
*/
pageHeight?: number;
/**
* Page margin in millimeters (default: 15mm).
*/
pageMargin?: number;
/**
* Log level (default: LogLevel.Warn).
*/
logLevel?: LogLevel;
}

/**
* MusicXML converter.
*/
export class MusicXML {
export class Converter {
/**
* Default conversion options.
*/
Expand Down
8 changes: 8 additions & 0 deletions build/ireal-musicxml.js

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions build/ireal-musicxml.js.map

Large diffs are not rendered by default.

11 changes: 0 additions & 11 deletions demo/cli/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions demo/cli/ireal-musicxml.js

This file was deleted.

31 changes: 0 additions & 31 deletions demo/web/README.md

This file was deleted.

Loading

0 comments on commit 984a8d0

Please sign in to comment.