Comments (2)
I'll see if I can give an example of how to do this using mx
from source 'in-tree'. If you want to 'install' it on your system and reference it that way, that's something I have less experience with. But I should be able to give you at least a minimal example of the 'in-tree' method, scripted.
from mx.
Does this help?
#!/bin/bash
# this script demonstrates how to depend on mx by including it in your sourcecode tree.
# the location where you want your new project
export REPO=/tmp/my-musicxml-proj
# create a new git repository for your project
rm -rf "${REPO}"
mkdir -p "${REPO}"
cd "${REPO}"
git init
# bring the mx sourcecode into your project
git clone https://github.com/webern/mx.git mx
# remove mx's .git directory and other things you don't need in your tree
rm -rf mx/.git mx/.circleci mx/.gitattributes mx/.github \
mx/.idea mx/CodeGen mx/DevScripts mx/Documents mx/Resources \
mx/build.sh mx/Xcode
git add --all && git commit --all -m'mx sourcecode'
# create a main.cpp file
cat <<- "EOF" > main.cpp
#include <iostream>
#include "mx/api/ScoreData.h"
#include "mx/api/DocumentManager.h"
int main () {
using namespace mx::api;
ScoreData score{};
score.workTitle = "Hello World";
NoteData note{};
note.durationData.durationName = DurationName::quarter;
note.pitchData.step = Step::d;
VoiceData voiceData{};
voiceData.notes.push_back(note);
StaffData staff{};
staff.voices[0] = voiceData;
MeasureData measure{};
measure.staves.push_back(staff);
PartData part{};
part.measures.push_back(measure);
score.parts.push_back(part);
auto& mgr = DocumentManager::getInstance();
const auto id = mgr.createFromScore(score);
mgr.writeToStream(id, std::cout);
mgr.destroyDocument(id);
}
EOF
# create a cmake file
cat <<- "EOF" > CMakeLists.txt
cmake_minimum_required(VERSION 3.17)
project(my-musicxml-proj)
set(CMAKE_CXX_STANDARD 17)
set(CPP_VERSION 17)
add_executable(my-musicxml-proj main.cpp)
add_subdirectory(mx)
target_link_libraries(my-musicxml-proj mx)
target_include_directories(my-musicxml-proj PRIVATE mx/Sourcecode/include)
EOF
# create a .gitignore file to ignore a build directory
cat <<- "EOF" > .gitignore
build/
EOF
git add --all && git commit -m'musicxml hello world'
# create a build directory
mkdir build
# build your project
cd build
cmake .. && make -j10
# run your executable
./my-musicxml-proj
from mx.
Related Issues (20)
- Revive DocumentManagerTest.cpp
- Fix AppearanceData TODO in LayoutFunctions.cpp
- MeasureNumbering might be dead code
- api: support transpose element HOT 9
- build-with-apple.sh is broken because ios simulator architectures have changed HOT 3
- in Xcode LLVM C++ standard library with c++11 support HOT 3
- PathRoot.h not found with Xcode MXTest Project HOT 3
- use mx in iOS app, get problem HOT 10
- Help building the library HOT 2
- Timing information of individual notes ? HOT 1
- Expand repeats ? HOT 1
- Implement segno reading HOT 2
- Add reading and writing of arpeggiate HOT 2
- Question about ordering of starts and stops for e.g. slurs HOT 2
- Any Benchmark on musicxml parsing?
- NonTraditional key : C key HOT 6
- Use RAII for the DocumentManager
- Add Encoding Supports Hints to ScoreData
- Use the typesystem to help with Tenths
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 mx.