Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes are rendered an octave lower #20

Closed
walmik opened this issue Mar 25, 2016 · 4 comments
Closed

Notes are rendered an octave lower #20

walmik opened this issue Mar 25, 2016 · 4 comments

Comments

@walmik
Copy link
Contributor

walmik commented Mar 25, 2016

Execute the following script to create a MIDI file that contains a single C4 note. Import the MIDI file in a software like Garage Band or Ableton Live. The generated note will show C3.

var Midi = require('jsmidgen');
var fs = require('fs');

var file = new Midi.File();
var track = new Midi.Track();
file.addTrack(track);

track.addNote(0, 'c4', 64);

fs.writeFileSync('test.mid', file.toBytes(), 'binary');
@walmik
Copy link
Contributor Author

walmik commented Mar 25, 2016

On second thoughts I m not entirely sure this is an issue. Ableton Live (and presumable Garage Band too) considers C3 as the middle C. The only issue then is, what do most people do with the MIDI files generated using jsmidgen? If they are gonna use a software to make use of the MIDI files, then they are gonna be thrown off by this. Should we have a mechanism to adjust middle C based on user preference?

@dingram
Copy link
Owner

dingram commented Mar 25, 2016

https://en.wikipedia.org/wiki/Scientific_pitch_notation suggests that C4 is always middle C, which should be in line with what jsmidgen produces. If jsmidgen isn't doing that, then yes this is a bug :-)

@walmik
Copy link
Contributor Author

walmik commented Mar 25, 2016

Agreed. And I spoke to a musician friend and he too confirmed this, but there seems to be this second school of thought when it comes to music software. For example even in Propellerhead Reason's NNXT sampler C3 is the middle C. I dont have FL Studio, but looks like there too its not C4.

The MIDI (Musical Instrument Device Interface) standards unfortunately do not designate octaves. They just specify the number 60 as the middle C leaving the octave itself to the implementors. My concern is toward the users of this lib who will import the generated MIDI files in to softwares. I m one of them :)

@walmik
Copy link
Contributor Author

walmik commented May 10, 2016

Confirming C4 as the middle octave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants