Comments (1)
Finally fixed(!) with commit a48a2cb
I must have been thinking to use sprintf
, but used printf
by mistake... Obviously I have never used the save-to-file version of MidiFile::writeHex
.
Here is a test program for creating a hex bytecode MIDI file:
midifile/src-programs/mid2hex.cpp
Lines 1 to 40 in a48a2cb
test input file:
"MThd"
4'6
2'0
2'1
2'100
"MTRk"
4'13
v0 90 '60 '80
v200 90 '60 '80
v0 FF 2F 00
(a binary MIDI file also works as input).
output:
$ bin/midi2hex input.txt
4d 54 68 64 00 00 00 06 00 00 00 01 00 78 4d 54 72 6b 00 00 00 04 00 ff 2f
00
And using the -o
option will save to a file without the accidental re-routing of the bytes to standard output:
$ bin/mid2hex -o output.hex input.txt
contents of output.hex
:
4d 54 68 64 00 00 00 06 00 00 00 01 00 78 4d 54 72 6b 00 00 00 04 00 ff 2f
00
Such a great library! Thank you very much for sharing it, and the Options class is the best I've used.
Thanks! Yes, I cannot live without the Options class when writing command-line programs in C++.
from midifile.
Related Issues (20)
- How to get sub tracks HOT 3
- Channel number is off by one HOT 3
- Undefined References HOT 2
- cmake fails looking for midicater.cpp HOT 2
- AppVeyor trying to compile hum2mid HOT 1
- Codefactor pull request related to rand vs. rand_r
- upgrade to lock free wait free data structures instead of using std::vector
- comparison of constant -1 with expression of type 'char' is always false HOT 1
- documentation question
- Please add the 'install' target HOT 7
- The 'midicat' program conflicts with sndio HOT 2
- Add import/export of base64-encoded MIDI files HOT 1
- Failed to parse some midi files HOT 1
- bug: useless code in MidiFile::getAbsoluteTickTime HOT 1
- Installation and building of tools should be optional with CMake
- Read and write MIDI files streamly HOT 1
- MIDI 2.0 Support HOT 1
- Can we publish release code with version?
- ausing offset HOT 1
- Add tuning changes HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from midifile.