Full Code of fynv/ScoreDraft for AI

master 8cc9519f60ed cached
912 files
37.3 MB
3.9M tokens
8641 symbols
1 requests
Copy disabled (too large) Download .txt
Showing preview only (15,484K chars total). Download the full file to get everything.
Repository: fynv/ScoreDraft
Branch: master
Commit: 8cc9519f60ed
Files: 912
Total size: 37.3 MB

Directory structure:
gitextract_fqqiew6r/

├── BasicSamplers/
│   ├── CMakeLists.txt
│   ├── FrequencyDetection.cpp
│   ├── FrequencyDetection.h
│   ├── InstrumentMultiSampler.cpp
│   ├── InstrumentMultiSampler.h
│   ├── InstrumentSingleSampler.cpp
│   ├── InstrumentSingleSampler.h
│   ├── PercussionSampler.cpp
│   ├── PercussionSampler.h
│   ├── Sample.h
│   └── api.cpp
├── CMakeLists.txt
├── DSPUtil/
│   ├── complex.cpp
│   ├── complex.h
│   ├── fft.cpp
│   └── fft.h
├── KarplusStrong/
│   ├── CMakeLists.txt
│   └── KarplusStrong.cpp
├── LICENSE
├── MIDIWriter/
│   ├── CMakeLists.txt
│   └── MIDIWriter.cpp
├── Meteor/
│   ├── CMakeLists.txt
│   ├── DrawText.cpp
│   ├── DrawText.h
│   ├── Meteor.cpp
│   ├── Meteor.h
│   ├── MeteorPlayer.cpp
│   ├── MeteorPlayer.h
│   ├── SubListLookUp.h
│   ├── api.cpp
│   ├── base64.hpp
│   └── blob.hpp
├── PCMPlayer/
│   ├── CMakeLists.txt
│   ├── PCMPlayer.cpp
│   ├── PCMPlayer.h
│   └── api.cpp
├── README.md
├── README_cn.md
├── ScoreDraftCore/
│   ├── CMakeLists.txt
│   ├── ReadWav.cpp
│   ├── ReadWav.h
│   ├── TrackBuffer.cpp
│   ├── TrackBuffer.h
│   ├── WavBuffer.h
│   ├── WriteWav.cpp
│   ├── WriteWav.h
│   ├── api.cpp
│   ├── api.h
│   └── utils.h
├── SimpleInstruments/
│   ├── CMakeLists.txt
│   └── SimpleInstruments.cpp
├── SoundFont2/
│   ├── CMakeLists.txt
│   ├── Presets.cpp
│   ├── Presets.h
│   ├── SF2.cpp
│   ├── SF2.h
│   ├── SF2Synth.cpp
│   ├── SF2Synth.h
│   ├── Synth.cpp
│   ├── Synth.h
│   └── api.cpp
├── Test/
│   ├── FlyMeToTheMoon.py
│   ├── FlyMeToTheMoon_eq.py
│   ├── Hello.py
│   ├── HelloMeteor.py
│   ├── InstrumentSamples/
│   │   ├── Ah.freq
│   │   ├── Cello.freq
│   │   ├── CleanGuitar.freq
│   │   ├── Lah.freq
│   │   ├── Piano/
│   │   │   ├── Alesis-Fusion-Bright-Acoustic-Piano-C2.freq
│   │   │   ├── Alesis-Fusion-Bright-Acoustic-Piano-C4.freq
│   │   │   └── Alesis-Fusion-Bright-Acoustic-Piano-C6.freq
│   │   ├── String.freq
│   │   └── Violin.freq
│   ├── PrintCatalog.py
│   ├── ZhenDeAiNi.ly
│   ├── ZhenDeAiNi.xml
│   ├── ZhenDeAiNi.yaml
│   ├── florestan-subset.sf2
│   ├── percussion_test.py
│   ├── piano_test.py
│   ├── sunshine.yaml
│   ├── test.yaml
│   ├── test_xml.py
│   └── test_yaml.py
├── VoiceSampler/
│   ├── CMakeLists.txt
│   ├── DVVector.hpp
│   ├── FrequencyDetection.cpp
│   ├── FrequencyDetection.h
│   ├── HNM.cu
│   ├── SentenceDescriptor.h
│   ├── SentenceGeneratorCPU.cpp
│   ├── SentenceGeneratorCPU.h
│   ├── SentenceGeneratorCUDA.cpp
│   ├── SentenceGeneratorCUDA.h
│   ├── SentenceGeneratorGeneral.cpp
│   ├── SentenceGeneratorGeneral.h
│   ├── VoiceUtil.cuh
│   ├── VoiceUtil.h
│   ├── api.cpp
│   ├── fft.cuh
│   └── helper_math.h
├── docs/
│   ├── README.md
│   ├── _config.yml
│   ├── intro_cn.html_files/
│   │   └── github-markdown.css
│   ├── intro_cn.md
│   ├── intro_eng.md
│   └── meteor/
│       ├── MyLove.html_files/
│       │   └── github-markdown.css
│       ├── MyLove.md
│       ├── MyLove.meteor
│       ├── SoreFeetSong.md
│       ├── SoreFeetSong.meteor
│       ├── TaLang.md
│       ├── TaLang.meteor
│       ├── WuYa.md
│       ├── WuYa.meteor
│       ├── meteor.js
│       ├── ouchi.md
│       ├── ouchi.meteor
│       ├── tiktok.md
│       └── tiktok.meteor
├── python/
│   ├── CMakeLists.txt
│   ├── README.md
│   ├── ScoreDraft/
│   │   ├── BasicSamplers.py
│   │   ├── CVVCChineseConverter.py
│   │   ├── Catalog.py
│   │   ├── Document.py
│   │   ├── Initializers.py
│   │   ├── Instrument.py
│   │   ├── JPVCVConverter.py
│   │   ├── KarplusStrong.py
│   │   ├── MIDIWriter.py
│   │   ├── Meteor.py
│   │   ├── MusicXMLDocument.py
│   │   ├── Notes.py
│   │   ├── PCMPlayer.py
│   │   ├── Percussion.py
│   │   ├── RapChinese.py
│   │   ├── ScoreDraftCore.py
│   │   ├── SimpleInstruments.py
│   │   ├── Singer.py
│   │   ├── SoundFont2.py
│   │   ├── TTEnglishConverter.py
│   │   ├── TTLyricSet.data
│   │   ├── TsuroVCVConverter.py
│   │   ├── UTAUUtils.py
│   │   ├── UtauDraft.py
│   │   ├── VCCVEnglishConverter.py
│   │   ├── VCCVLyricSet.data
│   │   ├── VoiceSampler.py
│   │   ├── XiaYYConverter.py
│   │   ├── YAMLDocument.py
│   │   ├── __init__.py
│   │   └── musicxml/
│   │       ├── __init__.py
│   │       ├── musicxml.py
│   │       ├── xlink.py
│   │       └── xml.py
│   └── setup.py
└── thirdparty/
    ├── fonts/
    │   ├── NotoSansSC-Bold.hpp
    │   └── NotoSansSC-Bold.otf
    ├── freetype/
    │   ├── include/
    │   │   └── freetype2/
    │   │       ├── freetype/
    │   │       │   ├── config/
    │   │       │   │   ├── ftconfig.h
    │   │       │   │   ├── ftheader.h
    │   │       │   │   ├── ftmodule.h
    │   │       │   │   ├── ftoption.h
    │   │       │   │   ├── ftstdlib.h
    │   │       │   │   ├── integer-types.h
    │   │       │   │   ├── mac-support.h
    │   │       │   │   └── public-macros.h
    │   │       │   ├── freetype.h
    │   │       │   ├── ftadvanc.h
    │   │       │   ├── ftbbox.h
    │   │       │   ├── ftbdf.h
    │   │       │   ├── ftbitmap.h
    │   │       │   ├── ftbzip2.h
    │   │       │   ├── ftcache.h
    │   │       │   ├── ftchapters.h
    │   │       │   ├── ftcid.h
    │   │       │   ├── ftcolor.h
    │   │       │   ├── ftdriver.h
    │   │       │   ├── fterrdef.h
    │   │       │   ├── fterrors.h
    │   │       │   ├── ftfntfmt.h
    │   │       │   ├── ftgasp.h
    │   │       │   ├── ftglyph.h
    │   │       │   ├── ftgxval.h
    │   │       │   ├── ftgzip.h
    │   │       │   ├── ftimage.h
    │   │       │   ├── ftincrem.h
    │   │       │   ├── ftlcdfil.h
    │   │       │   ├── ftlist.h
    │   │       │   ├── ftlogging.h
    │   │       │   ├── ftlzw.h
    │   │       │   ├── ftmac.h
    │   │       │   ├── ftmm.h
    │   │       │   ├── ftmodapi.h
    │   │       │   ├── ftmoderr.h
    │   │       │   ├── ftotval.h
    │   │       │   ├── ftoutln.h
    │   │       │   ├── ftparams.h
    │   │       │   ├── ftpfr.h
    │   │       │   ├── ftrender.h
    │   │       │   ├── ftsizes.h
    │   │       │   ├── ftsnames.h
    │   │       │   ├── ftstroke.h
    │   │       │   ├── ftsynth.h
    │   │       │   ├── ftsystem.h
    │   │       │   ├── fttrigon.h
    │   │       │   ├── fttypes.h
    │   │       │   ├── ftwinfnt.h
    │   │       │   ├── t1tables.h
    │   │       │   ├── ttnameid.h
    │   │       │   ├── tttables.h
    │   │       │   └── tttags.h
    │   │       └── ft2build.h
    │   └── lib/
    │       └── freetype.lib
    ├── glfw/
    │   ├── CMake/
    │   │   ├── GenerateMappings.cmake
    │   │   ├── MacOSXBundleInfo.plist.in
    │   │   ├── i686-w64-mingw32-clang.cmake
    │   │   ├── i686-w64-mingw32.cmake
    │   │   ├── modules/
    │   │   │   ├── FindEpollShim.cmake
    │   │   │   ├── FindOSMesa.cmake
    │   │   │   ├── FindWaylandProtocols.cmake
    │   │   │   └── FindXKBCommon.cmake
    │   │   ├── x86_64-w64-mingw32-clang.cmake
    │   │   └── x86_64-w64-mingw32.cmake
    │   ├── CMakeLists.txt
    │   ├── LICENSE.md
    │   ├── README.md
    │   ├── cmake_uninstall.cmake.in
    │   ├── deps/
    │   │   ├── getopt.c
    │   │   ├── getopt.h
    │   │   ├── glad/
    │   │   │   ├── gl.h
    │   │   │   ├── khrplatform.h
    │   │   │   ├── vk_platform.h
    │   │   │   └── vulkan.h
    │   │   ├── glad_gl.c
    │   │   ├── glad_vulkan.c
    │   │   ├── linmath.h
    │   │   ├── mingw/
    │   │   │   ├── _mingw_dxhelper.h
    │   │   │   ├── dinput.h
    │   │   │   └── xinput.h
    │   │   ├── nuklear.h
    │   │   ├── nuklear_glfw_gl2.h
    │   │   ├── stb_image_write.h
    │   │   ├── tinycthread.c
    │   │   ├── tinycthread.h
    │   │   └── vs2008/
    │   │       └── stdint.h
    │   ├── docs/
    │   │   ├── CMakeLists.txt
    │   │   ├── CODEOWNERS
    │   │   ├── CONTRIBUTING.md
    │   │   ├── Doxyfile.in
    │   │   ├── DoxygenLayout.xml
    │   │   ├── SUPPORT.md
    │   │   ├── build.dox
    │   │   ├── compat.dox
    │   │   ├── compile.dox
    │   │   ├── context.dox
    │   │   ├── extra.css
    │   │   ├── extra.less
    │   │   ├── footer.html
    │   │   ├── header.html
    │   │   ├── html/
    │   │   │   ├── bug.html
    │   │   │   ├── build_8dox.html
    │   │   │   ├── build_guide.html
    │   │   │   ├── compat_8dox.html
    │   │   │   ├── compat_guide.html
    │   │   │   ├── compile_8dox.html
    │   │   │   ├── compile_guide.html
    │   │   │   ├── context_8dox.html
    │   │   │   ├── context_guide.html
    │   │   │   ├── deprecated.html
    │   │   │   ├── dir_15a5176d7c9cc5c407ed4f611edf0684.html
    │   │   │   ├── dir_a58ef735c5cc5a9a31d321e1abe7c42e.html
    │   │   │   ├── dir_abae1f34c5d965773b98e3c915cdaeb5.html
    │   │   │   ├── dir_bc6505cac00d7a6291dbfd9af70666b7.html
    │   │   │   ├── doxygen.css
    │   │   │   ├── dynsections.js
    │   │   │   ├── extra.css
    │   │   │   ├── files.html
    │   │   │   ├── glfw3_8h.html
    │   │   │   ├── glfw3_8h_source.html
    │   │   │   ├── glfw3native_8h.html
    │   │   │   ├── glfw3native_8h_source.html
    │   │   │   ├── group__buttons.html
    │   │   │   ├── group__context.html
    │   │   │   ├── group__errors.html
    │   │   │   ├── group__gamepad__axes.html
    │   │   │   ├── group__gamepad__buttons.html
    │   │   │   ├── group__hat__state.html
    │   │   │   ├── group__init.html
    │   │   │   ├── group__input.html
    │   │   │   ├── group__joysticks.html
    │   │   │   ├── group__keys.html
    │   │   │   ├── group__mods.html
    │   │   │   ├── group__monitor.html
    │   │   │   ├── group__native.html
    │   │   │   ├── group__shapes.html
    │   │   │   ├── group__vulkan.html
    │   │   │   ├── group__window.html
    │   │   │   ├── index.html
    │   │   │   ├── input_8dox.html
    │   │   │   ├── input_guide.html
    │   │   │   ├── internal_8dox.html
    │   │   │   ├── internals_guide.html
    │   │   │   ├── intro_8dox.html
    │   │   │   ├── intro_guide.html
    │   │   │   ├── jquery.js
    │   │   │   ├── main_8dox.html
    │   │   │   ├── menu.js
    │   │   │   ├── menudata.js
    │   │   │   ├── modules.html
    │   │   │   ├── monitor_8dox.html
    │   │   │   ├── monitor_guide.html
    │   │   │   ├── moving_8dox.html
    │   │   │   ├── moving_guide.html
    │   │   │   ├── news.html
    │   │   │   ├── news_8dox.html
    │   │   │   ├── pages.html
    │   │   │   ├── quick_8dox.html
    │   │   │   ├── quick_guide.html
    │   │   │   ├── search/
    │   │   │   │   ├── all_0.html
    │   │   │   │   ├── all_0.js
    │   │   │   │   ├── all_1.html
    │   │   │   │   ├── all_1.js
    │   │   │   │   ├── all_10.html
    │   │   │   │   ├── all_10.js
    │   │   │   │   ├── all_11.html
    │   │   │   │   ├── all_11.js
    │   │   │   │   ├── all_2.html
    │   │   │   │   ├── all_2.js
    │   │   │   │   ├── all_3.html
    │   │   │   │   ├── all_3.js
    │   │   │   │   ├── all_4.html
    │   │   │   │   ├── all_4.js
    │   │   │   │   ├── all_5.html
    │   │   │   │   ├── all_5.js
    │   │   │   │   ├── all_6.html
    │   │   │   │   ├── all_6.js
    │   │   │   │   ├── all_7.html
    │   │   │   │   ├── all_7.js
    │   │   │   │   ├── all_8.html
    │   │   │   │   ├── all_8.js
    │   │   │   │   ├── all_9.html
    │   │   │   │   ├── all_9.js
    │   │   │   │   ├── all_a.html
    │   │   │   │   ├── all_a.js
    │   │   │   │   ├── all_b.html
    │   │   │   │   ├── all_b.js
    │   │   │   │   ├── all_c.html
    │   │   │   │   ├── all_c.js
    │   │   │   │   ├── all_d.html
    │   │   │   │   ├── all_d.js
    │   │   │   │   ├── all_e.html
    │   │   │   │   ├── all_e.js
    │   │   │   │   ├── all_f.html
    │   │   │   │   ├── all_f.js
    │   │   │   │   ├── classes_0.html
    │   │   │   │   ├── classes_0.js
    │   │   │   │   ├── defines_0.html
    │   │   │   │   ├── defines_0.js
    │   │   │   │   ├── files_0.html
    │   │   │   │   ├── files_0.js
    │   │   │   │   ├── files_1.html
    │   │   │   │   ├── files_1.js
    │   │   │   │   ├── files_2.html
    │   │   │   │   ├── files_2.js
    │   │   │   │   ├── files_3.html
    │   │   │   │   ├── files_3.js
    │   │   │   │   ├── files_4.html
    │   │   │   │   ├── files_4.js
    │   │   │   │   ├── files_5.html
    │   │   │   │   ├── files_5.js
    │   │   │   │   ├── files_6.html
    │   │   │   │   ├── files_6.js
    │   │   │   │   ├── files_7.html
    │   │   │   │   ├── files_7.js
    │   │   │   │   ├── files_8.html
    │   │   │   │   ├── files_8.js
    │   │   │   │   ├── functions_0.html
    │   │   │   │   ├── functions_0.js
    │   │   │   │   ├── groups_0.html
    │   │   │   │   ├── groups_0.js
    │   │   │   │   ├── groups_1.html
    │   │   │   │   ├── groups_1.js
    │   │   │   │   ├── groups_2.html
    │   │   │   │   ├── groups_2.js
    │   │   │   │   ├── groups_3.html
    │   │   │   │   ├── groups_3.js
    │   │   │   │   ├── groups_4.html
    │   │   │   │   ├── groups_4.js
    │   │   │   │   ├── groups_5.html
    │   │   │   │   ├── groups_5.js
    │   │   │   │   ├── groups_6.html
    │   │   │   │   ├── groups_6.js
    │   │   │   │   ├── groups_7.html
    │   │   │   │   ├── groups_7.js
    │   │   │   │   ├── groups_8.html
    │   │   │   │   ├── groups_8.js
    │   │   │   │   ├── groups_9.html
    │   │   │   │   ├── groups_9.js
    │   │   │   │   ├── groups_a.html
    │   │   │   │   ├── groups_a.js
    │   │   │   │   ├── nomatches.html
    │   │   │   │   ├── pages_0.html
    │   │   │   │   ├── pages_0.js
    │   │   │   │   ├── pages_1.html
    │   │   │   │   ├── pages_1.js
    │   │   │   │   ├── pages_2.html
    │   │   │   │   ├── pages_2.js
    │   │   │   │   ├── pages_3.html
    │   │   │   │   ├── pages_3.js
    │   │   │   │   ├── pages_4.html
    │   │   │   │   ├── pages_4.js
    │   │   │   │   ├── pages_5.html
    │   │   │   │   ├── pages_5.js
    │   │   │   │   ├── pages_6.html
    │   │   │   │   ├── pages_6.js
    │   │   │   │   ├── pages_7.html
    │   │   │   │   ├── pages_7.js
    │   │   │   │   ├── pages_8.html
    │   │   │   │   ├── pages_8.js
    │   │   │   │   ├── pages_9.html
    │   │   │   │   ├── pages_9.js
    │   │   │   │   ├── pages_a.html
    │   │   │   │   ├── pages_a.js
    │   │   │   │   ├── search.css
    │   │   │   │   ├── search.js
    │   │   │   │   ├── searchdata.js
    │   │   │   │   ├── typedefs_0.html
    │   │   │   │   ├── typedefs_0.js
    │   │   │   │   ├── variables_0.html
    │   │   │   │   ├── variables_0.js
    │   │   │   │   ├── variables_1.html
    │   │   │   │   ├── variables_1.js
    │   │   │   │   ├── variables_2.html
    │   │   │   │   ├── variables_2.js
    │   │   │   │   ├── variables_3.html
    │   │   │   │   ├── variables_3.js
    │   │   │   │   ├── variables_4.html
    │   │   │   │   ├── variables_4.js
    │   │   │   │   ├── variables_5.html
    │   │   │   │   ├── variables_5.js
    │   │   │   │   ├── variables_6.html
    │   │   │   │   ├── variables_6.js
    │   │   │   │   ├── variables_7.html
    │   │   │   │   └── variables_7.js
    │   │   │   ├── structGLFWgamepadstate.html
    │   │   │   ├── structGLFWgammaramp.html
    │   │   │   ├── structGLFWimage.html
    │   │   │   ├── structGLFWvidmode.html
    │   │   │   ├── tabs.css
    │   │   │   ├── vulkan_8dox.html
    │   │   │   ├── vulkan_guide.html
    │   │   │   ├── window_8dox.html
    │   │   │   └── window_guide.html
    │   │   ├── input.dox
    │   │   ├── internal.dox
    │   │   ├── intro.dox
    │   │   ├── main.dox
    │   │   ├── monitor.dox
    │   │   ├── moving.dox
    │   │   ├── news.dox
    │   │   ├── quick.dox
    │   │   ├── vulkan.dox
    │   │   └── window.dox
    │   ├── examples/
    │   │   ├── CMakeLists.txt
    │   │   ├── boing.c
    │   │   ├── gears.c
    │   │   ├── glfw.icns
    │   │   ├── glfw.rc
    │   │   ├── heightmap.c
    │   │   ├── offscreen.c
    │   │   ├── particles.c
    │   │   ├── sharing.c
    │   │   ├── simple.c
    │   │   ├── splitview.c
    │   │   └── wave.c
    │   ├── include/
    │   │   └── GLFW/
    │   │       ├── glfw3.h
    │   │       └── glfw3native.h
    │   ├── src/
    │   │   ├── CMakeLists.txt
    │   │   ├── cocoa_init.m
    │   │   ├── cocoa_joystick.h
    │   │   ├── cocoa_joystick.m
    │   │   ├── cocoa_monitor.m
    │   │   ├── cocoa_platform.h
    │   │   ├── cocoa_time.c
    │   │   ├── cocoa_window.m
    │   │   ├── context.c
    │   │   ├── egl_context.c
    │   │   ├── egl_context.h
    │   │   ├── glfw3.pc.in
    │   │   ├── glfw3Config.cmake.in
    │   │   ├── glfw_config.h.in
    │   │   ├── glx_context.c
    │   │   ├── glx_context.h
    │   │   ├── init.c
    │   │   ├── input.c
    │   │   ├── internal.h
    │   │   ├── linux_joystick.c
    │   │   ├── linux_joystick.h
    │   │   ├── mappings.h
    │   │   ├── mappings.h.in
    │   │   ├── monitor.c
    │   │   ├── nsgl_context.h
    │   │   ├── nsgl_context.m
    │   │   ├── null_init.c
    │   │   ├── null_joystick.c
    │   │   ├── null_joystick.h
    │   │   ├── null_monitor.c
    │   │   ├── null_platform.h
    │   │   ├── null_window.c
    │   │   ├── osmesa_context.c
    │   │   ├── osmesa_context.h
    │   │   ├── posix_thread.c
    │   │   ├── posix_thread.h
    │   │   ├── posix_time.c
    │   │   ├── posix_time.h
    │   │   ├── vulkan.c
    │   │   ├── wgl_context.c
    │   │   ├── wgl_context.h
    │   │   ├── win32_init.c
    │   │   ├── win32_joystick.c
    │   │   ├── win32_joystick.h
    │   │   ├── win32_monitor.c
    │   │   ├── win32_platform.h
    │   │   ├── win32_thread.c
    │   │   ├── win32_time.c
    │   │   ├── win32_window.c
    │   │   ├── window.c
    │   │   ├── wl_init.c
    │   │   ├── wl_monitor.c
    │   │   ├── wl_platform.h
    │   │   ├── wl_window.c
    │   │   ├── x11_init.c
    │   │   ├── x11_monitor.c
    │   │   ├── x11_platform.h
    │   │   ├── x11_window.c
    │   │   ├── xkb_unicode.c
    │   │   └── xkb_unicode.h
    │   └── tests/
    │       ├── CMakeLists.txt
    │       ├── clipboard.c
    │       ├── cursor.c
    │       ├── empty.c
    │       ├── events.c
    │       ├── gamma.c
    │       ├── glfwinfo.c
    │       ├── icon.c
    │       ├── iconify.c
    │       ├── inputlag.c
    │       ├── joysticks.c
    │       ├── monitors.c
    │       ├── msaa.c
    │       ├── opacity.c
    │       ├── reopen.c
    │       ├── tearing.c
    │       ├── threads.c
    │       ├── timeout.c
    │       ├── title.c
    │       ├── triangle-vulkan.c
    │       └── windows.c
    └── portaudio/
        ├── .editorconfig
        ├── .gitattributes
        ├── .github/
        │   ├── ISSUE_TEMPLATE/
        │   │   └── bug_report.md
        │   └── workflows/
        │       ├── MSBuild.yml
        │       └── c-cpp.yml
        ├── .gitignore
        ├── CMakeLists.txt
        ├── Doxyfile
        ├── Doxyfile.developer
        ├── LICENSE.txt
        ├── Makefile.in
        ├── README.configure.txt
        ├── README.md
        ├── SConstruct
        ├── aclocal.m4
        ├── bindings/
        │   ├── cpp/
        │   │   ├── AUTHORS
        │   │   ├── COPYING
        │   │   ├── ChangeLog
        │   │   ├── INSTALL
        │   │   ├── Makefile.am
        │   │   ├── Makefile.in
        │   │   ├── NEWS
        │   │   ├── README
        │   │   ├── SConscript
        │   │   ├── aclocal.m4
        │   │   ├── bin/
        │   │   │   ├── Makefile.am
        │   │   │   └── Makefile.in
        │   │   ├── build/
        │   │   │   ├── gnu/
        │   │   │   │   ├── Makefile.in
        │   │   │   │   ├── OUT_OF_DATE
        │   │   │   │   ├── aclocal.m4
        │   │   │   │   ├── config.guess
        │   │   │   │   ├── config.sub
        │   │   │   │   ├── configure
        │   │   │   │   ├── configure.ac
        │   │   │   │   └── install-sh
        │   │   │   ├── vc6/
        │   │   │   │   ├── devs_example.dsp
        │   │   │   │   ├── devs_example.dsw
        │   │   │   │   ├── sine_example.dsp
        │   │   │   │   ├── sine_example.dsw
        │   │   │   │   ├── static_library.dsp
        │   │   │   │   └── static_library.dsw
        │   │   │   ├── vc7/
        │   │   │   │   └── OUT_OF_DATE
        │   │   │   └── vc7_1/
        │   │   │       ├── devs_example.sln
        │   │   │       ├── devs_example.vcproj
        │   │   │       ├── sine_example.sln
        │   │   │       ├── sine_example.vcproj
        │   │   │       ├── static_library.sln
        │   │   │       └── static_library.vcproj
        │   │   ├── configure
        │   │   ├── configure.ac
        │   │   ├── doc/
        │   │   │   ├── Makefile.am
        │   │   │   ├── Makefile.in
        │   │   │   ├── README
        │   │   │   ├── config.doxy
        │   │   │   └── config.doxy.linux
        │   │   ├── example/
        │   │   │   ├── devs.cxx
        │   │   │   └── sine.cxx
        │   │   ├── include/
        │   │   │   ├── Makefile.am
        │   │   │   ├── Makefile.in
        │   │   │   └── portaudiocpp/
        │   │   │       ├── AsioDeviceAdapter.hxx
        │   │   │       ├── AutoSystem.hxx
        │   │   │       ├── BlockingStream.hxx
        │   │   │       ├── CFunCallbackStream.hxx
        │   │   │       ├── CallbackInterface.hxx
        │   │   │       ├── CallbackStream.hxx
        │   │   │       ├── CppFunCallbackStream.hxx
        │   │   │       ├── Device.hxx
        │   │   │       ├── DirectionSpecificStreamParameters.hxx
        │   │   │       ├── Exception.hxx
        │   │   │       ├── HostApi.hxx
        │   │   │       ├── InterfaceCallbackStream.hxx
        │   │   │       ├── MemFunCallbackStream.hxx
        │   │   │       ├── PortAudioCpp.hxx
        │   │   │       ├── SampleDataFormat.hxx
        │   │   │       ├── Stream.hxx
        │   │   │       ├── StreamParameters.hxx
        │   │   │       ├── System.hxx
        │   │   │       ├── SystemDeviceIterator.hxx
        │   │   │       └── SystemHostApiIterator.hxx
        │   │   ├── lib/
        │   │   │   ├── Makefile.am
        │   │   │   └── Makefile.in
        │   │   ├── portaudiocpp.pc.in
        │   │   └── source/
        │   │       └── portaudiocpp/
        │   │           ├── AsioDeviceAdapter.cxx
        │   │           ├── BlockingStream.cxx
        │   │           ├── CFunCallbackStream.cxx
        │   │           ├── CallbackInterface.cxx
        │   │           ├── CallbackStream.cxx
        │   │           ├── CppFunCallbackStream.cxx
        │   │           ├── Device.cxx
        │   │           ├── DirectionSpecificStreamParameters.cxx
        │   │           ├── Exception.cxx
        │   │           ├── HostApi.cxx
        │   │           ├── InterfaceCallbackStream.cxx
        │   │           ├── MemFunCallbackStream.cxx
        │   │           ├── Stream.cxx
        │   │           ├── StreamParameters.cxx
        │   │           ├── System.cxx
        │   │           ├── SystemDeviceIterator.cxx
        │   │           └── SystemHostApiIterator.cxx
        │   └── java/
        │       ├── c/
        │       │   ├── build/
        │       │   │   └── vs2010/
        │       │   │       └── PortAudioJNI/
        │       │   │           ├── PortAudioJNI.sln
        │       │   │           ├── PortAudioJNI.vcproj
        │       │   │           └── PortAudioJNI.vcxproj
        │       │   └── src/
        │       │       ├── com_portaudio_BlockingStream.c
        │       │       ├── com_portaudio_BlockingStream.h
        │       │       ├── com_portaudio_PortAudio.c
        │       │       ├── com_portaudio_PortAudio.h
        │       │       ├── jpa_tools.c
        │       │       └── jpa_tools.h
        │       ├── jportaudio/
        │       │   ├── .classpath
        │       │   ├── .project
        │       │   ├── jtests/
        │       │   │   └── com/
        │       │   │       └── portaudio/
        │       │   │           ├── PlaySine.java
        │       │   │           └── TestBasic.java
        │       │   └── src/
        │       │       └── com/
        │       │           └── portaudio/
        │       │               ├── BlockingStream.java
        │       │               ├── DeviceInfo.java
        │       │               ├── HostApiInfo.java
        │       │               ├── PortAudio.java
        │       │               ├── StreamInfo.java
        │       │               └── StreamParameters.java
        │       ├── jportaudio.dox
        │       └── scripts/
        │           └── make_header.bat
        ├── build/
        │   ├── msvc/
        │   │   ├── portaudio.def
        │   │   ├── portaudio.dsp
        │   │   ├── portaudio.dsw
        │   │   ├── portaudio.sln
        │   │   ├── portaudio.vcproj
        │   │   └── readme.txt
        │   └── scons/
        │       ├── SConscript_common
        │       └── SConscript_opts
        ├── clear_gitrevision.sh
        ├── cmake_support/
        │   ├── FindASIOSDK.cmake
        │   ├── FindJack.cmake
        │   ├── cmake_uninstall.cmake.in
        │   ├── options_cmake.h.in
        │   ├── portaudio-2.0.pc.in
        │   ├── portaudioConfig.cmake.in
        │   └── template_portaudio.def
        ├── config.guess
        ├── config.sub
        ├── configure
        ├── configure.in
        ├── depcomp
        ├── doc/
        │   ├── src/
        │   │   ├── api_overview.dox
        │   │   ├── license.dox
        │   │   ├── mainpage.dox
        │   │   ├── srcguide.dox
        │   │   └── tutorial/
        │   │       ├── blocking_read_write.dox
        │   │       ├── compile_cmake.dox
        │   │       ├── compile_linux.dox
        │   │       ├── compile_mac_coreaudio.dox
        │   │       ├── compile_windows.dox
        │   │       ├── compile_windows_asio_msvc.dox
        │   │       ├── compile_windows_mingw.dox
        │   │       ├── exploring.dox
        │   │       ├── initializing_portaudio.dox
        │   │       ├── open_default_stream.dox
        │   │       ├── querying_devices.dox
        │   │       ├── start_stop_abort.dox
        │   │       ├── terminating_portaudio.dox
        │   │       ├── tutorial_start.dox
        │   │       ├── utility_functions.dox
        │   │       └── writing_a_callback.dox
        │   └── utils/
        │       └── checkfiledocs.py
        ├── examples/
        │   ├── CMakeLists.txt
        │   ├── pa_devs.c
        │   ├── pa_fuzz.c
        │   ├── paex_mono_asio_channel_select.c
        │   ├── paex_ocean_shore.c
        │   ├── paex_pink.c
        │   ├── paex_read_write_wire.c
        │   ├── paex_record.c
        │   ├── paex_record_file.c
        │   ├── paex_saw.c
        │   ├── paex_sine.c
        │   ├── paex_sine_c++.cpp
        │   ├── paex_wmme_ac3.c
        │   ├── paex_wmme_surround.c
        │   ├── paex_write_sine.c
        │   └── paex_write_sine_nonint.c
        ├── i686-w64-mingw32.cmake
        ├── include/
        │   ├── pa_asio.h
        │   ├── pa_jack.h
        │   ├── pa_linux_alsa.h
        │   ├── pa_mac_core.h
        │   ├── pa_win_ds.h
        │   ├── pa_win_wasapi.h
        │   ├── pa_win_waveformat.h
        │   ├── pa_win_wdmks.h
        │   ├── pa_win_wmme.h
        │   └── portaudio.h
        ├── install-sh
        ├── ltmain.sh
        ├── missing
        ├── pablio/
        │   ├── README.txt
        │   ├── pablio.c
        │   ├── pablio.def
        │   ├── pablio.h
        │   ├── test_rw.c
        │   ├── test_rw_echo.c
        │   ├── test_w_saw.c
        │   └── test_w_saw8.c
        ├── portaudio-2.0.pc.in
        ├── qa/
        │   ├── loopback/
        │   │   ├── README.txt
        │   │   └── src/
        │   │       ├── audio_analyzer.c
        │   │       ├── audio_analyzer.h
        │   │       ├── biquad_filter.c
        │   │       ├── biquad_filter.h
        │   │       ├── paqa.c
        │   │       ├── paqa_tools.c
        │   │       ├── paqa_tools.h
        │   │       ├── qa_tools.h
        │   │       ├── test_audio_analyzer.c
        │   │       ├── test_audio_analyzer.h
        │   │       ├── write_wav.c
        │   │       └── write_wav.h
        │   ├── paqa_devs.c
        │   ├── paqa_errs.c
        │   └── paqa_latency.c
        ├── src/
        │   ├── SConscript
        │   ├── common/
        │   │   ├── pa_allocation.c
        │   │   ├── pa_allocation.h
        │   │   ├── pa_converters.c
        │   │   ├── pa_converters.h
        │   │   ├── pa_cpuload.c
        │   │   ├── pa_cpuload.h
        │   │   ├── pa_debugprint.c
        │   │   ├── pa_debugprint.h
        │   │   ├── pa_dither.c
        │   │   ├── pa_dither.h
        │   │   ├── pa_endianness.h
        │   │   ├── pa_front.c
        │   │   ├── pa_gitrevision.h
        │   │   ├── pa_hostapi.h
        │   │   ├── pa_memorybarrier.h
        │   │   ├── pa_process.c
        │   │   ├── pa_process.h
        │   │   ├── pa_ringbuffer.c
        │   │   ├── pa_ringbuffer.h
        │   │   ├── pa_stream.c
        │   │   ├── pa_stream.h
        │   │   ├── pa_trace.c
        │   │   ├── pa_trace.h
        │   │   ├── pa_types.h
        │   │   └── pa_util.h
        │   ├── hostapi/
        │   │   ├── alsa/
        │   │   │   └── pa_linux_alsa.c
        │   │   ├── asihpi/
        │   │   │   └── pa_linux_asihpi.c
        │   │   ├── asio/
        │   │   │   ├── ASIO-README.txt
        │   │   │   ├── iasiothiscallresolver.cpp
        │   │   │   ├── iasiothiscallresolver.h
        │   │   │   └── pa_asio.cpp
        │   │   ├── coreaudio/
        │   │   │   ├── notes.txt
        │   │   │   ├── pa_mac_core.c
        │   │   │   ├── pa_mac_core_blocking.c
        │   │   │   ├── pa_mac_core_blocking.h
        │   │   │   ├── pa_mac_core_internal.h
        │   │   │   ├── pa_mac_core_utilities.c
        │   │   │   └── pa_mac_core_utilities.h
        │   │   ├── dsound/
        │   │   │   ├── pa_win_ds.c
        │   │   │   ├── pa_win_ds_dynlink.c
        │   │   │   └── pa_win_ds_dynlink.h
        │   │   ├── jack/
        │   │   │   └── pa_jack.c
        │   │   ├── oss/
        │   │   │   ├── low_latency_tip.txt
        │   │   │   ├── pa_unix_oss.c
        │   │   │   └── recplay.c
        │   │   ├── skeleton/
        │   │   │   ├── README.txt
        │   │   │   └── pa_hostapi_skeleton.c
        │   │   ├── wasapi/
        │   │   │   ├── mingw-include/
        │   │   │   │   ├── AudioSessionTypes.h
        │   │   │   │   ├── PropIdl.h
        │   │   │   │   ├── ShTypes.h
        │   │   │   │   ├── audioclient.h
        │   │   │   │   ├── devicetopology.h
        │   │   │   │   ├── endpointvolume.h
        │   │   │   │   ├── functiondiscoverykeys.h
        │   │   │   │   ├── functiondiscoverykeys_devpkey.h
        │   │   │   │   ├── ks.h
        │   │   │   │   ├── ksguid.h
        │   │   │   │   ├── ksmedia.h
        │   │   │   │   ├── ksproxy.h
        │   │   │   │   ├── ksuuids.h
        │   │   │   │   ├── mmdeviceapi.h
        │   │   │   │   ├── propkey.h
        │   │   │   │   ├── propkeydef.h
        │   │   │   │   ├── propsys.h
        │   │   │   │   ├── rpcsal.h
        │   │   │   │   ├── sal.h
        │   │   │   │   ├── sdkddkver.h
        │   │   │   │   ├── structuredquery.h
        │   │   │   │   └── winapifamily.h
        │   │   │   ├── pa_win_wasapi.c
        │   │   │   └── readme.txt
        │   │   ├── wdmks/
        │   │   │   ├── pa_win_wdmks.c
        │   │   │   └── readme.txt
        │   │   └── wmme/
        │   │       └── pa_win_wmme.c
        │   └── os/
        │       ├── unix/
        │       │   ├── pa_unix_hostapis.c
        │       │   ├── pa_unix_util.c
        │       │   └── pa_unix_util.h
        │       └── win/
        │           ├── pa_win_coinitialize.c
        │           ├── pa_win_coinitialize.h
        │           ├── pa_win_hostapis.c
        │           ├── pa_win_util.c
        │           ├── pa_win_waveformat.c
        │           ├── pa_win_wdmks_utils.c
        │           ├── pa_win_wdmks_utils.h
        │           ├── pa_x86_plain_converters.c
        │           └── pa_x86_plain_converters.h
        ├── test/
        │   ├── CMakeLists.txt
        │   ├── README.txt
        │   ├── pa_minlat.c
        │   ├── patest1.c
        │   ├── patest_buffer.c
        │   ├── patest_callbackstop.c
        │   ├── patest_clip.c
        │   ├── patest_converters.c
        │   ├── patest_dither.c
        │   ├── patest_dsound_find_best_latency_params.c
        │   ├── patest_dsound_low_level_latency_params.c
        │   ├── patest_dsound_surround.c
        │   ├── patest_hang.c
        │   ├── patest_in_overflow.c
        │   ├── patest_jack_wasapi.c
        │   ├── patest_latency.c
        │   ├── patest_leftright.c
        │   ├── patest_longsine.c
        │   ├── patest_many.c
        │   ├── patest_maxsines.c
        │   ├── patest_mono.c
        │   ├── patest_multi_sine.c
        │   ├── patest_out_underflow.c
        │   ├── patest_prime.c
        │   ├── patest_read_record.c
        │   ├── patest_ringmix.c
        │   ├── patest_sine8.c
        │   ├── patest_sine_channelmaps.c
        │   ├── patest_sine_formats.c
        │   ├── patest_sine_srate.c
        │   ├── patest_sine_time.c
        │   ├── patest_start_stop.c
        │   ├── patest_stop.c
        │   ├── patest_stop_playout.c
        │   ├── patest_suggested_vs_streaminfo_latency.c
        │   ├── patest_suggested_vs_streaminfo_latency.py
        │   ├── patest_sync.c
        │   ├── patest_timing.c
        │   ├── patest_toomanysines.c
        │   ├── patest_two_rates.c
        │   ├── patest_underflow.c
        │   ├── patest_unplug.c
        │   ├── patest_wire.c
        │   ├── patest_wmme_find_best_latency_params.c
        │   ├── patest_wmme_low_level_latency_params.c
        │   ├── patest_write_stop.c
        │   └── patest_write_stop_hang_illegal.c
        └── update_gitrevision.sh

================================================
FILE CONTENTS
================================================

================================================
FILE: BasicSamplers/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(BasicSamplers)


set(SOURCES
../DSPUtil/complex.cpp 
../DSPUtil/fft.cpp
api.cpp
FrequencyDetection.cpp
PercussionSampler.cpp
InstrumentSingleSampler.cpp
InstrumentMultiSampler.cpp
)

set(HEADERS 
../DSPUtil/complex.h
../DSPUtil/fft.h
FrequencyDetection.h
Sample.h
PercussionSampler.h
InstrumentSingleSampler.h
InstrumentMultiSampler.h
)


set (INCLUDE_DIR
../ScoreDraftCore
../DSPUtil
)


if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)
endif()

include_directories(${INCLUDE_DIR})
add_definitions(${DEFINES})
add_library (BasicSamplers SHARED  ${SOURCES} ${HEADERS})
target_link_libraries(BasicSamplers ScoreDraftCore)

if (WIN32) 
target_compile_definitions(BasicSamplers PUBLIC SCOREDRAFTCORE_DLL_IMPORT)
endif()

if (WIN32) 
install(TARGETS BasicSamplers RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS BasicSamplers DESTINATION ScoreDraft)
endif()



================================================
FILE: BasicSamplers/FrequencyDetection.cpp
================================================
#include "FrequencyDetection.h"
#include "fft.h"

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

class Window
{
public:
	virtual ~Window(){}
	float m_halfWidth;
	std::vector<float> m_data;

	void Allocate(float halfWidth)
	{
		unsigned u_halfWidth = (unsigned)ceilf(halfWidth);
		unsigned u_width = u_halfWidth << 1;

		m_halfWidth = halfWidth;
		m_data.resize(u_width);

		SetZero();
	}

	void SetZero()
	{
		memset(m_data.data(), 0, sizeof(float)*m_data.size());
	}

	void CreateFromBuffer(const Buffer& src, float center, float halfWidth)
	{
		unsigned u_halfWidth = (unsigned)ceilf(halfWidth);
		unsigned u_width = u_halfWidth << 1;

		m_halfWidth = halfWidth;
		m_data.resize(u_width);

		SetZero();

		int i_Center = (int)center;

		for (int i = -(int)u_halfWidth; i < (int)u_halfWidth; i++)
		{
			float window = (cosf((float)i * (float)PI / halfWidth) + 1.0f)*0.5f;

			int srcIndex = i_Center + i;
			float v_src = src.GetSample(srcIndex);

			SetSample(i, window* v_src);
		}
	}

	void MergeToBuffer(Buffer& buf, float pos)
	{
		int ipos = (int)floorf(pos);
		unsigned u_halfWidth = GetHalfWidthOfData();

		for (int i = max(-(int)u_halfWidth, -ipos); i < (int)u_halfWidth; i++)
		{
			int dstIndex = ipos + i;
			if (dstIndex >= (int)buf.m_size) break;
			buf.m_data[dstIndex] += GetSample(i);
		}
	}

	virtual unsigned GetHalfWidthOfData() const
	{
		unsigned u_width = (unsigned)m_data.size();
		unsigned u_halfWidth = u_width >> 1;

		return u_halfWidth;
	}

	virtual float GetSample(int i) const
	{
		unsigned u_width = (unsigned)m_data.size();
		unsigned u_halfWidth = u_width >> 1;

		unsigned pos;
		if (i >= 0)
		{
			if ((unsigned)i > u_halfWidth - 1) return 0.0f;
			pos = (unsigned)i;
		}
		else
		{
			if (((int)u_width + i) < (int)u_halfWidth + 1) return 0.0f;
			pos = u_width - (unsigned)(-i);
		}

		return m_data[pos];
	}

	virtual void SetSample(int i, float v)
	{
		unsigned u_width = (unsigned)m_data.size();
		unsigned u_halfWidth = u_width >> 1;

		unsigned pos;
		if (i >= 0)
		{
			if ((unsigned)i > u_halfWidth - 1) return;
			pos = (unsigned)i;
		}
		else
		{
			if (((int)u_width + i) < (int)u_halfWidth + 1) return;
			pos = u_width - (unsigned)(-i);
		}

		m_data[pos] = v;
	}

};

float fetchFrequency(const Buffer& buf, unsigned sampleRate)
{
	unsigned l = 12;
	unsigned halfWinLen = 1 << (l - 1);

	float* fft_acc = new float[halfWinLen];
	memset(fft_acc, 0, sizeof(float)*halfWinLen);

	DComp* fftData = new DComp[halfWinLen * 2];
	fftData[0].Re = 0.0;
	fftData[0].Im = 0.0;

	for (unsigned center = 0; center < buf.m_size; center += halfWinLen)
	{
		Window win;
		win.CreateFromBuffer(buf, (float)center, (float)halfWinLen);

		for (unsigned i = 1; i<halfWinLen * 2; i++)
		{
			fftData[i].Re = (double)win.GetSample(i - halfWinLen);
			fftData[i].Im = 0.0;
		}
		fft(fftData, l);

		for (unsigned i = 0; i < halfWinLen; i++)
		{
			DComp c = fftData[i];
			fft_acc[i] += c.Re*c.Re + c.Im*c.Im;
		}
	}

	for (unsigned i = 0; i < halfWinLen; i++)
	{
		fftData[i].Re = (double)fft_acc[i];
		fftData[i].Im = 0.0;
	}
	ifft(fftData, l);

	unsigned maxi = (unsigned)(-1);

	double lastV = fftData[0].Re;
	double maxV = 0.0f;
	bool ascending = false;

	for (unsigned i = sampleRate / 2000; i < min(sampleRate / 30, halfWinLen); i++)
	{
		double v = fftData[i].Re;
		if (!ascending)
		{
			if (v > lastV) ascending = true;
		}
		else
		{
			if (v < lastV)
			{
				if (fftData[i - 1].Re>maxV)
				{
					maxV = fftData[i - 1].Re;
					maxi = i - 1;
				}
				ascending = false;
			}
		}
		lastV = v;
	}

	float freq = (float)sampleRate / (float)maxi;

	delete[] fft_acc;

	return freq;
}


================================================
FILE: BasicSamplers/FrequencyDetection.h
================================================
#ifndef _FrequencyDetection_h
#define _FrequencyDetection_h

#include <memory.h>
#include <math.h>
#include <vector>

class Buffer
{
	std::vector<float> _data;
public:
	unsigned m_size;
	float* m_data;

	void Allocate(unsigned size)
	{
		_data.resize(size);
		m_size = size;
		m_data = &_data[0];
		SetZero();
	}

	float GetSample(int i) const
	{
		if (i<0 || i >= (int)m_size) return 0.0f;
		return m_data[i];
	}

	void SetZero()
	{
		memset(m_data, 0, sizeof(float)*m_size);
	}

	void SetSample(int i, float v)
	{
		if (i < 0 || i >= (int)m_size) return;
		m_data[i] = v;
	}

	void AddToSample(int i, float v)
	{
		if (i < 0 || i >= (int)m_size) return;
		m_data[i] += v;
	}

	float GetMax()
	{
		float maxv = 0.0f;
		for (size_t i = 0; i < m_size; i++)
		{
			if (fabsf(m_data[i])>maxv) maxv = fabsf(m_data[i]);
		}
		return maxv;
	}

};

float fetchFrequency(const Buffer& buf, unsigned sampleRate);

#endif


================================================
FILE: BasicSamplers/InstrumentMultiSampler.cpp
================================================
#include <math.h>
#include <memory.h>
#include "Sample.h"
#include "InstrumentMultiSampler.h"

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

static void s_generateNoteWave(const InstrumentSample& sample, float* outBuf, unsigned outBufLen, float sampleFreq, float k)
{
	unsigned chn = sample.m_chn;
	float origin_SampleFreq = sample.m_origin_freq / (float)sample.m_origin_sample_rate;
	unsigned maxSample = (unsigned)((float)sample.m_wav_length*origin_SampleFreq / sampleFreq);

	float mult = 1.0f / sample.m_max_v;

	bool interpolation = sampleFreq <= origin_SampleFreq;

	for (unsigned j = 0; j < min(outBufLen, maxSample); j++)
	{
		float wave[2];
		if (interpolation)
		{
			float pos = (float)j *sampleFreq / origin_SampleFreq;
			int ipos1 = (int)pos;
			float frac = pos - (float)ipos1;
			int ipos2 = ipos1 + 1;
			if (ipos2 >= (int)sample.m_wav_length) ipos2 = (int)sample.m_wav_length - 1;

			// linear interpolation
			//wave = m_wav_samples[ipos1] * (1.0f - frac) + m_wav_samples[ipos2] * frac;

			// cubic interpolation
			int ipos0 = ipos1 - 1;
			if (ipos0 < 0) ipos0 = 0;

			int ipos3 = ipos1 + 2;
			if (ipos3 >= (int)sample.m_wav_length) ipos3 = (int)sample.m_wav_length - 1;

			for (unsigned c = 0; c < chn; c++)
			{
				float p0 = sample.m_wav_samples[ipos0*chn + c];
				float p1 = sample.m_wav_samples[ipos1*chn + c];
				float p2 = sample.m_wav_samples[ipos2*chn + c];
				float p3 = sample.m_wav_samples[ipos3*chn + c];

				wave[c] = (-0.5f*p0 + 1.5f*p1 - 1.5f*p2 + 0.5f*p3)*powf(frac, 3.0f) +
					(p0 - 2.5f*p1 + 2.0f*p2 - 0.5f*p3)*powf(frac, 2.0f) +
					(-0.5f*p0 + 0.5f*p2)*frac + p1;
			}

		}
		else
		{
			int ipos1 = (int)ceilf(((float)j - 0.5f)*sampleFreq / origin_SampleFreq);
			int ipos2 = (int)floorf(((float)j + 0.5f)*sampleFreq / origin_SampleFreq);
			if (ipos1 < 0) ipos1 = 0;
			if (ipos2 >= (int)sample.m_wav_length) ipos2 = (int)sample.m_wav_length - 1;
			int count = ipos2 - ipos1 + 1;

			for (unsigned c = 0; c < chn; c++)
			{
				float sum = 0.0f;
				for (int ipos = ipos1; ipos <= ipos2; ipos++)
				{
					sum += sample.m_wav_samples[ipos*chn + c];
				}
				wave[c] = sum / (float)count;
			}
		}

		for (unsigned c = 0; c < chn; c++)
		{
			outBuf[j*chn + c] += k* wave[c] * mult;
		}
	}

}

void InstrumentMultiSample(const std::vector<InstrumentSample>& samples, float* outBuf, unsigned outBufLen, float sampleFreq)
{
	if (samples.size() < 1) return;
	unsigned chn = samples[0].m_chn;

	bool useSingle = false;
	unsigned I;

	{
		const InstrumentSample& wav = samples[0];
		float origin_SampleFreq = wav.m_origin_freq / (float)wav.m_origin_sample_rate;

		if (sampleFreq <= origin_SampleFreq)
		{
			I = 0;
			useSingle = true;
		}
	}

	if (!useSingle)
	{
		const InstrumentSample& wav = samples[samples.size() - 1];
		float origin_SampleFreq = wav.m_origin_freq / (float)wav.m_origin_sample_rate;

		if (sampleFreq >= origin_SampleFreq)
		{
			I = (unsigned)(samples.size() - 1);
			useSingle = true;
		}
	}

	if (!useSingle)
	{
		for (size_t i = 0; i < samples.size() - 1; i++)
		{
			const InstrumentSample& wav = samples[i + 1];
			float origin_SampleFreq = wav.m_origin_freq / (float)wav.m_origin_sample_rate;

			if (sampleFreq == origin_SampleFreq)
			{
				I = (unsigned)(i + 1);
				useSingle = true;
				break;
			}
			else if (sampleFreq < origin_SampleFreq)
			{
				I = (unsigned)i;
				break;
			}
		}
	}
	memset(outBuf, 0, sizeof(float)*outBufLen*chn);
	if (useSingle)
	{
		s_generateNoteWave(samples[I], outBuf, outBufLen, sampleFreq, 1.0f);
	}
	else
	{
		const InstrumentSample& wav1 = samples[I];
		const InstrumentSample& wav2 = samples[I + 1];
		float origin_SampleFreq1 = wav1.m_origin_freq / (float)wav1.m_origin_sample_rate;
		float origin_SampleFreq2 = wav2.m_origin_freq / (float)wav2.m_origin_sample_rate;

		float k2 = logf(sampleFreq / origin_SampleFreq1) / logf(origin_SampleFreq2 / origin_SampleFreq1);
		float k1 = 1.0f - k2;

		s_generateNoteWave(wav1, outBuf, outBufLen, sampleFreq, k1);
		s_generateNoteWave(wav2, outBuf, outBufLen, sampleFreq, k2);
	}

	for (unsigned j = 0; j < outBufLen; j++)
	{
		float x2 = (float)j / (float)outBufLen;
		float amplitude = 1.0f - expf((x2 - 1.0f)*10.0f);

		for (unsigned c = 0; c < chn; c++)
			outBuf[j*chn + c] = amplitude*outBuf[j*chn + c];
	}
}


================================================
FILE: BasicSamplers/InstrumentMultiSampler.h
================================================
#ifndef _InstrumentMultiSampler_h
#define _InstrumentMultiSampler_h

#include <vector>

struct InstrumentSample;
void InstrumentMultiSample(const std::vector<InstrumentSample>& samples, float* outBuf, unsigned outBufLen, float sampleFreq);

#endif


================================================
FILE: BasicSamplers/InstrumentSingleSampler.cpp
================================================
#include <math.h>
#include <memory.h>
#include "Sample.h"
#include "InstrumentSingleSampler.h"

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

void InstrumentSingleSample(const InstrumentSample& sample, float* outBuf, unsigned outBufLen, float sampleFreq)
{
	unsigned chn = sample.m_chn;
	memset(outBuf, 0, sizeof(float)*outBufLen*chn);

	float origin_SampleFreq = sample.m_origin_freq / (float)sample.m_origin_sample_rate;
	unsigned maxSample = (unsigned)((float)sample.m_wav_length*origin_SampleFreq / sampleFreq);

	float mult = 1.0f / sample.m_max_v;

	bool interpolation = sampleFreq <= origin_SampleFreq;

	for (unsigned j = 0; j < min(outBufLen, maxSample); j++)
	{
		float x2 = (float)j / (float)outBufLen;
		float amplitude = 1.0f - expf((x2 - 1.0f)*10.0f);

		float wave[2];
		if (interpolation)
		{
			float pos = (float)j *sampleFreq / origin_SampleFreq;
			int ipos1 = (int)pos;
			float frac = pos - (float)ipos1;
			int ipos2 = ipos1 + 1;
			if (ipos2 >= (int)sample.m_wav_length) ipos2 = (int)sample.m_wav_length - 1;

			// linear interpolation
			//wave = m_wav_samples[ipos1] * (1.0f - frac) + m_wav_samples[ipos2] * frac;

			// cubic interpolation
			int ipos0 = ipos1 - 1;
			if (ipos0 < 0) ipos0 = 0;

			int ipos3 = ipos1 + 2;
			if (ipos3 >= (int)sample.m_wav_length) ipos3 = (int)sample.m_wav_length - 1;

			for (unsigned c = 0; c < chn; c++)
			{
				float p0 = sample.m_wav_samples[ipos0*chn + c];
				float p1 = sample.m_wav_samples[ipos1*chn + c];
				float p2 = sample.m_wav_samples[ipos2*chn + c];
				float p3 = sample.m_wav_samples[ipos3*chn + c];

				wave[c] = (-0.5f*p0 + 1.5f*p1 - 1.5f*p2 + 0.5f*p3)*powf(frac, 3.0f) +
					(p0 - 2.5f*p1 + 2.0f*p2 - 0.5f*p3)*powf(frac, 2.0f) +
					(-0.5f*p0 + 0.5f*p2)*frac + p1;
			}

		}
		else
		{
			int ipos1 = (int)ceilf(((float)j - 0.5f)*sampleFreq / origin_SampleFreq);
			int ipos2 = (int)floorf(((float)j + 0.5f)*sampleFreq / origin_SampleFreq);
			if (ipos1 < 0) ipos1 = 0;
			if (ipos2 >= (int)sample.m_wav_length) ipos2 = (int)sample.m_wav_length - 1;
			int count = ipos2 - ipos1 + 1;

			for (unsigned c = 0; c < chn; c++)
			{
				float sum = 0.0f;
				for (int ipos = ipos1; ipos <= ipos2; ipos++)
				{
					sum += sample.m_wav_samples[ipos*chn + c];
				}
				wave[c] = sum / (float)count;
			}
		}

		for (unsigned c = 0; c < chn; c++)
		{
			outBuf[j*chn + c] = amplitude*wave[c] * mult;
		}
	}

}


================================================
FILE: BasicSamplers/InstrumentSingleSampler.h
================================================
#ifndef _InstrumentSingleSampler_h
#define _InstrumentSingleSampler_h

struct InstrumentSample;
void InstrumentSingleSample(const InstrumentSample& sample, float* outBuf, unsigned outBufLen, float sampleFreq);

#endif


================================================
FILE: BasicSamplers/PercussionSampler.cpp
================================================
#include <math.h>
#include <memory.h>
#include "Sample.h"
#include "PercussionSampler.h"

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

void PercussionSample(const Sample& sample, float* outBuf, unsigned outBufLen, float sampleRatio)
{
	unsigned chn = sample.m_chn;
	memset(outBuf, 0, sizeof(float)*outBufLen*chn);

	unsigned maxSample = (unsigned)((float)sample.m_wav_length*sampleRatio);
	float mult = 1.0f / sample.m_max_v;

	if (sampleRatio==1.0f)
	{
		for (unsigned j = 0; j < min(outBufLen, maxSample); j++)
		{
			float x2 = (float)j / (float)outBufLen;
			float amplitude = 1.0f - expf((x2 - 1.0f)*10.0f);

			for (unsigned c = 0; c < chn; c++)
			{
				outBuf[j * chn + c] = amplitude*sample.m_wav_samples[j * chn + c] * mult;
			}
		}
	}
	else
	{
		bool interpolation = sampleRatio > 1.0f;
		float inv_sampleRatio = 1.0f / sampleRatio;
		for (unsigned j = 0; j < min(outBufLen, maxSample); j++)
		{
			float x2 = (float)j / (float)outBufLen;
			float amplitude = 1.0f - expf((x2 - 1.0f)*10.0f);

			float wave[2];
			if (interpolation)
			{
				float pos = (float)j *inv_sampleRatio;
				int ipos1 = (int)pos;
				float frac = pos - (float)ipos1;
				int ipos2 = ipos1 + 1;
				if (ipos2 >= (int)sample.m_wav_length) ipos2 = (int)sample.m_wav_length - 1;

				// cubic interpolation
				int ipos0 = ipos1 - 1;
				if (ipos0 < 0) ipos0 = 0;

				int ipos3 = ipos1 + 2;
				if (ipos3 >= (int)sample.m_wav_length) ipos3 = (int)sample.m_wav_length - 1;

				for (unsigned c = 0; c < chn; c++)
				{
					float p0 = sample.m_wav_samples[ipos0*chn + c];
					float p1 = sample.m_wav_samples[ipos1*chn + c];
					float p2 = sample.m_wav_samples[ipos2*chn + c];
					float p3 = sample.m_wav_samples[ipos3*chn + c];

					wave[c] = (-0.5f*p0 + 1.5f*p1 - 1.5f*p2 + 0.5f*p3)*powf(frac, 3.0f) +
						(p0 - 2.5f*p1 + 2.0f*p2 - 0.5f*p3)*powf(frac, 2.0f) +
						(-0.5f*p0 + 0.5f*p2)*frac + p1;

				}

			}
			else
			{
				int ipos1 = (int)ceilf(((float)j - 0.5f)*inv_sampleRatio);
				int ipos2 = (int)floorf(((float)j + 0.5f)*inv_sampleRatio);
				if (ipos1 < 0) ipos1 = 0;
				if (ipos2 >= (int)sample.m_wav_length) ipos2 = (int)sample.m_wav_length - 1;
				int count = ipos2 - ipos1 + 1;

				for (unsigned c = 0; c < chn; c++)
				{
					float sum = 0.0f;
					for (int ipos = ipos1; ipos <= ipos2; ipos++)
					{
						sum += sample.m_wav_samples[ipos*chn + c];
					}
					wave[c] = sum / (float)count;
				}
			}
			for (unsigned c = 0; c < chn; c++)
			{
				outBuf[j*chn + c] = amplitude*wave[c] * mult;
			}
		}

	}

}



================================================
FILE: BasicSamplers/PercussionSampler.h
================================================
#ifndef _PercussionSampler_h
#define _PercussionSampler_h

struct Sample;
void PercussionSample(const Sample& sample, float* outBuf, unsigned outBufLen, float sampleRatio);

#endif


================================================
FILE: BasicSamplers/Sample.h
================================================
#pragma once

struct Sample
{
	Sample() {}
	virtual ~Sample() {}

	unsigned m_wav_length;
	unsigned m_chn;
	float *m_wav_samples;
	float m_max_v;
	unsigned m_origin_sample_rate;
};

struct InstrumentSample : public Sample
{
	float m_origin_freq;
};




================================================
FILE: BasicSamplers/api.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif

extern "C"
{
	SCOREDRAFT_API void* SampleCreate(unsigned origin_sample_rate, unsigned chn, void* ptr_f32_buf, float max_v);
	SCOREDRAFT_API void* InstrumentSampleCreate(unsigned origin_sample_rate, unsigned chn, void* ptr_f32_buf, float max_v, float origin_freq);
	SCOREDRAFT_API void SampleDestroy(void *ptr);
	SCOREDRAFT_API void PercussionGenerate(void* ptr_wavbuf, void* ptr_sample, float fduration);
	SCOREDRAFT_API void InstrumentSingleGenerate(void* ptr_wavbuf, void* ptr_sample, float freq, float fduration);
	SCOREDRAFT_API void InstrumentMultiGenerate(void* ptr_wavbuf, void* ptr_sample_lst, float freq, float fduration);
}

#include <algorithm>
#include <utils.h>
#include "Sample.h"
#include "FrequencyDetection.h"
#include "PercussionSampler.h"
#include "InstrumentSingleSampler.h"
#include "InstrumentMultiSampler.h"

void CreateSample(Sample* sample, unsigned origin_sample_rate, unsigned chn, void* ptr_f32_buf, float max_v)
{
	F32Buf* buf = (F32Buf*)ptr_f32_buf;	
	if (max_v <= 0.0f)
	{
		max_v = 0.0f;
		for (size_t i = 0; i < buf->size(); i++)
		{
			float v = fabsf((*buf)[i]);
			if (v > max_v) max_v = v;
		}
	}

	sample->m_wav_length = (unsigned)buf->size()/chn;
	sample->m_chn = chn;
	sample->m_wav_samples = buf->data();
	sample->m_max_v = max_v;
	sample->m_origin_sample_rate = origin_sample_rate;		
}

void* SampleCreate(unsigned origin_sample_rate, unsigned chn, void* ptr_f32_buf, float max_v)
{
	Sample* sample = new Sample;
	CreateSample(sample, origin_sample_rate, chn, ptr_f32_buf, max_v);
	return sample;
}


static float s_DetectBaseFreq(const Sample& sample)
{
	float* localMono = nullptr;
	float* pSamples = nullptr;

	if (sample.m_chn == 1)
	{
		pSamples = sample.m_wav_samples;
	}
	else if (sample.m_chn == 2)
	{
		localMono = new float[sample.m_wav_length];
		pSamples = localMono;
		for (unsigned i = 0; i < sample.m_wav_length; i++)
		{
			localMono[i] = 0.5f*(sample.m_wav_samples[i * 2] + sample.m_wav_samples[i * 2 + 1]);
		}
	}
	Buffer buf;
	buf.m_size = sample.m_wav_length;
	buf.m_data = pSamples;
	float baseFreq = fetchFrequency(buf, sample.m_origin_sample_rate);
	delete[] localMono;

	return baseFreq;
}


void* InstrumentSampleCreate(unsigned origin_sample_rate, unsigned chn, void* ptr_f32_buf, float max_v, float origin_freq)
{
	InstrumentSample* sample = new InstrumentSample;
	CreateSample(sample, origin_sample_rate, chn, ptr_f32_buf, max_v);
	if (origin_freq <= 0.0f)
	{
		sample->m_origin_freq = s_DetectBaseFreq(*sample);
	}
	else
	{
		sample->m_origin_freq = origin_freq;
	}
	return sample;
}

void SampleDestroy(void *ptr)
{
	delete (Sample*)ptr;
}

void PercussionGenerate(void* ptr_wavbuf, void* ptr_sample, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	Sample* sample = (Sample*)ptr_sample;

	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	
	wavbuf->Allocate(sample->m_chn, len);

	PercussionSample(*sample, wavbuf->m_data, (unsigned)len, sampleRate / (float)sample->m_origin_sample_rate);
}

void InstrumentSingleGenerate(void* ptr_wavbuf, void* ptr_sample, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	InstrumentSample* sample = (InstrumentSample*)ptr_sample;

	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(sample->m_chn, len);

	InstrumentSingleSample(*sample, wavbuf->m_data, (unsigned)len, sampleFreq);
}

static int compareSampleWav(const void* a, const void* b)
{
	InstrumentSample& wavA = *((InstrumentSample*)a);
	InstrumentSample& wavB = *((InstrumentSample*)b);

	float origin_SampleFreqA = wavA.m_origin_freq / (float)wavA.m_origin_sample_rate;
	float origin_SampleFreqB = wavB.m_origin_freq / (float)wavB.m_origin_sample_rate;

	return origin_SampleFreqA > origin_SampleFreqB ? 1 : -1;
}

void InstrumentMultiGenerate(void* ptr_wavbuf, void* ptr_sample_lst, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	PtrArray* sampleList = (PtrArray*)ptr_sample_lst;	

	unsigned chn = 0;
	std::vector<InstrumentSample> samples;
	for (size_t i = 0; i < sampleList->size(); i++)
	{		
		InstrumentSample* sample = (InstrumentSample*)(*sampleList)[i];	

		if (i == 0)
			chn = sample->m_chn;
		else
			if (chn != sample->m_chn)
			{
				printf("All samples does not have the same number of channels\n");
				return;
			}

		samples.push_back(*sample);
	}
	std::qsort(samples.data(), samples.size(), sizeof(InstrumentSample), compareSampleWav);

	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(chn, len);

	InstrumentMultiSample(samples, wavbuf->m_data, (unsigned)len, sampleFreq);
}


================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)
project(ScoreDraft)

IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  SET(CMAKE_INSTALL_PREFIX  ../Test CACHE PATH "Install path" FORCE)
ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

add_subdirectory(ScoreDraftCore)
add_subdirectory(SimpleInstruments)
add_subdirectory(KarplusStrong)
add_subdirectory(BasicSamplers)
add_subdirectory(SoundFont2)
add_subdirectory(VoiceSampler)

add_subdirectory(MIDIWriter)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_subdirectory(thirdparty/portaudio)
add_subdirectory(thirdparty/glfw)
# add_subdirectory(thirdparty/glew)

add_subdirectory(PCMPlayer)
add_subdirectory(Meteor)

add_subdirectory(python)


================================================
FILE: DSPUtil/complex.cpp
================================================
#include <math.h>
#include "stdio.h"
#include "complex.h"

double DCEnergy(const DComp* c)
{
	return c->Im*c->Im + c->Re*c->Re;
}

double DCAbs(const DComp* c)
{
	return sqrt(c->Im*c->Im+c->Re*c->Re);
}
double DCAng(const DComp* c)
{
	return atan2(c->Im,c->Re);
}
void DCSetAA(DComp* c,double Abs,double Ang)
{
	c->Re=Abs*cos(Ang);
	c->Im=Abs*sin(Ang);
}
void DCConjugate(DComp* c,const DComp* c1)
{
	c->Re=c1->Re;
	c->Im=-c1->Im;
}

void DCAdd(DComp* c,const DComp* c1,const DComp* c2)
{
	c->Re=c1->Re+c2->Re;
	c->Im=c1->Im+c2->Im;
}
void DCSub(DComp* c,const DComp* c1,const DComp* c2)
{
	c->Re=c1->Re-c2->Re;
	c->Im=c1->Im-c2->Im;
}
void DCMul(DComp* c,const DComp* c1,const DComp* c2)
{
	DComp temp;
	temp.Re=c1->Re*c2->Re-c1->Im*c2->Im;
	temp.Im=c1->Re*c2->Im+c1->Im*c2->Re;
	*c=temp;
}
void DCCW90(DComp* c,const DComp* c1)
{
	DComp temp;
	temp.Im=c1->Re;
	temp.Re=-c1->Im;
	*c=temp;
}
void DCCCW90(DComp* c,const DComp* c1)
{
	DComp temp;
	temp.Im=-c1->Re;
	temp.Re=c1->Im;
	*c=temp;
}
void DCPowN(DComp* c,const DComp* c1,int n)
{
	DCSetAA(c,pow(DCAbs(c1),n),DCAng(c1)*n);
}
void DCPrint(const DComp *c,FILE* f)
{
	if (c->Im==0) fprintf(f,"%g",c->Re);
	if (c->Im>0) fprintf(f,"%g+%gj",c->Re,c->Im);
	if (c->Im<0) fprintf(f,"%g%gj",c->Re,c->Im);
}

================================================
FILE: DSPUtil/complex.h
================================================
#ifndef YF_COMPLEX
#define YF_COMPLEX
typedef struct
{
	double Re;
	double Im;
}DComp;
double DCEnergy(const DComp* c);
double DCAbs(const DComp*);
double DCAng(const DComp*);
void DCSetAA(DComp*,double,double);
void DCConjugate(DComp*,const DComp*);
void DCAdd(DComp*,const DComp*,const DComp*);
void DCSub(DComp*,const DComp*,const DComp*);
void DCMul(DComp*,const DComp*,const DComp*);
void DCCW90(DComp*,const DComp*);
void DCCCW90(DComp*,const DComp*);
void DCPowN(DComp*,const DComp*,int n);
#endif

================================================
FILE: DSPUtil/fft.cpp
================================================
#include "fft.h"
#include "math.h"
void fft(DComp *a,unsigned l)
{
	DComp u,w,t;	
	unsigned n=1,nv2,i,j,k;
	unsigned le,lei,ip,m;
	double tmp;
	n<<=l;
	nv2=n>>1;
	j=0;
	for (i=0;i<n-1;i++)
	{
		if (i<j)
		{
			t=a[j];
			a[j]=a[i];
			a[i]=t;
		}
		k=nv2;
		while (k<=j)
		{
			j-=k;
			k>>=1;
		}
		j+=k;
	}
	le=1;
	for(m=1;m<=l;m++)
	{
		lei=le;
		le<<=1;
		u.Re=1;	u.Im=0;
		tmp=PI/lei;
		w.Re=cos(tmp); w.Im=-sin(tmp);
		for (j=0;j<lei;j++)
		{
			for (i=j;i<n;i+=le)
			{
				ip=i+lei;
				DCMul(&t,&u,a+ip);
				DCSub(a+ip,a+i,&t);
				DCAdd(a+i,a+i,&t);
			}
			DCMul(&u,&u,&w);
		}
	}
}
void ifft(DComp *a,unsigned l)
{
	DComp u,w,t;	
	unsigned n=1,nv2,i,j,k;
	unsigned le,lei,ip,m;
	double tmp;
	n<<=l;
	nv2=n>>1;
	j=0;
	for (i=0;i<n-1;i++)
	{
		if (i<j)
		{
			t=a[j];
			a[j]=a[i];
			a[i]=t;
		}
		k=nv2;
		while (k<=j)
		{
			j-=k;
			k>>=1;
		}
		j+=k;
	}
	le=1;
	for(m=1;m<=l;m++)
	{
		lei=le;
		le<<=1;
		u.Re=0.5;	u.Im=0;
		tmp=PI/lei;
		w.Re=cos(tmp); w.Im=sin(tmp);
		for (j=0;j<lei;j++)
		{
			for (i=j;i<n;i+=le)
			{
				ip=i+lei;
				DCMul(&t,&u,a+ip);
				(a+i)->Im*=0.5;
				(a+i)->Re*=0.5;
				DCSub(a+ip,a+i,&t);
				DCAdd(a+i,a+i,&t);
			}
			DCMul(&u,&u,&w);
		}
	}
}

================================================
FILE: DSPUtil/fft.h
================================================
#ifndef YF_FFT
#define YF_FFT
#include "complex.h"
#define PI 3.1415926535897932384626433832795
void fft(DComp *a,unsigned l);
void ifft(DComp *a,unsigned l);
#endif

================================================
FILE: KarplusStrong/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(KarplusStrong)

set (INCLUDE_DIR
../ScoreDraftCore
../DSPUtil
)


if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)
endif()

include_directories(${INCLUDE_DIR})
add_definitions(${DEFINES})
add_library (KarplusStrong SHARED KarplusStrong.cpp ../DSPUtil/complex.cpp ../DSPUtil/fft.cpp)
target_link_libraries(KarplusStrong ScoreDraftCore)

if (WIN32) 
target_compile_definitions(KarplusStrong PUBLIC SCOREDRAFTCORE_DLL_IMPORT)
endif()

if (WIN32) 
install(TARGETS KarplusStrong RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS KarplusStrong DESTINATION ScoreDraft)
endif()



================================================
FILE: KarplusStrong/KarplusStrong.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif

extern "C"
{
	SCOREDRAFT_API void KarplusStrongGenerate(void* ptr_wavbuf, float freq, float fduration, float cut_freq, float loop_gain, float sustain_gain);
}

#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <WavBuffer.h>
#include <vector>
#include "fft.h"

inline float rand01()
{
	float f = (float)rand() / (float)RAND_MAX;
	if (f < 0.0000001f) f = 0.0000001f;
	if (f > 0.9999999f) f = 0.9999999f;
	return f;
}

inline void GeneratePinkNoise(float period, std::vector<float>& buf)
{
	unsigned uLen = (unsigned)ceilf(period);
	unsigned l = 0;
	unsigned fftLen = 1;
	while (fftLen < uLen)
	{
		fftLen <<= 1;
		l++;
	}

	std::vector<DComp> fftData(fftLen);
	memset(&fftData[0], 0, sizeof(DComp)*fftLen);

	for (unsigned i = 1; i < (unsigned)(period) / 2; i++)
	{
		float amplitude = (float)fftLen / sqrtf((float)i);
		float phase = rand01()*(float)(2.0*PI);
		fftData[i].Re = (double)(amplitude*cosf(phase));
		fftData[i].Im = (double)(amplitude*sinf(phase));

		fftData[fftLen - i].Re = fftData[i].Re;
		fftData[fftLen - i].Im = -fftData[i].Im;
	}

	ifft(&fftData[0], l);

	unsigned pnLen = (unsigned)ceilf(period*2.0f);	
	buf.resize(pnLen);

	float rate = (float)fftLen / period;
	for (unsigned i = 0; i < pnLen; i++)
	{
		int ipos1 = (int)ceilf(((float)i - 0.5f)*rate);
		if (ipos1 < 0) ipos1 = 0;
		int ipos2 = (int)floorf(((float)i + 0.5f)*rate);
		int count = ipos2 - ipos1 + 1;

		float sum = 0.0f;
		for (int ipos = ipos1; ipos <= ipos2; ipos++)
		{
			int _ipos = ipos;
			while (_ipos >= fftLen) _ipos -= fftLen;
			sum += (float)fftData[_ipos].Re;
		}
		buf[i] = sum / (float)count;
	}	
}

void KarplusStrongGenerate(void* ptr_wavbuf, float freq, float fduration, float cut_freq, float loop_gain, float sustain_gain)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float sustain_periods = logf(0.01f) / logf(sustain_gain);
	float fNumOfSamples = fduration * sampleRate*0.001f;

	float period = sampleRate / freq;
	std::vector<float> pinkNoise;
	GeneratePinkNoise(period, pinkNoise);

	float sustainLen = sustain_periods * period;
	size_t totalLen = (size_t)ceilf(fNumOfSamples + sustainLen);
	wavbuf->Allocate(1, totalLen);	

	cut_freq = cut_freq / 261.626f* freq;
	float a = (float)(1.0 - exp(-2.0*PI* cut_freq / sampleRate));

	unsigned pos = 0;
	while (pos < totalLen)
	{
		float value = 0.0f;
		if ((float)pos < period*2.0f)
			value += pinkNoise[pos] * 0.5f*(cosf(((float)pos - period) / period * PI) + 1.0f);

		if ((float)pos >= period)
		{
			float gain = (float)pos < fNumOfSamples ? loop_gain : sustain_gain;

			float refPos = (float)pos - period;

			int refPos1 = (int)refPos;
			int refPos2 = refPos1 + 1;
			float frac = refPos - (float)refPos1;

			// linear interpolation
			float ref = wavbuf->m_data[refPos1] * (1.0f - frac) + wavbuf->m_data[refPos2] * frac;

			value += gain * a*ref + (1.0f - a)*wavbuf->m_data[pos - 1];
		}


		wavbuf->m_data[pos] = value;
		pos++;
	}
}



================================================
FILE: LICENSE
================================================
Copyright (C) 2018 - 2021 Fei Yang

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Acknowledgements

Source code under /SoundFont2 is based on 
TinySoundFont, Copyright (C) 2017 Bernhard Schelling (https://github.com/schellingb/TinySoundFont)

Noto Sans Font: /thirdparty/fonts/NotoSansSC-Bold.otf
Licensed under the Open Font License (https://fonts.google.com/noto/specimen/Noto+Sans+SC)

FreeType: /thirdparty/freetype
Licensed: https://gitlab.freedesktop.org/freetype/freetype/-/blob/master/docs/FTL.TXT

GLFW: /thirdparty/glfw
Licensed: https://www.glfw.org/license.html

PortAudio: /thirdparty/portaudio
Licensed: http://www.portaudio.com/license.html

Audio Samples
From https://freewavesamples.com



================================================
FILE: MIDIWriter/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(MIDIWriter)

if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++14)
add_compile_options(-fPIC)
endif()

include_directories(${INCLUDE_DIR})
add_definitions(${DEFINES})
add_library (MIDIWriter SHARED MIDIWriter.cpp)

if (WIN32) 
install(TARGETS MIDIWriter RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS MIDIWriter DESTINATION ScoreDraft)
endif()



================================================
FILE: MIDIWriter/MIDIWriter.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif

extern "C"
{
	SCOREDRAFT_API void* NoteCreate(float freq_rel, int duration);
	SCOREDRAFT_API void NoteDestroy(void* ptr);
	SCOREDRAFT_API void* WriteToMidi(void* ptr_seq_list, unsigned tempo, float refFreq, const char* fileName);
}

#include <cstdio>
#include <cmath>
#include <vector>

inline void ByteSwap(unsigned short& word)
{
	unsigned short a = word & 0xFF;
	a <<= 8;
	word >>= 8;
	word |= a;
}

inline void ByteSwap(unsigned& word)
{
	unsigned a = word & 0xFF;
	a <<= 24;
	word >>= 8;
	unsigned b = word & 0xFF;
	b <<= 16;
	word >>= 8;
	unsigned c = word & 0xFF;
	c <<= 8;
	word |= a | b | c;
}

inline void ToVariableLength(unsigned fixed, unsigned& variable, unsigned& bytes)
{
	variable = 0;
	bytes = 1;
	unsigned mask = 0;
	while (fixed)
	{
		variable += (fixed & 0x7F) | mask;
		fixed >>= 7;
		if (fixed)
		{
			variable <<= 8;
			bytes++;
			mask = 0x80;
		}
	}
}


inline void WriteBigEdianWord(FILE *fp, unsigned short aword)
{
	ByteSwap(aword);
	fwrite(&aword, 2, 1, fp);
}

inline void WriteBigEdianDWord(FILE *fp, unsigned int adword)
{
	ByteSwap(adword);
	fwrite(&adword, 4, 1, fp);
}

inline void WriteVariableLengthDWord(FILE *fp, unsigned fixeddword)
{
	unsigned variable;
	unsigned bytes;
	ToVariableLength(fixeddword, variable, bytes);
	fwrite(&variable, 1, bytes, fp);
}


struct Note
{
	float m_freq_rel = -1.0f;
	int m_duration = 48;
};

void* NoteCreate(float freq_rel, int duration)
{
	return new Note({ freq_rel, duration });
}

void NoteDestroy(void* ptr)
{
	delete (Note*)ptr;
}

struct NoteEvent
{
	bool isOn;
	unsigned time;
	unsigned char note;
};

typedef std::vector<NoteEvent> NoteEventList;

inline void AddNoteEvent(NoteEventList& list, const NoteEvent& nevent)
{
	if (list.empty() || (list.end() - 1)->time <= nevent.time)
	{
		list.push_back(nevent);
		return;
	}

	NoteEventList::iterator it = list.end() - 1;
	while (it != list.begin() && (it - 1)->time > nevent.time) it--;
	list.insert(it, nevent);
}


#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

#define TIME_DIVISION 48

void* WriteToMidi(void* ptr_seq_list, unsigned tempo, float refFreq, const char* fileName)
{
	std::vector<std::vector<Note*>*>* seqList = (std::vector<std::vector<Note*>*>*)ptr_seq_list;
	size_t numOfTracks = seqList->size();

	FILE *fp = fopen(fileName, "wb");
	fwrite("MThd", 1, 4, fp);

	WriteBigEdianDWord(fp, 6);
	WriteBigEdianWord(fp, 1);
	WriteBigEdianWord(fp, (unsigned short)numOfTracks);
	WriteBigEdianWord(fp, TIME_DIVISION);

	unsigned timeFactor = TIME_DIVISION / 48;

	//pitch shift
	float pitchShift = logf(refFreq / 261.626f)*12.0f / logf(2.0f) + 0.5f;
	unsigned maxTrackLength = 0;
	for (unsigned i = 0; i < numOfTracks; i++)
	{
		const std::vector<Note*>& seq = *(*seqList)[i];

		fwrite("MTrk", 1, 4, fp);
		WriteBigEdianDWord(fp, 0); // trackLength;

		unsigned beginPoint = ftell(fp);

		unsigned char aByte;

		//Tempo Event	
		WriteVariableLengthDWord(fp, 0);
		aByte = 0xff;
		fwrite(&aByte, 1, 1, fp);
		aByte = 0x51;
		fwrite(&aByte, 1, 1, fp);
		aByte = 3;
		fwrite(&aByte, 1, 1, fp);

		unsigned theTempo = 60000000 / tempo;
		aByte = (theTempo & 0xff0000) >> 16;
		fwrite(&aByte, 1, 1, fp);
		aByte = (theTempo & 0xff00) >> 8;
		fwrite(&aByte, 1, 1, fp);
		aByte = theTempo & 0xff;
		fwrite(&aByte, 1, 1, fp);

		//Note Events
		NoteEventList elist;

		unsigned timeTicks = 0;
		unsigned j;
		for (j = 0; j < seq.size(); j++)
		{
			NoteEvent nevent;
			if (seq[j]->m_freq_rel < 0.0f)
				timeTicks += seq[j]->m_duration*timeFactor;
			else if (seq[j]->m_freq_rel > 0.0f)
			{
				nevent.isOn = true;
				nevent.time = timeTicks;
				nevent.note = (unsigned char)(logf(seq[j]->m_freq_rel)*12.0f / logf(2.0f) + 60.0f + pitchShift);
				AddNoteEvent(elist, nevent);

				timeTicks += seq[j]->m_duration*timeFactor;
				nevent.isOn = false;
				nevent.time = timeTicks;
				AddNoteEvent(elist, nevent);
			}
		}
		maxTrackLength = max(maxTrackLength, timeTicks);

		timeTicks = 0;
		for (j = 0; j < elist.size(); j++)
		{
			unsigned start = elist[j].time - timeTicks;
			timeTicks = elist[j].time;
			WriteVariableLengthDWord(fp, start);

			if (elist[j].isOn)
				aByte = 0x90;
			else
				aByte = 0x80;
			fwrite(&aByte, 1, 1, fp);

			aByte = elist[j].note;
			fwrite(&aByte, 1, 1, fp);

			aByte = 64;
			fwrite(&aByte, 1, 1, fp);
		}

		//// End of Track
		aByte = 0;
		fwrite(&aByte, 1, 1, fp);
		aByte = 0xff;
		fwrite(&aByte, 1, 1, fp);
		aByte = 0x2f;
		fwrite(&aByte, 1, 1, fp);
		aByte = 0;
		fwrite(&aByte, 1, 1, fp);

		//////////////////////////

		unsigned length = ftell(fp) - beginPoint;
		fseek(fp, beginPoint - 4, SEEK_SET);
		WriteBigEdianDWord(fp, length);
		fseek(fp, length, SEEK_CUR);
	}

	fclose(fp);
}



================================================
FILE: Meteor/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(Meteor)

set(SOURCES
api.cpp
Meteor.cpp
MeteorPlayer.cpp
DrawText.cpp
)

set(HEADERS 
SubListLookUp.h
Meteor.h
MeteorPlayer.h
DrawText.h
base64.hpp
blob.hpp
)


set (INCLUDE_DIR
../ScoreDraftCore
../thirdparty/portaudio/include
../thirdparty/glfw/include
../thirdparty/fonts
)


if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)

set (INCLUDE_DIR
${INCLUDE_DIR}
../thirdparty/freetype/include/freetype2
)

set (LIB_DIR
../thirdparty/freetype/lib/
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)

set (INCLUDE_DIR
${INCLUDE_DIR}
/usr/include/freetype2
)
endif()

include_directories(${INCLUDE_DIR})
link_directories(${LIB_DIR})
add_definitions(${DEFINES})
add_library (Meteor SHARED  ${SOURCES} ${HEADERS})
target_link_libraries(Meteor ScoreDraftCore portaudio_static glfw freetype)

if (WIN32) 
target_link_libraries(Meteor opengl32)
else()
target_link_libraries(Meteor GL)
endif()

if (WIN32) 
target_compile_definitions(Meteor PUBLIC SCOREDRAFTCORE_DLL_IMPORT)
endif()

if (WIN32) 
install(TARGETS Meteor RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS Meteor DESTINATION ScoreDraft)
endif()



================================================
FILE: Meteor/DrawText.cpp
================================================
#include "DrawText.h"

#include <ft2build.h>
#include FT_FREETYPE_H

#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <unordered_map>
#include <algorithm>

#include "NotoSansSC-Bold.hpp"

inline bool exists_test(const char* name)
{
	if (FILE *file = fopen(name, "r"))
	{
		fclose(file);
		return true;
	}
	else
	{
		return false;
	}
}


class LibHolder
{
public:
	static LibHolder& singlton()
	{
		thread_local static LibHolder* lh = nullptr;
		if (lh == nullptr)
		{
			lh = new LibHolder;
		}
		return *lh;
	}

	FT_Library get_library() const
	{
		return m_library;
	}

	void add_face(const std::string& name, const std::string& path_ttf)
	{
		FT_New_Face(m_library, path_ttf.c_str(), 0, &m_faces[name]);
	}

	void set_current_face(const std::string& name)
	{
		m_name_current_face = name;
	}

	FT_Face get_face(const std::string& name = "") const
	{
		std::string fnt_name = name;
		if (fnt_name == "") fnt_name = m_name_current_face;
		auto iter = m_faces.find(fnt_name);
		if (iter == m_faces.end())
		{
			return m_faces.begin()->second;
		}
		else
		{
			return iter->second;
		}
	}

private:
	FT_Library  m_library;
	std::unordered_map<std::string, FT_Face>  m_faces;
	std::string m_name_current_face;

	LibHolder()
	{
		FT_Init_FreeType(&m_library);
		FT_New_Memory_Face(m_library, (const FT_Byte*)noto_sans_bold, noto_sans_bold_size, 0, &m_faces["noto_sans_bold"]);
	}

	~LibHolder()
	{
		for (auto iter = m_faces.begin(); iter != m_faces.end(); iter++)
		{
			FT_Done_Face(iter->second);
		}
		FT_Done_FreeType(m_library);
	}
};

#define FT_LIB LibHolder::singlton().get_library()
#define FT_FACE LibHolder::singlton().get_face()

void FTAddFont(const std::string& name, const std::string& path_ttf)
{
	LibHolder::singlton().add_face(name, path_ttf);
}

void FTSetCurrentFont(const std::string& name)
{
	LibHolder::singlton().set_current_face(name);
}

std::wstring UTF8_to_wchar(const char * in)
{
	std::wstring out;
	unsigned int codepoint;
	while (*in != 0)
	{
		unsigned char ch = static_cast<unsigned char>(*in);
		if (ch <= 0x7f)
			codepoint = ch;
		else if (ch <= 0xbf)
			codepoint = (codepoint << 6) | (ch & 0x3f);
		else if (ch <= 0xdf)
			codepoint = ch & 0x1f;
		else if (ch <= 0xef)
			codepoint = ch & 0x0f;
		else
			codepoint = ch & 0x07;
		++in;
		if (((*in & 0xc0) != 0x80) && (codepoint <= 0x10ffff))
		{
			if (sizeof(wchar_t) > 2)
				out.append(1, static_cast<wchar_t>(codepoint));
			else if (codepoint > 0xffff)
			{
				out.append(1, static_cast<wchar_t>(0xd800 + (codepoint >> 10)));
				out.append(1, static_cast<wchar_t>(0xdc00 + (codepoint & 0x03ff)));
			}
			else if (codepoint < 0xd800 || codepoint >= 0xe000)
				out.append(1, static_cast<wchar_t>(codepoint));
		}
	}
	return out;
}


struct Character
{
	int width = 0;
	int height = 0;
	int offset_x = 0;
	int offset_y = 0;
	std::vector<unsigned char> data;
};


Text::Text(const char* text, int size)
{
	std::wstring wtext = UTF8_to_wchar(text);
	size_t total_chars = wtext.size();

	FT_Set_Char_Size(FT_FACE, 0, size * 64, 72, 72);
	FT_GlyphSlot slot = FT_FACE->glyph;
	std::vector<Character> characters(total_chars);

	int min_x = 0x7FFFFFFF;
	int max_x = 0x80000000;
	int min_y = 0x7FFFFFFF;
	int max_y = 0x80000000;

	int off_x = 0;
	int off_y = size;

	for (size_t j = 0; j < total_chars; j++)
	{
		wchar_t c = wtext[j];
		FT_Load_Char(FT_FACE, c, FT_LOAD_DEFAULT);
		FT_Render_Glyph(slot, FT_RENDER_MODE_NORMAL);
		Character& character = characters[j];
		character.offset_x = off_x + slot->bitmap_left;
		character.offset_y = off_y - slot->bitmap_top;
		character.width = (int)slot->bitmap.width;
		character.height = (int)slot->bitmap.rows;
		character.data.resize(character.width*character.height);
		if (character.width > 0 && character.height > 0)
			memcpy(character.data.data(), slot->bitmap.buffer, character.width*character.height);
		if (character.offset_x < min_x) min_x = character.offset_x;
		if (character.offset_y < min_y) min_y = character.offset_y;
		if (character.offset_x + character.width > max_x) max_x = character.offset_x + character.width;
		if (character.offset_y + character.height > max_y) max_y = character.offset_y + character.height;
		off_x += (slot->advance.x >> 6);
		off_y += slot->advance.y >> 6;
	}

	m_width = max_x - min_x;
	m_height = max_y - min_y;
	m_offset_x = min_x;
	m_offset_y = min_y;
	m_data.resize(m_width*m_height, 0);

	for (size_t i = 0; i < total_chars; i++)
	{
		const Character& character = characters[i];
		int off_x = character.offset_x - m_offset_x;
		int off_y = character.offset_y - m_offset_y;

		for (int y = 0; y < character.height; y++)
		{
			for (int x = 0; x < character.width; x++)
			{
				int pos_x = x + off_x;
				int pos_y = y + off_y;
				m_data[pos_x + pos_y * m_width] = character.data[x + y * character.width];
			}
		}
	}	
}

Text::~Text()
{

}



================================================
FILE: Meteor/DrawText.h
================================================
#pragma once

#include <vector>

class Text
{
public:
	Text(const char* text, int size = 32);
	~Text();

	int m_width = 0;
	int m_height = 0;
	int m_offset_x = 0;
	int m_offset_y = 0;
	std::vector<unsigned char> m_data;
};


================================================
FILE: Meteor/Meteor.cpp
================================================
#include "Meteor.h"
#include "blob.hpp"
#include "base64.hpp"

void Meteor::_updateSublists()
{
	m_notes_sublists.SetData(m_notes, 3.0f);
	m_beats_sublists.SetData(m_beats, 3.0f);
	m_singing_sublists.SetData(m_singings, 3.0f);
	m_needUpdateSublists = false;
}

void Meteor::InstEvent(EventInst& e)
{
	VisNote note;
	note.instrumentId = e.instrument_id;
	double freq = e.freq;		
	note.pitch = (int)floor(log(freq / 261.626)*12.0 / log(2.0) + 0.5);
	note.start = e.offset / 1000.0f;
	note.end = note.start + e.fduration / 1000.0f;
	m_notes.push_back(note);
	m_needUpdateSublists = true;
}

void Meteor::PercEvent(EventPerc& e)
{
	VisBeat beat;
	beat.percId = e.instrument_id;
	beat.start = e.offset / 1000.0f;
	beat.end = beat.start + e.fduration / 1000.0;
	m_beats.push_back(beat);
	m_needUpdateSublists = true;
}

void Meteor::SingEvent(EventSing& e)
{
	unsigned id = e.instrument_id;	
	unsigned count = (unsigned)e.syllableList.size();
	double pos = e.offset / 1000.0f;
	for (unsigned i = 0; i < count; i++)
	{
		Syllable& syllable = e.syllableList[i];

		VisSinging sing;
		sing.singerId = id;
		sing.lyric = syllable.lyric;
		sing.start = (float)pos;
		
		std::vector<CtrlPnt>& ctrlPnts = syllable.ctrlPnts;
		unsigned num_ctrlPnts = (unsigned)ctrlPnts.size();

		double totalLen = 0.0;
		std::vector<double> freqs;
		std::vector<double> durations;
		freqs.resize(num_ctrlPnts);
		durations.resize(num_ctrlPnts);
		for (unsigned j = 0; j < num_ctrlPnts; j++)
		{
			CtrlPnt& ctrlPnt = ctrlPnts[j];
			double freq = ctrlPnt.freq;				
			double duration = ctrlPnt.fduration / 1000.0;
			freqs[j] = freq;
			durations[j] = duration;
			totalLen += duration;
		}

		sing.end = sing.start + totalLen;
		double pitchPerSec = 50.0;
		double secPerPitchSample = 1.0 / pitchPerSec;

		unsigned pitchLen = (unsigned)ceil(totalLen*pitchPerSec);
		sing.pitch.resize(pitchLen);
		unsigned pitchPos = 0;
		double fPitchPos = 0.0;
		double nextPitchPos = 0.0;

		for (unsigned j = 0; j < num_ctrlPnts; j++)
		{
			double duration = durations[j];
			double freq1 = freqs[j];
			double freq2 = j < num_ctrlPnts - 1 ? freqs[j + 1] : freq1;
			double thisPitchPos = nextPitchPos;
			nextPitchPos += duration;

			for (; fPitchPos < nextPitchPos && pitchPos < pitchLen; fPitchPos += secPerPitchSample, pitchPos++)
			{
				double k = (fPitchPos - thisPitchPos) / duration;
				sing.pitch[pitchPos] = (float)(freq1*(1.0f - k) + freq2 * k);
			}
		}

		std::vector<float> temp;
		temp.resize(pitchLen);
		temp[0] = sing.pitch[0];
		temp[pitchLen - 1] = sing.pitch[pitchLen - 1];

		for (unsigned i = 1; i < pitchLen - 1; i++)
		{
			temp[i] = 0.25f*(sing.pitch[i - 1] + sing.pitch[i + 1]) + 0.5f*sing.pitch[i];
		}

		for (unsigned i = 0; i < pitchLen; i++)
		{
			sing.pitch[i] = logf(temp[i] / 261.626f)*12.0f / logf(2.0f);
		}

		m_singings.push_back(sing);
		pos += totalLen;
	}
	m_needUpdateSublists = true;
}

void Meteor::SaveToFile(const char* filename)
{
	if (m_needUpdateSublists) _updateSublists();

	FILE *fp = fopen(filename, "wb");
	unsigned countNotes = (unsigned)m_notes.size();
	fwrite(&countNotes, sizeof(unsigned), 1, fp);
	fwrite(&m_notes[0], sizeof(VisNote), countNotes, fp);
	m_notes_sublists.SaveToFile(fp);
	unsigned countBeats = (unsigned)m_beats.size();
	fwrite(&countBeats, sizeof(unsigned), 1, fp);
	fwrite(&m_beats[0], sizeof(VisBeat), countBeats, fp);
	m_beats_sublists.SaveToFile(fp);
	unsigned countSinging = (unsigned)m_singings.size();
	fwrite(&countSinging, sizeof(unsigned), 1, fp);
	for (unsigned i = 0; i < countSinging; i++)
	{
		const VisSinging& singing = m_singings[i];
		fwrite(&singing.singerId, sizeof(unsigned), 1, fp);
		unsigned char len = (unsigned char)singing.lyric.length();
		fwrite(&len, 1, 1, fp);
		if (len > 0)
			fwrite(singing.lyric.data(), 1, len, fp);
		unsigned count = (unsigned)singing.pitch.size();
		fwrite(&count, sizeof(unsigned), 1, fp);
		fwrite(singing.pitch.data(), sizeof(float), count, fp);
		fwrite(&singing.start, sizeof(float), 2, fp);
	}
	m_singing_sublists.SaveToFile(fp);
	fclose(fp);
}

void Meteor::LoadFromFile(const char* filename)
{
	FILE *fp = fopen(filename, "rb");
	unsigned countNotes;
	fread(&countNotes, sizeof(unsigned), 1, fp);
	m_notes.clear();
	m_notes.resize(countNotes);
	fread(&m_notes[0], sizeof(VisNote), countNotes, fp);
	m_notes_sublists.LoadFromFile(fp);
	unsigned countBeats;
	fread(&countBeats, sizeof(unsigned), 1, fp);
	m_beats.clear();
	m_beats.resize(countBeats);
	fread(&m_beats[0], sizeof(VisBeat), countBeats, fp);
	m_beats_sublists.LoadFromFile(fp);
	unsigned countSinging;
	fread(&countSinging, sizeof(unsigned), 1, fp);
	m_singings.clear();
	m_singings.resize(countSinging);
	for (unsigned i = 0; i < countSinging; i++)
	{
		VisSinging& singing = m_singings[i];
		fread(&singing.singerId, sizeof(unsigned), 1, fp);
		unsigned char len;
		fread(&len, 1, 1, fp);
		if (len > 0)
		{
			char _str[256];
			fread(_str, 1, len, fp);
			_str[len] = 0;
			singing.lyric = _str;
		}
		else
			singing.lyric = "";
		unsigned count;
		fread(&count, sizeof(unsigned), 1, fp);
		singing.pitch.resize(count);
		fread(singing.pitch.data(), sizeof(float), count, fp);
		fread(&singing.start, sizeof(float), 2, fp);
	}
	m_singing_sublists.LoadFromFile(fp);
	fclose(fp);
	m_needUpdateSublists = true;
}


void Meteor::ToBlob(std::vector<uint8_t>& blob)
{
	if (m_needUpdateSublists) _updateSublists();

	blob.clear();
	unsigned countNotes = (unsigned)m_notes.size();
	blob_write(blob, &countNotes, sizeof(unsigned));
	blob_write(blob, &m_notes[0], sizeof(VisNote) * countNotes);
	m_notes_sublists.ToBlob(blob);
	unsigned countBeats = (unsigned)m_beats.size();
	blob_write(blob, &countBeats, sizeof(unsigned));
	blob_write(blob, &m_beats[0], sizeof(VisBeat)*countBeats);
	m_beats_sublists.ToBlob(blob);
	unsigned countSinging = (unsigned)m_singings.size();
	blob_write(blob, &countSinging, sizeof(unsigned));
	for (unsigned i = 0; i < countSinging; i++)
	{
		const VisSinging& singing = m_singings[i];
		blob_write(blob, &singing.singerId, sizeof(unsigned));
		unsigned char len = (unsigned char)singing.lyric.length();
		blob_write(blob, &len, 1);
		if (len > 0)
			blob_write(blob, singing.lyric.data(), len);
		unsigned count = (unsigned)singing.pitch.size();
		blob_write(blob, &count, sizeof(unsigned));
		blob_write(blob, singing.pitch.data(), sizeof(float) * count);
		blob_write(blob, &singing.start, sizeof(float)*2);
	}
	m_singing_sublists.ToBlob(blob);
}

void Meteor::ToBase64(std::string& base64)
{
	std::vector<uint8_t> blob;
	ToBlob(blob);
	base64_encode(blob, base64);
}

Meteor::Meteor(size_t num_events, const Event** events)
{
	for (unsigned i = 0; i < num_events; i++)
	{
		const Event* e = events[i];
		switch (e->type)
		{
		case 0:
			InstEvent(*(EventInst*)e);
			break;
		case 1:
			PercEvent(*(EventPerc*)e);
			break;
		case 2:
			SingEvent(*(EventSing*)e);
			break;
		}
	}

}

#include "MeteorPlayer.h"

void Meteor::Play(TrackBuffer* buffer)
{
	if (m_needUpdateSublists)
		_updateSublists();

	MeteorPlayer player(this, buffer);
	player.main_loop();
}

================================================
FILE: Meteor/Meteor.h
================================================
#pragma once

#include <string>
#include <vector>
#include <cstdint>

class Event
{
public:
	unsigned type;
	unsigned instrument_id;
	float offset;
	Event(unsigned type, unsigned instrument_id) : type(type), instrument_id(instrument_id)
	{

	}

	virtual ~Event()
	{

	}
};

class EventInst : public Event
{
public:
	double freq;
	float fduration;
	EventInst(unsigned instrument_id, double freq, float fduration)
		: Event(0, instrument_id)
		, freq(freq)
		, fduration(fduration)
	{

	}
};

class EventPerc : public Event
{
public:
	float fduration;
	EventPerc(unsigned instrument_id, float fduration)
		: Event(1, instrument_id)
		, fduration(fduration)
	{

	}
};

struct CtrlPnt
{
	double freq;
	double fduration;
};

struct Syllable
{
	std::string lyric;
	std::vector<CtrlPnt> ctrlPnts;
};

class EventSing : public Event
{
public:
	std::vector<Syllable> syllableList;
	EventSing(unsigned instrument_id, size_t num_syllables, const Syllable** syllables)
		: Event(2, instrument_id), syllableList(num_syllables)
	{
		for (size_t i = 0; i < num_syllables; i++)
		{
			syllableList[i] = *syllables[i];
		}
	}
};


struct VisNote
{
	unsigned instrumentId;
	int pitch;
	float start;
	float end;
};

struct VisBeat
{
	unsigned percId;
	float start;
	float end;
};

typedef std::vector<std::pair<int, float>> TempoMap;

struct VisSinging
{
	unsigned singerId;
	std::string lyric;
	std::vector<float> pitch;
	float start;
	float end;
};

class TrackBuffer;

#include "SubListLookUp.h"

class Meteor
{
	std::vector<VisNote> m_notes;
	std::vector<VisBeat> m_beats;
	std::vector<VisSinging> m_singings;

	SubLists m_notes_sublists;
	SubLists m_beats_sublists;
	SubLists m_singing_sublists;

	bool m_needUpdateSublists = true;
	void _updateSublists();

public:
	Meteor(){}
	~Meteor(){}

	Meteor(size_t num_events, const Event** events);

	void InstEvent(EventInst& e);
	void PercEvent(EventPerc& e);
	void SingEvent(EventSing& e);
	void SaveToFile(const char* filename);
	void LoadFromFile(const char* filename);
	void ToBlob(std::vector<uint8_t>& blob);
	void ToBase64(std::string& base64);

	const std::vector<VisNote>& GetNotes() const { return m_notes; }
	const std::vector<VisBeat>& GetBeats() const { return m_beats; }
	const std::vector<VisSinging>& GetSingings() const { return m_singings; }
	const SubLists& GetNotesSublists() const { return m_notes_sublists; }
	const SubLists& GetBeatsSublists() const { return m_beats_sublists; }
	const SubLists& GetSingingSublists() const { return m_singing_sublists; }

	void Play(TrackBuffer* buffer);
};



================================================
FILE: Meteor/MeteorPlayer.cpp
================================================
#include <thread>
#include <mutex>
#include <vector>
#include <list>
#include <queue>
#include <unordered_set>
#include <memory.h>
#include <cmath>
#include <portaudio.h>
#include <GLFW/glfw3.h>

#include <TrackBuffer.h>
#include <utils.h>
#include "MeteorPlayer.h"
#include "Meteor.h"
#include "DrawText.h"

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif


class AudioBufferQueue
{
public:
	AudioBufferQueue(int cache_size) : m_semaphore_in(cache_size)
	{
	}

	~AudioBufferQueue()
	{
	}

	size_t Size()
	{
		return m_queue.size();
	}

	AudioBuffer* Front()
	{
		return m_queue.front();
	}

	void Push(AudioBuffer* packet)
	{
		m_semaphore_in.wait();
		m_mutex.lock();
		m_queue.push(packet);
		m_mutex.unlock();
		m_semaphore_out.notify();
	}

	AudioBuffer* Pop()
	{
		m_semaphore_out.wait();
		m_mutex.lock();
		AudioBuffer* ret = m_queue.front();
		m_queue.pop();
		m_mutex.unlock();
		m_semaphore_in.notify();
		return ret;
	}

private:
	std::queue<AudioBuffer*> m_queue;
	std::mutex m_mutex;
	Semaphore m_semaphore_in;
	Semaphore m_semaphore_out;
};


void MeteorPlayer::_set_sync_point(size_t playback_pos, double time_playback_pos)
{
	m_mutex_sync.lock();
	m_playback_pos = playback_pos;
	m_time_playback_pos = time_playback_pos;
	m_mutex_sync.unlock();
}

void MeteorPlayer::_get_sync_point(size_t& playback_pos, double& time_playback_pos)
{
	m_mutex_sync.lock();
	playback_pos = m_playback_pos;
	time_playback_pos = m_time_playback_pos;
	m_mutex_sync.unlock();
}


int MeteorPlayer::stream_callback(const void *inputBuffer, void *outputBuffer,
	unsigned long framesPerBuffer,
	const PaStreamCallbackTimeInfo* timeInfo,
	unsigned long statusFlags,
	void *userData)
{
	MeteorPlayer* self = (MeteorPlayer*)userData;
	AudioBufferQueue* queue = self->m_audio_queue.get();

	self->_set_sync_point(self->m_playback_pos_next, time_sec());

	unsigned long pos_out = 0;
	short *out = (short*)outputBuffer;
	while (pos_out < framesPerBuffer)
	{
		if (queue->Size() < 1) break;
		AudioBuffer* buf_in = queue->Front();
		size_t copy_size = min(AUDIO_BUF_LEN - self->m_audio_read_pos, framesPerBuffer - pos_out);
		memcpy(out + pos_out * 2, buf_in->data + self->m_audio_read_pos * 2, sizeof(short)*copy_size * 2);
		self->m_audio_read_pos += copy_size;
		pos_out += (unsigned long)copy_size;
		if (self->m_audio_read_pos == AUDIO_BUF_LEN)
		{
			self->m_audio_read_pos = 0;
			queue->Pop();
			delete buf_in;
		}
	}
	if (pos_out < framesPerBuffer)
		memset(out + pos_out * 2, 0, sizeof(short) * (framesPerBuffer - pos_out) * 2);

	self->m_playback_pos_next = self->m_playback_pos + framesPerBuffer;

	return paContinue;
}

void MeteorPlayer::thread_demux(MeteorPlayer* self)
{
	TrackBuffer* buf_in = self->m_trackbuffer;
	unsigned size = buf_in->NumberOfSamples();
	unsigned chn = buf_in->NumberOfChannels();
	float volume = buf_in->AbsoluteVolume();
	float pan = buf_in->Pan();

	AudioBufferQueue* queue_out = self->m_audio_queue.get();
	while (self->m_demuxing)
	{
		AudioBuffer* buf_out = new AudioBuffer;
		size_t pos_out = 0;
		while (pos_out < AUDIO_BUF_LEN)
		{
			size_t copy_size = min(size - self->m_input_read_pos, AUDIO_BUF_LEN - pos_out);
			for (size_t i = 0; i < copy_size; i++)
			{
				size_t read_pos = self->m_input_read_pos + i;
				float sample_in[2];
				buf_in->Sample(read_pos, sample_in);
				short sample_out[2];
				if (chn == 1)
				{
					sample_out[0] = sample_out[1] = (short)(max(min(sample_in[0] * volume, 1.0f), -1.0f)*32767.0f);
				}
				else
				{
					CalcPan(pan, sample_in[0], sample_in[1]);
					sample_out[0] = (short)(max(min(sample_in[0] * volume, 1.0f), -1.0f)*32767.0f);
					sample_out[1] = (short)(max(min(sample_in[1] * volume, 1.0f), -1.0f)*32767.0f);
				}

				size_t write_pos = pos_out + i;
				buf_out->data[write_pos * 2] = sample_out[0];
				buf_out->data[write_pos * 2 + 1] = sample_out[1];

			}			
			self->m_input_read_pos += copy_size;			
			pos_out += copy_size;
			if (self->m_input_read_pos == size)
			{
				self->m_demuxing = false;
				break;
			}
		}
		if (pos_out < AUDIO_BUF_LEN)
			memset(buf_out->data + pos_out * 2, 0, sizeof(short) * (AUDIO_BUF_LEN - pos_out) * 2);

		queue_out->Push(buf_out);
	}	
}


#define PI 3.1415926535897932384626433832795

inline float rand01()
{
	float f = (float)rand() / (float)RAND_MAX;
	if (f < 0.0000001f) f = 0.0000001f;
	if (f > 0.9999999f) f = 0.9999999f;
	return f;
}


unsigned char MeteorPlayer::s_ColorBank[15][3] =
{
	{ 0x41, 0x8C, 0xF0 },
	{ 0xFC, 0xB4, 0x41 },
	{ 0xDF, 0x3A, 0x02 },
	{ 0x05, 0x64, 0x92 },
	{ 0xBF, 0xBF, 0xBF },
	{ 0x1A, 0x3B, 0x69 },
	{ 0xFF, 0xE3, 0x82 },
	{ 0x12, 0x9C, 0xDD },
	{ 0xCA, 0x6B, 0x4B },
	{ 0x00, 0x5C, 0xDB },
	{ 0xF3, 0xD2, 0x88 },
	{ 0x50, 0x63, 0x81 },
	{ 0xF1, 0xB9, 0xA8 },
	{ 0xE0, 0x83, 0x0A },
	{ 0x78, 0x93, 0xBE }
};



thread_local int MeteorPlayer::s_instance_count = 0;
MeteorPlayer::MeteorPlayer(Meteor* meteor, TrackBuffer* trackbuffer)
	: m_meteor(meteor), m_trackbuffer(trackbuffer)
{
	m_time_playback_pos = time_sec();

	if (s_instance_count == 0) Pa_Initialize();
	s_instance_count++;

	m_audio_queue = std::unique_ptr<AudioBufferQueue>(new AudioBufferQueue(8));

	m_demuxing = true;
	m_thread_demux = (std::unique_ptr<std::thread>)(new std::thread(thread_demux, this));

	PaStreamParameters outputParameters = {};
	outputParameters.device = Pa_GetDefaultOutputDevice();
	outputParameters.channelCount = 2;
	outputParameters.sampleFormat = paInt16;
	outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency;

	double sample_rate = (double)trackbuffer->Rate();
	Pa_OpenStream(&m_stream, nullptr, &outputParameters, sample_rate, (unsigned long)(sample_rate*0.01), paClipOff, stream_callback, this);
	Pa_StartStream(m_stream);

	glfwInit();
	glfwWindowHint(GLFW_SAMPLES, 4);
	m_window = glfwCreateWindow(640, 480, "ScoreDraft Meteor Player", NULL, NULL);
	glfwMakeContextCurrent(m_window);
	glfwSwapInterval(1);

	_buildColorMap();
	_buildTexs();
}

MeteorPlayer::~MeteorPlayer()
{
	auto iter = m_texs.begin();
	while (iter != m_texs.end())
	{
		glDeleteTextures(1, &iter->second.texId);
		iter++;
	}

	glfwDestroyWindow(m_window);
	glfwTerminate();

	m_demuxing = false;

	Pa_StopStream(m_stream);
	Pa_CloseStream(m_stream);

	while (m_audio_queue->Size() > 0)
	{
		AudioBuffer* p = m_audio_queue->Pop();
		delete p;
	}

	m_thread_demux->join();
	m_thread_demux = nullptr;

	s_instance_count--;
	if (s_instance_count == 0) Pa_Terminate();
}


void MeteorPlayer::_buildColorMap()
{
	unsigned bankRef = 0;
	const std::vector<VisBeat>&  beats = m_meteor->GetBeats();
	m_beats_centers.clear();
	for (unsigned i = 0; i < (unsigned)beats.size(); i++)
	{
		unsigned perc = beats[i].percId;
		if (m_PercColorMap.find(perc) == m_PercColorMap.end())
		{
			m_PercColorMap[perc] = s_ColorBank[bankRef];
			bankRef++;
			if (bankRef >= 15) bankRef = 0;
		}

		float x = rand01();
		float y = rand01();

		m_beats_centers.push_back({ x, y });
	}

	const std::vector<VisSinging>&  singings = m_meteor->GetSingings();
	for (unsigned i = 0; i < (unsigned)singings.size(); i++)
	{
		unsigned singer = singings[i].singerId;
		if (m_SingerColorMap.find(singer) == m_SingerColorMap.end())
		{
			m_SingerColorMap[singer] = s_ColorBank[bankRef];
			bankRef++;
			if (bankRef >= 15) bankRef = 0;
		}
	}

	const std::vector<VisNote>&  notes = m_meteor->GetNotes();
	for (unsigned i = 0; i < (unsigned)notes.size(); i++)
	{
		unsigned inst = notes[i].instrumentId;
		if (m_InstColorMap.find(inst) == m_InstColorMap.end())
		{
			m_InstColorMap[inst] = s_ColorBank[bankRef];
			bankRef++;
			if (bankRef >= 15) bankRef = 0;
		}
	}
}

void MeteorPlayer::_buildTexs()
{
	const std::vector<VisSinging>& lst_singings = m_meteor->GetSingings();
	for (size_t i = 0; i < lst_singings.size(); i++)
	{
		const VisSinging* pnote = &lst_singings[i];
		std::string lyric = pnote->lyric;
		Text text(lyric.c_str());
		TexText tex;
		tex.width = text.m_width;
		tex.height = text.m_height;
		glGenTextures(1, &tex.texId);
		glBindTexture(GL_TEXTURE_2D, tex.texId);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex.width, tex.height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, text.m_data.data());
		glBindTexture(GL_TEXTURE_2D, 0);
		m_texs[lyric] = tex;
	}

}

void MeteorPlayer::_draw_tex(const TexText& tex, float x, float y)
{
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, tex.texId);

	glBegin(GL_QUADS);
	glTexCoord2f(0.0f, 1.0f);
	glVertex2f(x, y);

	glTexCoord2f(1.0f, 1.0f);
	glVertex2f(x + tex.width, y);

	glTexCoord2f(1.0f, 0.0f);
	glVertex2f(x + tex.width, y + tex.height);

	glTexCoord2f(0.0f, 0.0f);
	glVertex2f(x, y + tex.height);
	glEnd();

	glDisable(GL_TEXTURE_2D);
}


void MeteorPlayer::_draw_key(float left, float right, float bottom, float top, float lineWidth, bool black)
{
	if (black)
		glColor3f(0.0f, 0.0f, 0.0f);
	else
		glColor3f(1.0f, 1.0f, 1.0f);
	glBegin(GL_QUADS);
	// top
	glVertex2f(left + m_cornerSize, top);
	glVertex2f(right - m_cornerSize, top);
	glVertex2f(right, top - m_cornerSize);
	glVertex2f(left, top - m_cornerSize);
	// mid
	glVertex2f(left, top - m_cornerSize);
	glVertex2f(right, top - m_cornerSize);
	glVertex2f(right, bottom + m_cornerSize);
	glVertex2f(left, bottom + m_cornerSize);
	// bottom
	glVertex2f(left, bottom + m_cornerSize);
	glVertex2f(right, bottom + m_cornerSize);
	glVertex2f(right - m_cornerSize, bottom);
	glVertex2f(left + m_cornerSize, bottom);
	glEnd();

	// outline
	if (black)
		glColor3f(1.0f, 1.0f, 1.0f);
	else
		glColor3f(0.0f, 0.0f, 0.0f);
	glLineWidth(lineWidth);
	glBegin(GL_LINE_STRIP);
	glVertex2f(left + m_cornerSize, top);
	glVertex2f(right - m_cornerSize, top);
	glVertex2f(right, top - m_cornerSize);
	glVertex2f(right, bottom + m_cornerSize);
	glVertex2f(right - m_cornerSize, bottom);
	glVertex2f(left + m_cornerSize, bottom);
	glVertex2f(left, bottom + m_cornerSize);
	glVertex2f(left, top - m_cornerSize);
	glVertex2f(left + m_cornerSize, top);
	glEnd();

}


void MeteorPlayer::_draw_flash(float centerx, float centery, float radius, unsigned char color[3], float alpha)
{
	unsigned div = 36;
	unsigned char uAlpha = (unsigned char)(alpha*255.0f);

	glBegin(GL_TRIANGLES);
	for (unsigned i = 0; i < div; i++)
	{
		float theta1 = (float)i / (float)div * 2.0f*(float)PI;
		float theta2 = (float)(i + 1) / (float)div * 2.0f*(float)PI;

		float x1 = centerx + cosf(theta1)*radius;
		float y1 = centery + sinf(theta1)*radius;

		float x2 = centerx + cosf(theta2)*radius;
		float y2 = centery + sinf(theta2)*radius;

		glColor4ub(color[0], color[1], color[2], uAlpha);
		glVertex2f(centerx, centery);
		glColor4ub(color[0], color[1], color[2], 0);
		glVertex2f(x1, y1);
		glVertex2f(x2, y2);
	}

	glEnd();
}


void MeteorPlayer::draw()
{
	int width, height;
	glfwGetFramebufferSize(m_window, &width, &height);
	glViewport(0, 0, width, height);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(0.0, (double)width, 0.0, (double)height, -1.0, 1.0);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT);

	glDisable(GL_DEPTH_TEST);

	const SubLists& notes_sublists = m_meteor->GetNotesSublists();
	const SubLists& beats_sublists = m_meteor->GetBeatsSublists();
	const SubLists& singing_sublists = m_meteor->GetSingingSublists();

	size_t playback_pos;
	double time_playback_pos;
	_get_sync_point(playback_pos, time_playback_pos);
	double ref_time = (double)playback_pos / (double)m_trackbuffer->Rate();
	double time_now = time_sec();

	float note_inTime = (float)(ref_time + (time_now - time_playback_pos));
	unsigned note_intervalId = notes_sublists.GetIntervalId(note_inTime);
	float note_outTime = note_inTime - m_showTime;
	unsigned note_intervalId_min = notes_sublists.GetIntervalId(note_outTime);		
	
	/// draw meteors
	glEnable(GL_BLEND);
	glBlendFunc(GL_SRC_ALPHA, GL_ONE);

	//notes
	if (notes_sublists.m_subLists.size() > 0)
	{
		std::unordered_set<const VisNote*> visiableNotes;

		for (unsigned i = note_intervalId_min; i <= note_intervalId; i++)
		{
			const SubList& subList = notes_sublists.m_subLists[i];
			for (unsigned j = 0; j < (unsigned)subList.size(); j++)
			{
				const VisNote& note = m_meteor->GetNotes()[subList[j]];
				if (note.start<note_inTime && note.end> note_outTime)
					visiableNotes.insert(&note);
			}
		}

		glBegin(GL_QUADS);

		float keyPos[12] = { 0.5f, 1.0f, 1.5f, 2.0f, 2.5f, 3.5f, 4.0f, 4.5f, 5.0f, 5.5f, 6.0f, 6.5f };

		for (auto iter = visiableNotes.begin(); iter != visiableNotes.end(); iter++)
		{
			float startY = ((*iter)->start - note_inTime) / -m_showTime * ((float)height - m_whiteKeyHeight) + m_whiteKeyHeight;
			float endY = ((*iter)->end - note_inTime) / -m_showTime * ((float)height - m_whiteKeyHeight) + m_whiteKeyHeight;

			unsigned instId = (*iter)->instrumentId;
			unsigned char* color = m_InstColorMap[instId];

			int pitch = (*iter)->pitch;
			int octave = 0;
			while (pitch < 0)
			{
				pitch += 12;
				octave--;
			}
			while (pitch >= 12)
			{
				pitch -= 12;
				octave++;
			}

			float x = (float)width*0.5f + ((float)octave*7.0f + keyPos[pitch])*m_whiteKeyWidth;

			glColor4ub(color[0], color[1], color[2], 255);
			glVertex2f(x, startY);
			glVertex2f(x + m_meteorHalfWidth, startY - m_meteorHalfWidth);
			glColor4ub(color[0], color[1], color[2], 0);
			glVertex2f(x, endY);
			glColor4ub(color[0], color[1], color[2], 255);
			glVertex2f(x - m_meteorHalfWidth, startY - m_meteorHalfWidth);

		}


		glEnd();
	}

	// beats
	if (beats_sublists.m_subLists.size() > 0)
	{
		unsigned beat_intervalId = beats_sublists.GetIntervalId(note_inTime);

		const SubList& subList = beats_sublists.m_subLists[beat_intervalId];
		for (unsigned i = 0; i < (unsigned)subList.size(); i++)
		{
			unsigned beatIndex = subList[i];
			const VisBeat& beat = m_meteor->GetBeats()[beatIndex];

			float start = beat.start;
			float end = beat.end;

			// limting percussion flash time
			if (end - start > m_percussion_flash_limit)
				end = start + m_percussion_flash_limit;

			if (note_inTime >= start && note_inTime <= end)
			{
				float centerx = m_beats_centers[beatIndex].x*width;
				float centery = m_beats_centers[beatIndex].y*(height - m_whiteKeyHeight) + m_whiteKeyHeight;
				float radius = width * m_percussion_flash_size_factor;

				unsigned char* color = m_PercColorMap[beat.percId];
				float alpha = (end - note_inTime) / (end - start);
				_draw_flash(centerx, centery, radius, color, alpha);
			}
		}
	}


	// singing
	if (singing_sublists.m_subLists.size() > 0)
	{
		unsigned singing_intervalId = singing_sublists.GetIntervalId(note_inTime);
		unsigned singing_intervalId_min = singing_sublists.GetIntervalId(note_outTime);

		std::unordered_set<const VisSinging*> visiableNotes;

		for (unsigned i = singing_intervalId_min; i <= singing_intervalId; i++)
		{
			const SubList& subList = singing_sublists.m_subLists[i];
			for (unsigned j = 0; j < (unsigned)subList.size(); j++)
			{
				const VisSinging& note = m_meteor->GetSingings()[subList[j]];
				if (note.start<note_inTime && note.end> note_outTime)
					visiableNotes.insert(&note);
			}
		}

		float pixelPerPitch = m_whiteKeyWidth * 7.0f / 12.0f;

		glBegin(GL_QUADS);
		
		for (auto iter = visiableNotes.begin(); iter != visiableNotes.end(); iter++)
		{
			float startY = ((*iter)->start - note_inTime) / -m_showTime * ((float)height - m_whiteKeyHeight) + m_whiteKeyHeight;
			float endY = ((*iter)->end - note_inTime) / -m_showTime * ((float)height - m_whiteKeyHeight) + m_whiteKeyHeight;

			unsigned singerId = (*iter)->singerId;
			unsigned char* color = m_SingerColorMap[singerId];

			const float* pitches = &(*iter)->pitch[0];
			unsigned num_pitches = (unsigned)(*iter)->pitch.size();

			for (unsigned i = 0; i < num_pitches - 1; i++)
			{
				float x1 = pitches[i] * pixelPerPitch + (float)width*0.5f + m_whiteKeyWidth * 0.5f;
				float x2 = pitches[i + 1] * pixelPerPitch + (float)width*0.5f + m_whiteKeyWidth * 0.5f;

				float k1 = (float)i / (float)(num_pitches - 1);
				float y1 = startY * (1.0f - k1) + endY * k1;

				float k2 = (float)(i + 1) / (float)(num_pitches - 1);
				float y2 = startY * (1.0f - k2) + endY * k2;

				glColor4ub(color[0], color[1], color[2], (unsigned char)((1.0f - k1)*255.0f));
				glVertex2f(x1 - m_singing_half_width, y1);
				glVertex2f(x1 + m_singing_half_width, y1);
				glVertex2f(x2 + m_singing_half_width, y2);
				glVertex2f(x2 - m_singing_half_width, y2);

			}

		}

		glEnd();
	}

	// lyrics
	if (singing_sublists.m_subLists.size() > 0)
	{
		unsigned singing_intervalId = singing_sublists.GetIntervalId(note_inTime);
		unsigned singing_intervalId_min = singing_sublists.GetIntervalId(note_outTime);

		std::unordered_set<const VisSinging*> visiableNotes;

		for (unsigned i = singing_intervalId_min; i <= singing_intervalId; i++)
		{
			const SubList& subList = singing_sublists.m_subLists[i];
			for (unsigned j = 0; j < (unsigned)subList.size(); j++)
			{
				const VisSinging& note = m_meteor->GetSingings()[subList[j]];
				if (note.start<note_inTime && note.start> note_outTime)
					visiableNotes.insert(&note);
			}
		}

		float pixelPerPitch = m_whiteKeyWidth * 7.0f / 12.0f;	

		for (auto iter = visiableNotes.begin(); iter != visiableNotes.end(); iter++)
		{
			float startY = ((*iter)->start - note_inTime) / -m_showTime * ((float)height - m_whiteKeyHeight) + m_whiteKeyHeight;

			unsigned singerId = (*iter)->singerId;
			unsigned char* color = m_SingerColorMap[singerId];

			float x = (*iter)->pitch[0] * pixelPerPitch + (float)width*0.5f + m_whiteKeyWidth * 0.5f + m_singing_half_width;
			std::string lyric = (*iter)->lyric;

			TexText& tex = m_texs[lyric];
			glColor3ub(color[0], color[1], color[2]);
			_draw_tex(tex, x, startY);
		}
	}


	/// draw keyboard
	glDisable(GL_BLEND);

	static int whitePitchs[7] = { 0, 2, 4, 5, 7, 9, 11 };
	static int blackPitchs[5] = { 1, 3, 6, 8, 10 };
	static int blackPos[5] = { 1, 2, 4, 5, 6 };

	float center = (float)width *0.5f;
	float octaveWidth = m_whiteKeyWidth * 7.0f;

	int minOctave = -(int)ceilf(center / octaveWidth);
	int maxOctave = (int)floorf(center / octaveWidth);
	int numKeys = (maxOctave - minOctave + 1) * 12;
	int indexShift = -minOctave * 12;

	bool* pressed = new bool[numKeys];
	memset(pressed, 0, sizeof(bool)* numKeys);

	// notes
	if (notes_sublists.m_subLists.size() > 0)
	{
		const SubList& subList = notes_sublists.m_subLists[note_intervalId];
		for (unsigned i = 0; i < (unsigned)subList.size(); i++)
		{
			const VisNote& note = m_meteor->GetNotes()[subList[i]];
			float start = note.start;
			float end = note.end;

			// early key-up movement
			end -= (end - start)*0.1f;

			if (note_inTime >= start && note_inTime <= end)
			{
				int index = note.pitch + indexShift;
				if (index >= 0 && index < numKeys)
				{				
					pressed[index] = true;
				}
			}
		}
	}


	for (int i = minOctave; center + (float)i*octaveWidth < width; i++)
	{
		float octaveLeft = center + (float)i*octaveWidth;
		for (int j = 0; j < 7; j++)
		{
			int index = whitePitchs[j] + i * 12 + indexShift;
			bool keyPressed = pressed[index];

			float left = octaveLeft + (float)j*m_whiteKeyWidth;
			float right = left + m_whiteKeyWidth;
			float bottom = keyPressed ? m_whiteKeyPressedDelta : 0.0f;
			float top = m_whiteKeyHeight;
			_draw_key(left, right, bottom, top, keyPressed ? m_pressedLineWidth : 1.0f);
		}
		for (int j = 0; j < 5; j++)
		{
			int index = blackPitchs[j] + i * 12 + indexShift;
			bool keyPressed = pressed[index];

			float keyCenter = octaveLeft + (float)blackPos[j] * m_whiteKeyWidth;
			float left = keyCenter - m_blackKeyWidth / 2.0f;
			float right = keyCenter + m_blackKeyWidth / 2.0f;

			float bottom = keyPressed ? m_whiteKeyHeight - m_blackKeyHeight + m_blackKeyPressedDelta : m_whiteKeyHeight - m_blackKeyHeight;
			float top = m_whiteKeyHeight;
			_draw_key(left, right, bottom, top, keyPressed ? m_pressedLineWidth : 1.0f, true);
		}
	}

	delete[] pressed;
}

void MeteorPlayer::main_loop()
{	
	while (m_demuxing && glfwWindowShouldClose(m_window) == 0)
	{
		glfwMakeContextCurrent(m_window);
		draw();
		glfwSwapBuffers(m_window);
		glfwPollEvents();
	}
}


================================================
FILE: Meteor/MeteorPlayer.h
================================================
#pragma once

#include <memory>
#include <mutex>
#include <string>
#include <unordered_map>

typedef std::unordered_map<unsigned, unsigned char*> ColorMap;

struct Pos2D
{
	float x;
	float y;
};

namespace std
{
	class thread;
}

#define AUDIO_BUF_LEN 512
struct AudioBuffer
{
	short data[AUDIO_BUF_LEN * 2];
};

class TrackBuffer;
class AudioBufferQueue;

struct PaStreamCallbackTimeInfo;

struct GLFWwindow;

class Meteor;
struct VisSinging;
class MeteorPlayer
{
public:
	MeteorPlayer(Meteor* meteor, TrackBuffer* trackbuffer);
	~MeteorPlayer();
	
	void main_loop();	

private:
	static thread_local int s_instance_count;
	void *m_stream;
	static int stream_callback(const void *inputBuffer, void *outputBuffer,
		unsigned long framesPerBuffer,
		const PaStreamCallbackTimeInfo* timeInfo,
		unsigned long statusFlags,
		void *userData);

	double m_sample_rate = 44100.0;
	Meteor* m_meteor = nullptr;
	TrackBuffer* m_trackbuffer = nullptr;
	std::unique_ptr<AudioBufferQueue> m_audio_queue;
	size_t m_input_read_pos = 0;
	size_t m_audio_read_pos = 0;
	
	size_t m_playback_pos = 0;
	size_t m_playback_pos_next = 0;
	double m_time_playback_pos = 0.0;	
	std::mutex m_mutex_sync;
	void _set_sync_point(size_t playback_pos, double time_playback_pos);
	void _get_sync_point(size_t& playback_pos, double& time_playback_pos);

	bool m_demuxing = false;
	static void thread_demux(MeteorPlayer* self);
	std::unique_ptr<std::thread> m_thread_demux;

	// UI
	GLFWwindow* m_window = nullptr;
	void draw();

	struct TexText
	{
		int width;
		int height;
		unsigned texId;
	};

	std::unordered_map<std::string, TexText> m_texs;
	void _buildTexs();
	void _draw_tex(const TexText& tex, float x, float y);

	void _buildColorMap();
	void _draw_key(float left, float right, float bottom, float top, float lineWidth, bool black = false);
	void _draw_flash(float centerx, float centery, float radius, unsigned char color[3], float alpha);
	static unsigned char s_ColorBank[15][3];

	ColorMap m_InstColorMap;
	ColorMap m_PercColorMap;
	std::vector<Pos2D> m_beats_centers;
	ColorMap m_SingerColorMap;

	// UI settings
	float m_whiteKeyWidth = 18.0f;
	float m_blackKeyWidth = 14.0f;
	float m_whiteKeyHeight = 80.0f;
	float m_blackKeyHeight = 50.0f;
	float m_cornerSize = 3.0f;
	float m_whiteKeyPressedDelta = 3.0f;
	float m_blackKeyPressedDelta = 2.0f;
	float m_pressedLineWidth = 3.0f;

	float m_showTime = 1.0f;
	float m_meteorHalfWidth = 5.0f;

	float m_percussion_flash_size_factor = 0.15f;
	float m_percussion_flash_limit = 0.3f;

	float m_singing_half_width = 8.0f;
};

================================================
FILE: Meteor/SubListLookUp.h
================================================
#ifndef _SubListLookUp_h
#define _SubListLookUp_h

#include <vector>
#include <float.h>
#include <stdio.h>
#include <cmath>
#include "blob.hpp"

typedef std::vector<unsigned> SubList;

class SubLists
{
public:
	float m_minStart;
	float m_maxEnd;
	float m_interval;
	std::vector<SubList> m_subLists;

	SubLists()	{}

	unsigned GetIntervalId(float v) const
	{
		if (v < m_minStart) return 0;
		unsigned id = (unsigned)((v - m_minStart) / m_interval);
		if (id >= (unsigned)m_subLists.size()) id = (unsigned)m_subLists.size() - 1;
		return id;
	}

	void SaveToFile(FILE* fp) const
	{
		fwrite(&m_minStart, sizeof(float), 3, fp);
		unsigned count = (unsigned)m_subLists.size();
		fwrite(&count, sizeof(unsigned), 1, fp);
		for (unsigned i = 0; i < count; i++)
		{
			unsigned sub_count = (unsigned)m_subLists[i].size();
			fwrite(&sub_count, sizeof(unsigned), 1, fp);
			fwrite(&m_subLists[i][0], sizeof(unsigned), sub_count, fp);
		}
	}

	void LoadFromFile(FILE* fp)
	{
		fread(&m_minStart, sizeof(float), 3, fp);
		unsigned count;
		fread(&count, sizeof(unsigned), 1, fp);
		m_subLists.clear();
		m_subLists.resize(count);
		for (unsigned i = 0; i < count; i++)
		{
			unsigned sub_count;
			fread(&sub_count, sizeof(unsigned), 1, fp);
			m_subLists[i].resize(sub_count);
			fread(&m_subLists[i][0], sizeof(unsigned), sub_count, fp);
		}
	}

	void ToBlob(std::vector<uint8_t>& blob)
	{
		blob_write(blob, &m_minStart, sizeof(float) * 3);
		unsigned count = (unsigned)m_subLists.size();
		blob_write(blob, &count, sizeof(unsigned));
		for (unsigned i = 0; i < count; i++)
		{
			unsigned sub_count = (unsigned)m_subLists[i].size();
			blob_write(blob, &sub_count, sizeof(unsigned));
			blob_write(blob, &m_subLists[i][0], sizeof(unsigned)*sub_count);
		}
	}

	template<class T>
	void SetData(const std::vector<T>& fullList, float interval)
	{
		m_interval = interval;
		m_minStart = FLT_MAX;
		m_maxEnd = -FLT_MAX;
		if (fullList.size()==0) return;
		for (unsigned i = 0; i < (unsigned) fullList.size(); i++)
		{
			if (fullList[i].start < m_minStart) m_minStart = fullList[i].start;
			if (fullList[i].end> m_maxEnd) m_maxEnd = fullList[i].end;
		}

		unsigned numIntervals = (unsigned)ceilf((m_maxEnd - m_minStart) / interval);
		m_subLists.clear();
		m_subLists.resize(numIntervals);

		for (unsigned i = 0; i < (unsigned)fullList.size(); i++)
		{
			unsigned startInterval = (unsigned)((fullList[i].start - m_minStart) / interval);
			unsigned endInterval = (unsigned)((fullList[i].end - m_minStart) / interval);
			if (endInterval >= numIntervals) endInterval = numIntervals - 1;

			for (unsigned j = startInterval; j <= endInterval; j++)
			{
				m_subLists[j].push_back(i);
			}

		}

	}

};

#endif


================================================
FILE: Meteor/api.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif

extern "C"
{
	SCOREDRAFT_API void* CtrlPntCreate(double freq, double fduration);
	SCOREDRAFT_API void CtrlPntDestroy(void* ptr);
	SCOREDRAFT_API void* SyllableCreate(const char* lyric, void* ptr_lst_ctrl_pnts);
	SCOREDRAFT_API void SyllableDestroy(void* ptr);
	SCOREDRAFT_API void EventDestroy(void* ptr);
	SCOREDRAFT_API void EventSetOffset(void* ptr, float offset);
	SCOREDRAFT_API void* EventInstCreate(unsigned instrument_id, double freq, float fduration);
	SCOREDRAFT_API void* EventPercCreate(unsigned instrument_id, float fduration);
	SCOREDRAFT_API void* EventSingCreate(unsigned instrument_id, void* ptr_syllable_list);
	SCOREDRAFT_API void* MeteorCreate0();
	SCOREDRAFT_API void* MeteorCreate(void* ptr_event_list);
	SCOREDRAFT_API void MeteorDestroy(void* ptr);
	SCOREDRAFT_API void MeteorSaveToFile(void* ptr, const char* filename);
	SCOREDRAFT_API void MeteorLoadFromFile(void* ptr, const char* filename);
	SCOREDRAFT_API void MeteorPlay(void* ptr_meteor, void* ptr_track);
	SCOREDRAFT_API void* Base64Create(void* ptr_meteor);
	SCOREDRAFT_API void Base64Destroy(void* ptr);
	SCOREDRAFT_API const char* Base64Get(void* ptr);
}

#include "Meteor.h"

void* CtrlPntCreate(double freq, double fduration)
{
	return new CtrlPnt({ freq, fduration });
}

void CtrlPntDestroy(void* ptr)
{
	delete (CtrlPnt*)ptr;
}

void* SyllableCreate(const char* lyric, void* ptr_lst_ctrl_pnts)
{
	std::vector<CtrlPnt*>* lst_ctrl_pnts = (std::vector<CtrlPnt*>*)ptr_lst_ctrl_pnts;
	Syllable* syllable = new Syllable;
	syllable->lyric = lyric;
	syllable->ctrlPnts.resize(lst_ctrl_pnts->size());
	for (size_t i = 0; i < lst_ctrl_pnts->size(); i++)
	{
		syllable->ctrlPnts[i] = *(*lst_ctrl_pnts)[i];
	}
	return syllable;
}

void SyllableDestroy(void* ptr)
{
	delete (Syllable*)ptr;
}

void EventDestroy(void* ptr)
{
	delete (Event*)ptr;
}

void EventSetOffset(void* ptr, float offset)
{
	Event* e = (Event*)ptr;
	e->offset = offset;
}


void* EventInstCreate(unsigned instrument_id, double freq, float fduration)
{
	return new EventInst(instrument_id, freq, fduration);
}

void* EventPercCreate(unsigned instrument_id, float fduration)
{
	return new EventPerc(instrument_id, fduration);
}

void* EventSingCreate(unsigned instrument_id, void* ptr_syllable_list)
{
	std::vector<const Syllable*>* syllable_list = (std::vector<const Syllable*>*)ptr_syllable_list;
	return new EventSing(instrument_id, syllable_list->size(), syllable_list->data());
}

#include "DrawText.h"

void* MeteorCreate0()
{
	Text text("测试");
	return new Meteor;
}

void* MeteorCreate(void* ptr_event_list)
{
	std::vector<const Event*>* event_list = (std::vector<const Event*>*)ptr_event_list;
	return new Meteor(event_list->size(), event_list->data());
}

void MeteorDestroy(void* ptr)
{
	delete (Meteor*)ptr;
}

void MeteorSaveToFile(void* ptr, const char* filename)
{
	Meteor* meteor = (Meteor*)ptr;
	meteor->SaveToFile(filename);
}

void MeteorLoadFromFile(void* ptr, const char* filename)
{
	Meteor* meteor = (Meteor*)ptr;
	meteor->LoadFromFile(filename);
}

void MeteorPlay(void* ptr_meteor, void* ptr_track)
{
	Meteor* meteor = (Meteor*)ptr_meteor;
	TrackBuffer* track = (TrackBuffer*)ptr_track;

	meteor->Play(track);
}

void* Base64Create(void* ptr_meteor)
{
	Meteor* meteor = (Meteor*)ptr_meteor;
	std::string* base64 = new std::string;
	meteor->ToBase64(*base64);
	return base64;
}

void Base64Destroy(void* ptr)
{
	delete (std::string*)ptr;
}

const char* Base64Get(void* ptr)
{
	return ((std::string*)ptr)->c_str();
}

================================================
FILE: Meteor/base64.hpp
================================================
#pragma once

#include <string>
#include <vector>
#include <stdexcept>
#include <cstdint>

inline void base64_encode(const std::vector<uint8_t>& input, std::string& output)
{
	static const char kEncodeLookup[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
	static const char kPadCharacter = '=';

	output = "";
	output.reserve(((input.size() / 3) + (input.size() % 3 > 0)) * 4);

	std::uint32_t temp{};
	auto it = input.begin();

	for(std::size_t i = 0; i < input.size() / 3; ++i)
	{
		temp  = (*it++) << 16;
		temp += (*it++) << 8;
		temp += (*it++);
		output.append(1, kEncodeLookup[(temp & 0x00FC0000) >> 18]);
		output.append(1, kEncodeLookup[(temp & 0x0003F000) >> 12]);
		output.append(1, kEncodeLookup[(temp & 0x00000FC0) >> 6 ]);
		output.append(1, kEncodeLookup[(temp & 0x0000003F)      ]);
	}

	switch(input.size() % 3)
	{
	case 1:
		temp = (*it++) << 16;
		output.append(1, kEncodeLookup[(temp & 0x00FC0000) >> 18]);
		output.append(1, kEncodeLookup[(temp & 0x0003F000) >> 12]);
		output.append(2, kPadCharacter);
		break;
	case 2:
		temp  = (*it++) << 16;
		temp += (*it++) << 8;
		output.append(1, kEncodeLookup[(temp & 0x00FC0000) >> 18]);
		output.append(1, kEncodeLookup[(temp & 0x0003F000) >> 12]);
		output.append(1, kEncodeLookup[(temp & 0x00000FC0) >> 6 ]);
		output.append(1, kPadCharacter);
		break;
	}
}



================================================
FILE: Meteor/blob.hpp
================================================
#pragma once

#include <vector>
#include <cstdint>
#include <cstddef>
#include <memory.h>

inline void blob_write(std::vector<uint8_t>& blob, const void* data, size_t size)
{
	blob.resize(blob.size() + size);
	memcpy(blob.data() + blob.size() - size, data, size);
}



================================================
FILE: PCMPlayer/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(PCMPlayer)

set(SOURCES
../DSPUtil/complex.cpp
../DSPUtil/fft.cpp
api.cpp
PCMPlayer.cpp
)

set(HEADERS 
../DSPUtil/complex.h
../DSPUtil/fft.h
PCMPlayer.h
)


set (INCLUDE_DIR
../ScoreDraftCore
../DSPUtil
../thirdparty/portaudio/include
../thirdparty/glfw/include
)


if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)
endif()

include_directories(${INCLUDE_DIR})
add_definitions(${DEFINES})
add_library (PCMPlayer SHARED  ${SOURCES} ${HEADERS})
target_link_libraries(PCMPlayer ScoreDraftCore portaudio_static glfw)

if (WIN32) 
target_link_libraries(PCMPlayer opengl32)
else()
target_link_libraries(PCMPlayer GL)
endif()

if (WIN32) 
target_compile_definitions(PCMPlayer PUBLIC SCOREDRAFTCORE_DLL_IMPORT)
endif()

if (WIN32) 
install(TARGETS PCMPlayer RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS PCMPlayer DESTINATION ScoreDraft)
endif()



================================================
FILE: PCMPlayer/PCMPlayer.cpp
================================================
#include <thread>
#include <mutex>
#include <vector>
#include <list>
#include <queue>
#include <memory.h>
#include <cmath>
#include <portaudio.h>
#include <GLFW/glfw3.h>

#include <TrackBuffer.h>
#include <utils.h>
#include "PCMPlayer.h"


#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif


class TrackBufferCopy
{
public:
	TrackBufferCopy(TrackBuffer& input)
	{
		m_AlignPos = input.AlignPos();
		m_chn = input.NumberOfChannels();
		unsigned size = input.NumberOfSamples();
		m_data.resize(size*m_chn);

		float volume = input.AbsoluteVolume();
		float pan = input.Pan();

		for (unsigned i = 0; i < size; i++)
		{
			float sample[2];
			input.Sample(i, sample);
			if (m_chn == 1)
			{
				m_data[i] = (short)(max(min(sample[0] * volume, 1.0f), -1.0f)*32767.0f);
			}
			else if (m_chn == 2)
			{
				CalcPan(pan, sample[0], sample[1]);
				m_data[2 * i] = (short)(max(min(sample[0] * volume, 1.0f), -1.0f)*32767.0f);
				m_data[2 * i + 1] = (short)(max(min(sample[1] * volume, 1.0f), -1.0f)*32767.0f);
			}
		}
	}

	~TrackBufferCopy()
	{

	}

	std::vector<short> m_data;
	unsigned m_AlignPos;
	unsigned m_chn;
};

class TrackBufferQueue
{
public:
	TrackBufferQueue()
	{

	}

	~TrackBufferQueue()
	{

	}

	size_t Size()
	{
		return m_queue.size();
	}

	void Front2(TrackBufferCopy*& track0, TrackBufferCopy*& track1)
	{
		track0 = nullptr;
		track1 = nullptr;
		m_mutex.lock();
		auto iter = m_queue.begin();
		if (iter != m_queue.end())
		{
			track0 = *iter;
			iter++;
			if (iter != m_queue.end())
			{
				track1 = *iter;
			}
		}		
		m_mutex.unlock();
	}

	void Push(TrackBufferCopy* buf)
	{
		m_mutex.lock();
		m_queue.push_back(buf);
		m_mutex.unlock();
	}

	TrackBufferCopy* Pop()
	{
		m_mutex.lock();
		TrackBufferCopy* ret = m_queue.front();
		m_queue.pop_front();
		m_mutex.unlock();
		return ret;
	}

private:
	std::list<TrackBufferCopy*> m_queue;
	std::mutex m_mutex;
};

class AudioBufferQueue
{
public:
	AudioBufferQueue(int cache_size) : m_semaphore_in(cache_size)
	{
	}

	~AudioBufferQueue()
	{
	}

	size_t Size()
	{
		return m_queue.size();
	}

	AudioBuffer* Front()
	{
		return m_queue.front();
	}

	void Push(AudioBuffer* packet)
	{
		m_semaphore_in.wait();
		m_mutex.lock();
		m_queue.push(packet);
		m_mutex.unlock();
		m_semaphore_out.notify();
	}

	AudioBuffer* Pop()
	{
		m_semaphore_out.wait();
		m_mutex.lock();
		AudioBuffer* ret = m_queue.front();
		m_queue.pop();
		m_mutex.unlock();
		m_semaphore_in.notify();
		return ret;
	}

private:
	std::queue<AudioBuffer*> m_queue;
	std::mutex m_mutex;
	Semaphore m_semaphore_in;
	Semaphore m_semaphore_out;
};


int PCMPlayer::stream_callback(const void *inputBuffer, void *outputBuffer,
	unsigned long framesPerBuffer,
	const PaStreamCallbackTimeInfo* timeInfo,
	unsigned long statusFlags,
	void *userData)
{
	PCMPlayer* self = (PCMPlayer*)userData;
	AudioBufferQueue* queue = self->m_audio_queue.get();
	unsigned long pos_out = 0;
	short *out = (short*)outputBuffer;
	while (pos_out < framesPerBuffer)
	{
		if (queue->Size() < 1) break;
		AudioBuffer* buf_in = queue->Front();		
		size_t copy_size = min(AUDIO_BUF_LEN - self->m_audio_read_pos, framesPerBuffer - pos_out);
		memcpy(out + pos_out * 2, buf_in->data + self->m_audio_read_pos * 2, sizeof(short)*copy_size * 2);
		self->m_audio_read_pos += copy_size;
		pos_out += (unsigned long)copy_size;
		if (self->m_audio_read_pos == AUDIO_BUF_LEN)
		{
			self->m_audio_read_pos = 0;
			queue->Pop();
			delete buf_in;			
		}
	}
	if (pos_out < framesPerBuffer)
		memset(out + pos_out * 2, 0, sizeof(short) * (framesPerBuffer - pos_out) * 2);

	return paContinue;
}

void PCMPlayer::thread_demux(PCMPlayer* self)
{
	TrackBufferQueue* queue_in = self->m_input_queue.get();
	AudioBufferQueue* queue_out = self->m_audio_queue.get();
	while (self->m_demuxing)
	{
		AudioBuffer* buf_out = new AudioBuffer;
		size_t pos_out = 0;
		while (pos_out < AUDIO_BUF_LEN)
		{
			TrackBufferCopy *buf_in, *buf_in2;
			queue_in->Front2(buf_in, buf_in2);
			if (buf_in == nullptr) break;

			size_t size_in = buf_in->m_data.size() / buf_in->m_chn;
			size_t copy_size = min(size_in - self->m_input_read_pos, AUDIO_BUF_LEN - pos_out);
			
			for (size_t i = 0; i < copy_size; i++)
			{
				size_t read_pos = self->m_input_read_pos + i;
				short value[2] = { 0,0 };
				if (buf_in->m_chn == 1)
				{
					value[0] = value[1] = buf_in->m_data[read_pos];
				}
				else if (buf_in->m_chn == 2)
				{
					value[0] = buf_in->m_data[read_pos * 2];
					value[1] = buf_in->m_data[read_pos * 2 + 1];
				}

				if (buf_in2 != nullptr && read_pos > size_in - buf_in2->m_AlignPos)
				{
					unsigned read_pos2 = (unsigned)read_pos - (unsigned)(size_in - buf_in2->m_AlignPos);					
					short value2[2] = { 0,0 };
					if (buf_in2->m_chn == 1)
					{
						value2[0] = value2[1] = buf_in2->m_data[read_pos2];
					}
					else if (buf_in2->m_chn == 2)
					{
						value2[0] = buf_in2->m_data[read_pos2 * 2];
						value2[1] = buf_in2->m_data[read_pos2 * 2 + 1];
					}

					for (unsigned j = 0; j < 2; j++)
					{
						int v = (int)value[j] + (int)value2[j];
						if (v > 32767) v = 32767;
						else if (v < -32767) v = -32767;
						value[j] = (short)v;
					}
				}

				size_t write_pos = pos_out + i;
				buf_out->data[write_pos * 2] = value[0];
				buf_out->data[write_pos * 2 + 1] = value[1];
			}	

			pos_out += copy_size;

			self->m_mutex_progress.lock();
			self->m_input_read_pos += copy_size;
			if (self->m_input_read_pos == size_in)
			{				
				self->m_total_length -= buf_in->m_data.size() / buf_in->m_chn;
				if (buf_in2 != nullptr)
				{
					self->m_input_read_pos = buf_in2->m_AlignPos;
				}
				else
				{
					self->m_input_read_pos = 0;
				}				
				self->m_mutex_progress.unlock();

				queue_in->Pop();
				delete buf_in;
			}
			else
			{
				self->m_mutex_progress.unlock();
			}		
			
		}
		if (pos_out < AUDIO_BUF_LEN)
			memset(buf_out->data + pos_out * 2, 0, sizeof(short) * (AUDIO_BUF_LEN - pos_out) * 2);

		self->m_ring_buf[self->m_next_buf] = *buf_out;
		self->m_next_buf = (self->m_next_buf + 1) % 12;
		queue_out->Push(buf_out);		
	}
}

thread_local int PCMPlayer::s_instance_count = 0;

PCMPlayer::PCMPlayer(double sample_rate, bool ui) : m_sample_rate(sample_rate)
{
	if (s_instance_count == 0) Pa_Initialize();
	s_instance_count++;

	m_input_queue = std::unique_ptr<TrackBufferQueue>(new TrackBufferQueue);
	m_audio_queue = std::unique_ptr<AudioBufferQueue>(new AudioBufferQueue(8));

	m_demuxing = true;
	m_thread_demux = (std::unique_ptr<std::thread>)(new std::thread(thread_demux, this));

	PaStreamParameters outputParameters = {};
	outputParameters.device = Pa_GetDefaultOutputDevice();
	outputParameters.channelCount = 2;
	outputParameters.sampleFormat = paInt16;
	outputParameters.suggestedLatency = Pa_GetDeviceInfo(outputParameters.device)->defaultLowOutputLatency;

	Pa_OpenStream(&m_stream, nullptr, &outputParameters, sample_rate, (unsigned long)(sample_rate*0.01), paClipOff, stream_callback, this);
	Pa_StartStream(m_stream);
	
	if (ui)
	{
		glfwInit();		
		m_window = glfwCreateWindow(640, 320, "ScoreDraft PCM Player", NULL, NULL);
		glfwMakeContextCurrent(m_window);
		glfwSwapInterval(1);
		glfwSetWindowUserPointer(m_window, this);
		glfwSetKeyCallback(m_window, key_callback);
		printf("Press 'W' to show waveform.\n");
		printf("Press 'S' to show spectrum.\n");
	}
}

PCMPlayer::~PCMPlayer()
{
	if (m_window != nullptr)
	{
		glfwDestroyWindow(m_window);
		glfwTerminate();
	}

	m_demuxing = false;

	Pa_StopStream(m_stream);
	Pa_CloseStream(m_stream);

	while (m_audio_queue->Size() > 0)
	{
		AudioBuffer* p = m_audio_queue->Pop();
		delete p;
	}

	while (m_input_queue->Size() > 0)
	{
		TrackBufferCopy* p = m_input_queue->Pop();
		delete p;
	}

	m_thread_demux->join();
	m_thread_demux = nullptr;

	s_instance_count--;
	if (s_instance_count == 0) Pa_Terminate();
}

void PCMPlayer::PlayTrack(TrackBuffer &track)
{
	m_input_queue->Push(new TrackBufferCopy(track));
	m_mutex_progress.lock();
	m_total_length += track.NumberOfSamples();
	m_mutex_progress.unlock();
}

float PCMPlayer::GetRemainingTime()
{
	m_mutex_progress.lock();
	float remaining = (float)(m_total_length - m_input_read_pos) / (float)m_sample_rate;
	m_mutex_progress.unlock();
	return remaining;
}

void PCMPlayer::draw()
{
	int width, height;
	glfwGetFramebufferSize(m_window, &width, &height);
	glViewport(0, 0, width, height);

	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
	glClear(GL_COLOR_BUFFER_BIT);

	glDisable(GL_DEPTH_TEST);

	switch (m_mode)
	{
	case Mode::WaveForm:
	{
		int start_buf = (m_next_buf + 10) % 12;
		for (int i = 0; i < 2; i++)
		{
			int buf_i = (start_buf + i) % 12;
			for (int j = 0; j < AUDIO_BUF_LEN; j++)
			{
				int k = i * AUDIO_BUF_LEN + j;
				m_wavaform_cache[k] = ((float)m_ring_buf[buf_i].data[j * 2] + (float)m_ring_buf[buf_i].data[j * 2 + 1]) / 65536.0f;
			}
		}

		glColor3f(1.0f, 1.0f, 0.0f);
		glBegin(GL_LINE_STRIP);
		for (int i = 0; i < AUDIO_BUF_LEN * 2; i++)
		{
			float x = (float)i / (float)(AUDIO_BUF_LEN * 2 - 1)*2.0f - 1.0f;
			float y = m_wavaform_cache[i]*0.75f;
			glVertex2f(x, y);
		}		
		glEnd();
	}
	break;
	case Mode::Spectrum:
	{
		int start_buf = (m_next_buf + 8) % 12;
		for (int i = 0; i < 4; i++)
		{
			int buf_i = (start_buf + i) % 12;
			for (int j = 0; j < AUDIO_BUF_LEN; j++)
			{
				int k = i * AUDIO_BUF_LEN + j;
				m_spectrum_cache[k] = ((float)m_ring_buf[buf_i].data[j * 2] + (float)m_ring_buf[buf_i].data[j * 2 + 1]) / 65536.0f;
			}
		}

		for (unsigned i = 0; i < 2048; i++)
		{
			float x = (float)((int)i - 1024) / 1024.0f;
			float win = 0.5f*(cosf(x*(float)PI) + 1.0f);
			m_fftData[i].Re = win * m_spectrum_cache[i];
			m_fftData[i].Im = 0.0f;
		}

		fft(m_fftData, 11);

		for (unsigned i = 0; i < 100; i++)
		{
			float fstart = powf(2.0f, (float)i*0.1f);
			float fstop = powf(2.0f, (float)(i + 1)*0.1f);

			unsigned ustart = (unsigned)ceilf(fstart);
			unsigned ustop = (unsigned)ceilf(fstop);

			float ave = 0.0f;
			if (ustart == ustop)
				ave = DCAbs(&m_fftData[ustart]);
			else
			{
				for (unsigned j = ustart; j < ustop; j++)
				{
					ave += DCAbs(&m_fftData[j]);
				}
				ave /= (float)(ustop - ustart);
			}

			m_barv[i] = logf(ave*10.0f) / 10.0f;

		}

		glBegin(GL_QUADS);

		for (unsigned i = 0; i < 100.0f; i++)
		{
			float center = ((float)i + 0.5f) / 100.0f;
			float halfWidth = 0.4f / 100.0f;
			float left = center - halfWidth;
			float right = center + halfWidth;

			left = left * 2.0f - 1.0f;
			right = right * 2.0f - 1.0f;

			float bottom = -1.0f;

			float v = m_barv[i];
			if (v > 1.0f) v = 1.0f;
			float top = v * 2.0f - 1.0f;

			glColor3f(0.5f, 1.0f, 0.0f);
			glVertex2f(right, bottom);
			glVertex2f(left, bottom);

			glColor3f(0.5f + 0.5f*v, 1.0f - v, 0.0f);
			glVertex2f(left, top);
			glVertex2f(right, top);
		}
		glEnd();

	}
	break;
	}

}

void PCMPlayer::key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
{
	PCMPlayer* self = (PCMPlayer*)glfwGetWindowUserPointer(window);
	if (key == GLFW_KEY_W && action == GLFW_PRESS)
	{
		self->m_mode = Mode::WaveForm;
	}

	if (key == GLFW_KEY_S && action == GLFW_PRESS)
	{
		self->m_mode = Mode::Spectrum;
	}

}

void PCMPlayer::main_loop()
{
	if (m_window == nullptr) return;
	while (glfwWindowShouldClose(m_window) == 0)
	{
		glfwMakeContextCurrent(m_window);
		draw();
		glfwSwapBuffers(m_window);
		glfwPollEvents();
	}
}


================================================
FILE: PCMPlayer/PCMPlayer.h
================================================
#pragma once

#include <memory>
#include <mutex>
#include "fft.h"

namespace std
{
	class thread;
}

#define AUDIO_BUF_LEN 512
struct AudioBuffer
{
	short data[AUDIO_BUF_LEN * 2];
};

class TrackBuffer;
class TrackBufferQueue;
class AudioBufferQueue;

struct PaStreamCallbackTimeInfo;

struct GLFWwindow;


class PCMPlayer
{
public:
	PCMPlayer(double sample_rate = 44100.0, bool ui = false);
	~PCMPlayer();

	void PlayTrack(TrackBuffer &track);
	float GetRemainingTime();

	// UI
	void main_loop();

private:
	static thread_local int s_instance_count;	
	void *m_stream;
	static int stream_callback(const void *inputBuffer, void *outputBuffer,
		unsigned long framesPerBuffer,
		const PaStreamCallbackTimeInfo* timeInfo,
		unsigned long statusFlags,
		void *userData);

	double m_sample_rate;
	std::unique_ptr<TrackBufferQueue> m_input_queue;
	std::unique_ptr<AudioBufferQueue> m_audio_queue;
	size_t m_input_read_pos = 0;
	size_t m_audio_read_pos = 0;
	size_t m_total_length = 0;

	std::mutex m_mutex_progress;

	bool m_demuxing = false;
	static void thread_demux(PCMPlayer* self);
	std::unique_ptr<std::thread> m_thread_demux;

	// UI
	GLFWwindow* m_window = nullptr;
	void draw();
	static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods);

	enum class Mode
	{
		Spectrum,
		WaveForm
	};

	Mode m_mode = Mode::WaveForm;

	int m_next_buf = 0;
	AudioBuffer m_ring_buf[12];
	float m_wavaform_cache[AUDIO_BUF_LEN * 2];
	float m_spectrum_cache[AUDIO_BUF_LEN * 4];
	DComp m_fftData[2048];
	float m_barv[100];

};

================================================
FILE: PCMPlayer/api.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif


extern "C"
{
	SCOREDRAFT_API void* PCMPlayerCreate(double sample_rate, unsigned ui);
	SCOREDRAFT_API void PCMPlayerDestroy(void* ptr);
	SCOREDRAFT_API void PlayTrack(void* ptr, void* ptr_track);
	SCOREDRAFT_API float GetRemainingTime(void* ptr);
	SCOREDRAFT_API void MainLoop(void* ptr);
}

#include "PCMPlayer.h"

void* PCMPlayerCreate(double sample_rate, unsigned ui)
{
	return new PCMPlayer(sample_rate, ui!=0);
}

void PCMPlayerDestroy(void* ptr)
{
	PCMPlayer* player = (PCMPlayer*)ptr;
	delete player;
}

void PlayTrack(void* ptr, void* ptr_track)
{
	PCMPlayer* player = (PCMPlayer*)ptr;
	TrackBuffer* track = (TrackBuffer*)ptr_track;
	player->PlayTrack(*track);
}

float GetRemainingTime(void* ptr)
{
	PCMPlayer* player = (PCMPlayer*)ptr;
	return player->GetRemainingTime();
}

void MainLoop(void* ptr)
{
	PCMPlayer* player = (PCMPlayer*)ptr;
	player->main_loop();
}


================================================
FILE: README.md
================================================
[-> 中文Readme](README_cn.md)

# ScoreDraft

ScoreDraft is a music/singing synthesizer that provides a Python based 
score authoring interface. 

Currently, it includes the following synthesizer engines:

* Instrumental
  - SimpleInstruments: simple mathematic functions like sine-waves
  - KarplusStrong: guitar simulator using pure algorithm
  - BasicSamplers: tones generated by sampling one or multiple waveform samples
  - SoundFont2
* Percussion
  - BasicSamplers
  - SoundFont2 (GM Drums)
* Voice
  - VoiceSampler: a PSOLA-like algorithm is used to sample voice samples. A front-end "UtauDraft" is provided making it compatible to existing UTAU voice banks.

The framework is open and can be easily extended.

A PCM Player is provided to playback and visualize generated waveforms.

A more sophisticated visualizer "Meteor" is provided to visualize the notes/beats/syllables where the music is generated from.

The following example shows how easily a piece of musical sound can be generated using ScoreDraft.

```Python
    import ScoreDraft
    from ScoreDraft.Notes import *

    doc=ScoreDraft.Document()

    seq=[do(),do(),so(),so(),la(),la(),so(5,96)]

    doc.playNoteSeq(seq, ScoreDraft.Piano())
    doc.mixDown('twinkle.wav')
```

Starting from version 1.0.3, ScoreDraft now supports a YAML based input format, which looks like:

```yaml
# test.yaml
score:
    staffs:
        -
            relative: c''
            instrument: Piano()
            content: |
                c4 c g g a a g2
```

where in the 'content' part, LilyPond syntax can be used to input notes. The following shell command can be used to generate a wav:

```
# scoredraft -wav twinkle.wav test.yaml
```
For GUI editor, see [ScoreDraftEditor](https://github.com/fynv/ScoreDraftEditor)

For more detailed introduction and demos see: [https://fynv.github.io/ScoreDraft/](https://fynv.github.io/ScoreDraft/)

## Installation

ScoreDraft is now available from PyPi. Windows x64/Linux x64 supported.

```
# pip install scoredraft
```

Known issue: For Linux, it is only tested on Ubuntu 20.04. It is known to be not working on Ubuntu 18.04.

## Building

Build-time dependencies:

* CMake 3.0+

* Python3

* CUDA(optional): To build without CUDA, disable the CMake option "USE_CUDA"

* FreeType: 
  
  - Library included for Windows
  - Ubuntu: sudo apt install libfreetype-dev

* GLFW: 
  
  - Source code included
  - Ubuntu: sudo apt install libglfw3-dev libxinerama-dev libxcursor-dev libxi-dev

* PortAudio:
  
  - Source code included
  - Ubuntu: sudo apt-get install libasound-dev libjack-dev

Build process:

```
# mkdir build
# cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=../Test
# make
# make install
```

Run-time dependencies:

* Python3 
* cffi
* X-org, ALSA drivers are optionally needed for players
* xsdata, python_ly are optionally needed for MusicXML and LilyPond support
* pyyaml is optionally needed for YAML support

## Samples & Voice Banks

To avoid causing troubles, ScoreDraft now only includes a minimal set of instrumental/percussion samples to support the tests. The PyPi package doesn't include any of these.

ScoreDraft indexes the samples and banks by searching specific directory where the python script is started.

* Directory InstrumentSamples: wav instrument samples
  
  - There can be sub-directories containing multiple wav samples defining a single instrument for different pitch ranges.
  - Optionally, a freq file can be provided to define the frequency of the sample tone.

* Directory PercussionSamples: wav percussion samples

* Directory SF2: SoundFont2 bank files

* Directory UTAUVoice: UTAU voice banks (as sub-directories)

Users need to help themselves to download and organize extra samples and voicebanks. Here are just some recommandations, which is what I do at my place.

* Instrument/Percussion wav samples:
  
  - https://freewavesamples.com

* SoundFont2 Instruments
  
  - Arachno: http://www.arachnosoft.com/main/download.php?id=soundfont-sf2
  - SynthFontViena: http://www.synthfont.com/

* UTAU
  
  - uta(Japanese): default voice-bank that comes with UTAU
  - TetoEng(English): https://kasaneteto.jp/en/voicebank.html
  - Ayaka(Chinese): https://bowlroll.net/file/53297
  - Ayaka2 (Japanese): https://bowlroll.net/file/69898
  - WanEr(Chinese): http://lindayana.lofter.com/waner

## License

ScoreDraft is now formally available under [MIT license](https://choosealicense.com/licenses/mit/).

## Version History

ScoreDraft was my first Python project. There were some severe limitations for pythonic packaging and releasing.
As a result, there was no formal release before the Nov 2021 refactoring (version 1.0.0).

[SingingGadgets](https://pypi.org/project/singinggadgets/) was a refactoring attempt in 2018, 
which only partially solves the issues. 

After the Nov 2021 refactoring, ScoreDraft have all the benefits of both SingingGadgets and the old ScoreDraft.
Therefore, the SingingGadgets project is now closed.

* Dec 17, 2021. ScoreDraft 1.0.11, fix slur handling
* Dec 12, 2021. ScoreDraft 1.0.10, support track volume for YAML input
* Dec 12, 2021. ScoreDraft 1.0.8 & 1.0.9, bug fix
* Dec 04, 2021. ScoreDraft 1.0.7, percussion visualization bug fix
* Dec 01, 2021. ScoreDraft 1.0.6, expose more low-level functions
* Nov 29, 2021. ScoreDraft 1.0.4, 1.0.5, YAML function updates
* Nov 27, 2021. ScoreDraft 1.0.3, adding a YAML based input routine support
* Nov 24, 2021. ScoreDraft 1.0.2, adding MusicXML & LilyPond support
* Nov 19, 2021. ScoreDraft 1.0.0 & 1.0.1
* Jun 16, 2018. SingingGadgets 0.0.3


================================================
FILE: README_cn.md
================================================
# ScoreDraft

ScoreDraft 是一个音乐和歌唱合成系统,它提供了基于Python的乐谱创作(或录入)界面。

目前,它集成了下列几种合成引擎:

* 乐器合成
  - SimpleInstruments: 基于简单数学函数,如正弦波
  - KarplusStrong: 基于纯算法的吉他模拟器
  - BasicSamplers: 由单个或多个波形文件采样生成音符
  - SoundFont2
* 打击乐合成
  - BasicSamples
  - SoundFont2 (GM 鼓轨)
* 语音合成
  - VoiceSampler: 采用类PSOLA的算法采样语音样本,提供了名为UtauDraft的前端来兼容UTAU音源

系统框架是开放的,极易扩展。

PCMPlayer 提供了一个简单的音频播放和可视化工具。

Meteor 提供了更高级的可视化功能,可以可视化用来生成音乐的音符和音节输入。

下面这个例子展示了通过ScoreDraft来合成一小段音乐可以多么简单。

```Python
    import ScoreDraft
    from ScoreDraft.Notes import *

    doc=ScoreDraft.Document()

    seq=[do(),do(),so(),so(),la(),la(),so(5,96)]

    doc.playNoteSeq(seq, ScoreDraft.Piano())
    doc.mixDown('twinkle.wav')
```

从版本 1.0.3 开始,ScoreDraft 支持一种基于 YAML 的输入格式,例如:

```yaml
# test.yaml
score:
    staffs:
        -
            relative: c''
            instrument: Piano()
            content: |
                c4 c g g a a g2
```

其中 content 部分使用 LilyPond 的语法。可以使用以下命令把 YAML 文件合成为wav:

```
# scoredraft -wav twinkle.wav test.yaml
```

另有图形界面的编辑器, 详见:[ScoreDraftEditor](https://github.com/fynv/ScoreDraftEditor)

更详细的使用说明和演示见: [https://fynv.github.io/ScoreDraft/](https://fynv.github.io/ScoreDraft/)

## 安装

ScoreDraft 现在可以由 PyPi 安装,支持64位的 Windows 和 Linux 系统。

```
# pip install scoredraft
```

已知问题:Linux方面只在Ubuntu20.04测试通过,已知在Ubuntu18.04上有问题。

## 编译

编译期依赖:

* CMake 3.0+

* Python3

* CUDA(可选): 如果没有CUDA可以去掉 CMake 的 "USE_CUDA" 选项

* FreeType: 
  
  - 已包含Windows开发库
  - Ubuntu: sudo apt install libfreetype-dev

* GLFW: 
  
  - 已包含源代码
  - Ubuntu: sudo apt install libglfw3-dev libxinerama-dev libxcursor-dev libxi-dev

* PortAudio:
  
  - 已包含源代码
  - Ubuntu: sudo apt-get install libasound-dev libjack-dev

编译过程:

```
# mkdir build
# cd build
# cmake .. -DCMAKE_INSTALL_PREFIX=../Test
# make
# make install
```

运行期依赖:

* Python3 
* cffi
* 播放器依赖于X.org和ALSA驱动
* MusicXML 和 LilyPond 支持依赖于 xsdata, python_ly
* YAML 支持依赖于 pyyaml

## 采样和语音音源

为了避免麻烦,ScoreDraft 目前只包含最低限度的乐器和打击乐采样用来测试。PyPi安装的版本则不提供任何这些文件。

ScoreDraft 基于 Python 脚本的启动位置来搜索特定目录,以此建立乐器样本和语音音源的索引。

* InstrumentSamples 目录:wav 乐器样本
  
  - 可以包含子目录,每个子目录包含多个wav文件,共同来定义一个乐器的不同音高范围。
  - 对每个wav文件,可以有一个对应的freq文件来定义采样的音高

* PercussionSamples 目录:wav 打击乐样本

* SF2 目录:SoundFont2 乐器库文件

* UTAUVoice:UTAU 语音音源库,每个库一个子目录

用户需要自行下载和布署这些音源。以下推荐几个作者自己在用的音源。

* wav 乐器采样:
  
  - https://freewavesamples.com

* SoundFont2 乐器库
  
  - Arachno: http://www.arachnosoft.com/main/download.php?id=soundfont-sf2
  - SynthFontViena: http://www.synthfont.com/
  - 

* UTAU
  
  - uta(Japanese): default voice-bank that comes with UTAU
  - TetoEng(English): https://kasaneteto.jp/en/voicebank.html
  - Ayaka(Chinese): https://bowlroll.net/file/53297
  - Ayaka2 (Japanese): https://bowlroll.net/file/69898
  - WanEr(Chinese): http://lindayana.lofter.com/waner

## 版权协议

ScoreDraft 目前已正式基于MIT协议授权。

## 版本历史

ScoreDraft 实际上是我的第一个Python项目,由于一些设计问题,长期以来ScoreDraft无法用常规的Python流程来打包和发布。
直到2021年11月的这次重构,ScoreDraft才有了第一个正式版本。

在2018年曾经做过一次重构尝试,叫做[SingingGadgets](https://pypi.org/project/singinggadgets/),只部分解决了问题。

在2021年11月的重构之后,ScoreDraft已经具有SingingGadgets和早期ScoreDraft的全部优点,因此SingingGadgets项目现已被关闭。

* 2021年12月17日. ScoreDraft 1.0.11 修正连音线处理
* 2021年12月12日. ScoreDraft 1.0.10 YAML输入支持音轨volume
* 2021年12月12日. ScoreDraft 1.0.8 & 1.0.9 修正bug
* 2021年12月04日. ScoreDraft 1.0.7 修正打击乐可视化bug
* 2021年12月01日. ScoreDraft 1.0.6 暴露更多底层函数
* 2021年11月29日. ScoreDraft 1.0.4, 1.0.5 更新YAML功能
* 2021年11月27日. ScoreDraft 1.0.3 增加了一个基于YAML的乐谱输入方案
* 2021年11月24日, ScoreDraft 1.0.2 加入对MusicXML和LilyPond的支持
* 2021年11月19日. ScoreDraft 1.0.0 & 1.0.1
* 2018年06月16日. SingingGadgets 0.0.3


================================================
FILE: ScoreDraftCore/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(ScoreDraftCore)

set(SOURCES
api.cpp
TrackBuffer.cpp
ReadWav.cpp
WriteWav.cpp
)

set(HEADERS 
api.h
utils.h
WavBuffer.h
TrackBuffer.h
ReadWav.h
WriteWav.h
)

if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)
endif()

add_definitions(${DEFINES})
add_library (ScoreDraftCore SHARED ${SOURCES} ${HEADERS})

if (WIN32) 
target_compile_definitions(ScoreDraftCore PRIVATE SCOREDRAFTCORE_DLL_EXPORT)
endif()

if (WIN32) 
install(TARGETS ScoreDraftCore RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS ScoreDraftCore DESTINATION ScoreDraft)
endif()



================================================
FILE: ScoreDraftCore/ReadWav.cpp
================================================
#include "ReadWav.h"
#include <cmath>

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

struct WavHeader
{
	unsigned short wFormatTag;
	unsigned short wChannels;
	unsigned int dwSamplesPerSec;
	unsigned int dwAvgBytesPerSec;
	unsigned short wBlockAlign;
	unsigned short wBitsPerSample;
};


ReadWav::ReadWav()
{
	m_fp = nullptr;
}

ReadWav::~ReadWav()
{
	if (m_fp) fclose(m_fp);
}

bool ReadWav::OpenFile(const char* filename)
{
	if (m_fp) fclose(m_fp);
	m_fp = fopen(filename, "rb");
	return (m_fp != nullptr);
}

void ReadWav::CloseFile()
{
	if (m_fp) fclose(m_fp);
	m_fp = nullptr;
}


bool ReadWav::ReadHeader(unsigned& sampleRate, unsigned& numSamples, unsigned& chn)
{
	if (!m_fp) return false;

	char c_riff[4] = { 'R', 'I', 'F', 'F' };
	unsigned& u_riff = *(unsigned*)c_riff;

	char c_wave[4] = { 'W', 'A', 'V', 'E' };
	unsigned& u_wave = *(unsigned*)c_wave;

	char c_fmt[4] = { 'f', 'm', 't', ' ' };
	unsigned& u_fmt = *(unsigned*)c_fmt;

	char c_data[4] = { 'd', 'a', 't', 'a' };
	unsigned& u_data = *(unsigned*)c_data;

	unsigned buf32;

	fread(&buf32, 4, 1, m_fp);
	if (buf32 != u_riff)
	{
		fclose(m_fp);
		return false;
	}

	unsigned chunkSize;
	fread(&chunkSize, 4, 1, m_fp);

	fread(&buf32, 4, 1, m_fp);
	if (buf32 != u_wave)
	{
		fclose(m_fp);
		return false;
	}

	fread(&buf32, 4, 1, m_fp);
	if (buf32 != u_fmt)
	{
		fclose(m_fp);
		return false;
	}

	unsigned headerSize;
	unsigned skipSize = 0;
	unsigned skipBuffer;

	fread(&headerSize, 4, 1, m_fp);
	if (headerSize < sizeof(WavHeader))
	{
		fclose(m_fp);
		return false;
	}
	else if (headerSize > sizeof(WavHeader))
	{
		if (headerSize - sizeof(WavHeader) > 4)
		{
			fclose(m_fp);
			return false;
		}
		skipSize = headerSize - sizeof(WavHeader);
	}

	WavHeader header;
	fread(&header, sizeof(WavHeader), 1, m_fp);

	if (skipSize > 0)
	{
		fread(&skipBuffer, 1, skipSize, m_fp);
	}

	if (header.wFormatTag != 1)
	{
		fclose(m_fp);
		return false;
	}

	chn = header.wChannels;
	if (chn<1 || chn>2)
	{
		fclose(m_fp);
		return false;
	}

	sampleRate = header.dwSamplesPerSec;

	if (header.wBitsPerSample != 16)
	{
		fclose(m_fp);
		return false;
	}

	fread(&buf32, 4, 1, m_fp);
	if (buf32 != u_data)
	{
		fclose(m_fp);
		return false;
	}

	unsigned dataSize;
	fread(&dataSize, 4, 1, m_fp);

	numSamples = dataSize / chn / 2;

	m_totalSamples = numSamples;
	m_num_channels = chn;
	m_readSamples = 0;

	return true;
}


bool ReadWav::ReadSamples(float* samples, unsigned count, float& max_v)
{
	if (!m_fp) return false;
	count = min(count, m_totalSamples - m_readSamples);

	if (count > 0)
	{
		short* data = new short[count*m_num_channels];
		fread(data, sizeof(short), count*m_num_channels, m_fp);

		max_v = 0.0f;
		for (unsigned i = 0; i < count*m_num_channels; i++)
		{	
			float v = (float)data[i] / 32767.0f;
			samples[i] = v;
			max_v = max(max_v, fabsf(v));
		}
		delete[] data;

		m_readSamples += count;
	}

	if (m_totalSamples - m_readSamples <= 0) CloseFile();

	return true;
}


================================================
FILE: ScoreDraftCore/ReadWav.h
================================================
#ifndef _ReadWav_h
#define _ReadWav_h

#include <stdio.h>
class ReadWav
{
public:
	ReadWav();
	~ReadWav();

	bool OpenFile(const char* filename);
	void CloseFile();

	bool ReadHeader(unsigned &sampleRate, unsigned &numSamples, unsigned& chn);
	bool ReadSamples(float* samples, unsigned count, float& maxv);

private:
	FILE* m_fp;
	unsigned m_totalSamples;
	unsigned m_num_channels;
	unsigned m_readSamples;
};

#endif


================================================
FILE: ScoreDraftCore/TrackBuffer.cpp
================================================
#include <memory.h>
#include <cmath>
#include <cassert>
#include "TrackBuffer.h"
#include "utils.h"

static const unsigned s_localBufferSize = 65536;
unsigned TrackBuffer::GetLocalBufferSize()
{
	return s_localBufferSize;
}


TrackBuffer::TrackBuffer(unsigned rate, unsigned chn) : m_rate(rate)
{
	if (chn < 1)
	{
		chn = 1;
	}
	else if (chn > 2)
	{
		chn = 2;
	}
	m_chn = chn;

	m_fp = tmpfile();

	m_localBuffer = new float[s_localBufferSize*m_chn];
	m_localBufferPos = (unsigned)(-1);

	m_volume = 1.0f;
	m_pan = 0.0f;
	m_cursor = 0.0f;
	m_length = 0;
	m_alignPos = (unsigned)(-1);
}

TrackBuffer::~TrackBuffer()
{
	delete m_localBuffer;
	fclose(m_fp);
}


void TrackBuffer::_seek(unsigned upos)
{
	if (upos <= m_length)
	{
		fseek(m_fp, (long)(sizeof(float)*upos*m_chn), SEEK_SET);
	}
	else
	{
		fseek(m_fp, 0, SEEK_END);
		float *tmp = new float[(upos - m_length)*m_chn];
		memset(tmp, 0, (upos - m_length)*m_chn * sizeof(float));
		fwrite(tmp, sizeof(float), (upos - m_length)*m_chn, m_fp);
		delete[] tmp;
		m_length = upos;
	}
}


float TrackBuffer::GetCursor()
{
	return m_cursor;
}

void TrackBuffer::SetCursor(float fpos)
{
	if (m_alignPos == (unsigned)(-1)) m_alignPos = 0;
	m_cursor = fpos;
	if (m_cursor < 0.0f) m_cursor = 0.0f;
}

void TrackBuffer::MoveCursor(float delta)
{
	SetCursor(m_cursor + delta);
}


void TrackBuffer::SeekToCursor()
{
	unsigned upos = (unsigned)_ms2sample(m_cursor);
	_seek(upos);
}


void TrackBuffer::_writeSamples(unsigned count, const float* samples, unsigned alignPos)
{
	unsigned upos = (unsigned)_ms2sample(m_cursor) + m_alignPos - alignPos;
	_seek(upos);
	fwrite(samples, sizeof(float), count*m_chn, m_fp);
	m_length = max(m_length, upos + count);
	m_localBufferPos = -1;
}

void TrackBuffer::WriteBlend(const WavBuffer& wavBuf)
{
	assert(wavBuf.m_sampleRate == m_rate);
	unsigned count = (unsigned)wavBuf.m_sampleNum;
	unsigned src_chn = wavBuf.m_channelNum;

	float* samples = wavBuf.m_data;
	unsigned note_alignPos = wavBuf.m_alignPos;
	float volume = wavBuf.m_volume;

	if (m_alignPos == (unsigned)(-1))
	{
		m_alignPos = note_alignPos;
	}
	if ((unsigned)_ms2sample(m_cursor) + m_alignPos < note_alignPos)
	{
		unsigned truncate = note_alignPos - (unsigned)_ms2sample(m_cursor) + m_alignPos;
		count -= truncate;
		samples += truncate * src_chn;
		note_alignPos -= truncate;
	}
	unsigned upos = (unsigned)_ms2sample(m_cursor) + m_alignPos - note_alignPos;

	float *tmpSamples = new float[count*m_chn];
	for (unsigned i = 0; i < count; i++)
	{
		float sample_l;
		float sample_r;

		if (src_chn == 1)
		{
			sample_l = sample_r = samples[i];
		}
		else if (src_chn == 2)
		{
			sample_l = samples[i * 2];
			sample_r = samples[i * 2 + 1];
		}

		if (m_chn == 1)
		{
			tmpSamples[i] = (sample_l + sample_r)*0.5f * volume;
		}
		else if (m_chn == 2)
		{
			CalcPan(wavBuf.m_pan, sample_l, sample_r);
			tmpSamples[i * 2] = sample_l * volume;
			tmpSamples[i * 2 + 1] = sample_r * volume;
		}

	}

	if (upos < m_length)
	{
		unsigned sec = min(count, m_length - upos);
		float* secbuf = new float[sec * m_chn];
		_seek(upos);
		fread(secbuf, sizeof(float), sec*m_chn, m_fp);

		for (unsigned i = 0; i < sec*m_chn; i++)
			tmpSamples[i] += secbuf[i];

		delete[] secbuf;
	}

	_writeSamples(count, tmpSamples, note_alignPos);

	delete[] tmpSamples;
}

void TrackBuffer::Sample(unsigned index, float* sample)
{
	if (index >= m_length)
	{
		for (unsigned c = 0; c < m_chn; c++)
			sample[c] = 0.0f;
	}
	if (m_localBufferPos == (unsigned)(-1) || m_localBufferPos > index || m_localBufferPos + s_localBufferSize <= index)
	{
		m_localBufferPos = (index / s_localBufferSize)*s_localBufferSize;
		memset(m_localBuffer, 0, sizeof(float)*s_localBufferSize*m_chn);

		if (m_localBufferPos < m_length)
		{
			fseek(m_fp, m_localBufferPos * sizeof(float)*m_chn, SEEK_SET);
			fread(m_localBuffer, sizeof(float), min(s_localBufferSize, m_length - m_localBufferPos)*m_chn, m_fp);
		}
	}

	unsigned readPos = index - m_localBufferPos;
	for (unsigned c = 0; c < m_chn; c++)
		sample[c] = m_localBuffer[readPos * m_chn + c];
}


float TrackBuffer::MaxValue()
{
	unsigned i;
	float buf[2];
	Sample(0, buf);

	float maxValue;
	if (m_chn == 1)
		maxValue = fabsf(buf[0]);
	else if (m_chn == 2)
		maxValue = max(fabsf(buf[0]), fabsf(buf[1]));

	for (i = 1; i < m_length; i++)
	{
		Sample(i, buf);
		float _max;
		if (m_chn == 1)
			_max = fabsf(buf[0]);
		else if (m_chn == 2)
			_max = max(fabsf(buf[0]), fabsf(buf[1]));

		maxValue = max(maxValue, _max);
	}

	return maxValue;
}


void TrackBuffer::GetSamples(unsigned startIndex, unsigned length, float* buffer)
{
	while (length > 0)
	{
		if (startIndex >= m_length) break;
		if (m_localBufferPos == (unsigned)(-1) || m_localBufferPos > startIndex || m_localBufferPos + s_localBufferSize <= startIndex)
		{
			m_localBufferPos = (startIndex / s_localBufferSize)*s_localBufferSize;
			memset(m_localBuffer, 0, sizeof(float)*s_localBufferSize*m_chn);

			if (m_localBufferPos < m_length)
			{
				fseek(m_fp, m_localBufferPos * sizeof(float)*m_chn, SEEK_SET);
				fread(m_localBuffer, sizeof(float), min(s_localBufferSize, m_length - m_localBufferPos)*m_chn, m_fp);
			}
		}

		unsigned readLength = min(length, m_localBufferPos + s_localBufferSize - startIndex);
		memcpy(buffer, m_localBuffer + (startIndex - m_localBufferPos)*m_chn, sizeof(float)* readLength*m_chn);
		startIndex += readLength;
		length -= readLength;
		buffer += readLength;
	}
}


bool TrackBuffer::CombineTracks(unsigned num, TrackBuffer** tracks)
{
	WavBuffer targetBuffer;
	targetBuffer.Allocate(m_chn, s_localBufferSize);

	unsigned *lengths = new unsigned[num];
	int* sourcePos = new int[num];
	float* trackVolumes = new float[num];
	float* trackPans = new float[num];

	// scan
	unsigned i;
	float maxCursor = 0.0f;
	unsigned maxAlign = 0;

	for (i = 0; i < num; i++)
	{
		if (tracks[i]->Rate() != m_rate)
		{
			delete[] trackPans;
			delete[] trackVolumes;
			delete[] sourcePos;
			delete[] lengths;
			return false;
		}
		lengths[i] = tracks[i]->NumberOfSamples();

		float cursor = tracks[i]->GetCursor();
		if (cursor > maxCursor) maxCursor = cursor;

		unsigned align = tracks[i]->AlignPos();
		if (align != (unsigned)(-1) && align > maxAlign) maxAlign = align;

		sourcePos[i] = (int)(align);
		trackVolumes[i] = tracks[i]->AbsoluteVolume();
		trackPans[i] = tracks[i]->Pan();
	}

	for (i = 0; i < num; i++)
	{
		sourcePos[i] -= (int)maxAlign;
	}

	maxCursor += m_cursor;

	bool finish = false;

	while (!finish)
	{
		finish = true;
		memset(targetBuffer.m_data, 0, sizeof(float)*s_localBufferSize*m_chn);
		unsigned maxCount = 0;

		for (i = 0; i < num; i++)
		{
			if ((int)lengths[i] > sourcePos[i])
			{
				int count = min(s_localBufferSize, (int)lengths[i] - sourcePos[i]);
				maxCount = (unsigned)max(count, (int)maxCount);
				int j;
				for (j = 0; j < count; j++)
				{
					if ((int)j + sourcePos[i] > 0)
					{
						float samples[2];
						tracks[i]->Sample((unsigned)((int)j + sourcePos[i]), samples);
						float sample_l;
						float sample_r;
						if (tracks[i]->m_chn == 1)
						{
							sample_l = sample_r = samples[0];
						}
						else if (tracks[i]->m_chn == 2)
						{
							sample_l = samples[0];
							sample_r = samples[1];
						}

						if (m_chn == 1)
						{
							targetBuffer.m_data[j] += (sample_l + sample_r)*0.5f* trackVolumes[i];
						}
						else if (m_chn == 2)
						{
							CalcPan(trackPans[i], sample_l, sample_r);
							targetBuffer.m_data[j * 2] += sample_l * trackVolumes[i];
							targetBuffer.m_data[j * 2 + 1] += sample_r * trackVolumes[i];
						}
					}
				}
				sourcePos[i] += count;
				if ((int)lengths[i] > sourcePos[i]) finish = false;
			}
		}
		targetBuffer.m_sampleNum = maxCount;
		targetBuffer.m_alignPos = maxAlign;
		WriteBlend(targetBuffer);
		MoveCursor((float)(maxCount - maxAlign) / m_rate * 1000.0f);
		maxAlign = 0;
	}
	SetCursor(maxCursor);

	delete[] trackPans;
	delete[] trackVolumes;
	delete[] sourcePos;
	delete[] lengths;

	return true;
}



================================================
FILE: ScoreDraftCore/TrackBuffer.h
================================================
#pragma once 

#include <cstdio>
#include <vector>
#include "WavBuffer.h"


class SCOREDRAFTCORE_API TrackBuffer
{
public:
	TrackBuffer(unsigned rate = 44100, unsigned chn = 1);
	~TrackBuffer();

	unsigned Rate() const { return m_rate; }
	void SetRate(unsigned rate) { m_rate = rate; }

	unsigned NumberOfChannels() const { return m_chn; }

	unsigned NumberOfSamples()
	{
		return m_length;
	}
	unsigned AlignPos()
	{
		return m_alignPos;
	}

	float Volume() const { return m_volume; }
	float AbsoluteVolume()
	{
		float maxValue = MaxValue();
		return maxValue > 0.0f ? m_volume / maxValue : 1.0f;
	}
	void SetVolume(float vol) { m_volume = vol; }

	float Pan() const { return m_pan; }
	void SetPan(float pan) { m_pan = pan; }

	float GetCursor();
	void SetCursor(float fpos);
	void MoveCursor(float delta);

	void SeekToCursor();
	void WriteBlend(const WavBuffer& wavBuf);

	void Sample(unsigned index, float* sample);
	float MaxValue();

	void GetSamples(unsigned startIndex, unsigned length, float* buffer);

	bool CombineTracks(unsigned num, TrackBuffer** tracks);

	unsigned GetLocalBufferSize();

private:
	FILE *m_fp;

	unsigned m_rate;
	unsigned m_chn;

	float m_volume;
	float m_pan;

	float *m_localBuffer;
	unsigned m_localBufferPos;

	unsigned m_length;
	unsigned m_alignPos;

	float m_cursor;

	inline float _ms2sample(float ms)
	{
		return ms * 0.001f*m_rate;
	}

	void _writeSamples(unsigned count, const float* samples, unsigned alignPos);
	void _seek(unsigned upos);
};




================================================
FILE: ScoreDraftCore/WavBuffer.h
================================================
#pragma once

#include "api.h"
#include <vector>

class SCOREDRAFTCORE_API WavBuffer
{
	std::vector<float> _data;
public:
	WavBuffer() : p_data(&_data)
	{
		
	}
	void Allocate(unsigned channelNum, size_t sampleNum)
	{
		m_channelNum = channelNum;	
		m_sampleNum = sampleNum;
		p_data->resize(sampleNum * channelNum);
		m_data = &(*p_data)[0];
	}

	float m_sampleRate = 44100.0f;
	unsigned m_channelNum = 1;
	size_t m_sampleNum = 0;
	std::vector<float>* p_data;
	float* m_data = nullptr;
	unsigned m_alignPos = 0;
	float m_volume = 1.0f;
	float m_pan = 0.0f;

};




================================================
FILE: ScoreDraftCore/WriteWav.cpp
================================================
#include "WriteWav.h"

#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif

struct WavHeader
{
	unsigned short wFormatTag;
	unsigned short wChannels;
	unsigned int dwSamplesPerSec;
	unsigned int dwAvgBytesPerSec;
	unsigned short wBlockAlign;
	unsigned short wBitsPerSample;
};

WriteWav::WriteWav()
{
	m_fp = nullptr;
}

WriteWav::~WriteWav()
{
	if (m_fp) fclose(m_fp);
}

bool WriteWav::OpenFile(const char* filename)
{
	if (m_fp) fclose(m_fp);
	m_fp = fopen(filename, "wb");
	return m_fp != nullptr;
}

void WriteWav::CloseFile()
{
	if (m_fp) fclose(m_fp);
	m_fp = nullptr;
}

void WriteWav::WriteHeader(unsigned sampleRate, unsigned numSamples, unsigned chn)
{
	if (!m_fp) return;
	unsigned dataSize = numSamples * chn * sizeof(short);
	unsigned int adWord;
	WavHeader header;

	fwrite("RIFF", 1, 4, m_fp);
	adWord = dataSize + 20 + sizeof(WavHeader);
	fwrite(&adWord, 4, 1, m_fp);
	fwrite("WAVEfmt ", 1, 8, m_fp);
	adWord = 0x00000010;
	fwrite(&adWord, 4, 1, m_fp);

	header.wFormatTag = 1;
	header.wChannels = chn;
	header.dwSamplesPerSec = sampleRate;
	header.dwAvgBytesPerSec = sampleRate *chn* sizeof(short);
	header.wBlockAlign = chn* sizeof(short);
	header.wBitsPerSample = 16;

	fwrite(&header, sizeof(WavHeader), 1, m_fp);
	fwrite("data", 1, 4, m_fp);
	adWord = dataSize;
	fwrite(&adWord, 4, 1, m_fp);

	m_totalSamples = numSamples;
	m_num_channels = chn;
	m_writenSamples = 0;
}


inline void CalcPan(float pan, float& l, float& r)
{
	if (pan == 0.0f) return;
	else if (pan < 0.0f)
	{
		pan = -pan;
		float ll = l;
		float rl = r*pan;
		float rr = r*(1.0f - pan);
		l = ll + rl;
		r = rr;
	}
	else
	{
		float ll = l*(1.0f - pan);
		float lr = l*pan;
		float rr = r;
		l = ll;
		r = lr + rr;
	}
}

void WriteWav::WriteSamples(const float* samples, unsigned count, float volume, float pan)
{
	if (!m_fp) return;
	count = min(count, m_totalSamples - m_writenSamples);
	if (count > 0)
	{
		short* data = new short[count*m_num_channels];

		unsigned i;
		for (i = 0; i < count; i++)
		{
			float sample[2];
			for (unsigned c = 0; c < m_num_channels; c++)
				sample[c] = samples[i*m_num_channels+c];
			if (m_num_channels == 2)
				CalcPan(pan, sample[0], sample[1]);
			for (unsigned c = 0; c < m_num_channels; c++)
				data[i*m_num_channels + c] = (short)(max(min(sample[c] * volume, 1.0f), -1.0f)*32767.0f);
		}

		fwrite(data, sizeof(short), count*m_num_channels, m_fp);

		delete[] data;

		m_writenSamples += count;
	}
	if (m_totalSamples - m_writenSamples<=0) CloseFile();
}



================================================
FILE: ScoreDraftCore/WriteWav.h
================================================
#ifndef _WriteWav_h
#define _WriteWav_h

#include <stdio.h>
class WriteWav
{
public:
	WriteWav();
	~WriteWav();

	bool OpenFile(const char* filename);
	void CloseFile();

	void WriteHeader(unsigned sampleRate, unsigned numSamples, unsigned chn=1);
	void WriteSamples(const float* samples, unsigned count, float volume=1.0f, float pan=0.0f);

private:
	FILE* m_fp;
	unsigned m_totalSamples;
	unsigned m_num_channels;
	unsigned m_writenSamples;
};

#endif


================================================
FILE: ScoreDraftCore/api.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif

extern "C"
{
	// general
	SCOREDRAFT_API void* PtrArrayCreate(unsigned long long size, const void** ptrs);
	SCOREDRAFT_API void PtrArrayDestroy(void* ptr_arr);

	// F32Buf
	SCOREDRAFT_API void* F32BufCreate(unsigned long long size, float value);
	SCOREDRAFT_API void F32BufDestroy(void* ptr);
	SCOREDRAFT_API float* F32BufData(void* ptr);
	SCOREDRAFT_API int F32BufSize(void* ptr);	
	SCOREDRAFT_API void F32BufToS16(void* ptr, short* dst, float amplitude);
	SCOREDRAFT_API void F32BufFromS16(void* ptr, const short* data, unsigned long long size);
	SCOREDRAFT_API float F32BufMaxValue(void* ptr);
	SCOREDRAFT_API void F32BufMix(void* ptr, void* ptr_lst);

	// WavBuffer
	SCOREDRAFT_API void* WavBufferCreate(float sampleRate, unsigned channelNum, void* ptr_data, unsigned alignPos, float volume, float pan);
	SCOREDRAFT_API void WavBufferDestroy(void *ptr);
	SCOREDRAFT_API float WavBufferGetSampleRate(void* ptr);
	SCOREDRAFT_API unsigned WavBufferGetChannelNum(void *ptr);
	SCOREDRAFT_API unsigned long long WavBufferGetSampleNum(void *ptr);
	SCOREDRAFT_API unsigned WavBufferGetAlignPos(void* ptr);
	SCOREDRAFT_API void WavBufferSetAlignPos(void* ptr, unsigned alignPos);
	SCOREDRAFT_API float WavBufferGetVolume(void* ptr);
	SCOREDRAFT_API void WavBufferSetVolume(void* ptr, float volume);
	SCOREDRAFT_API float WavBufferGetPan(void* ptr);
	SCOREDRAFT_API void WavBufferSetPan(void* ptr, float pan);

	// TrackBuffer
	SCOREDRAFT_API void* TrackBufferCreate(unsigned chn);
	SCOREDRAFT_API void TrackBufferDestroy(void* ptr);
	SCOREDRAFT_API void TrackBufferSetVolume(void* ptr, float volume);
	SCOREDRAFT_API float TrackBufferGetVolume(void* ptr);
	SCOREDRAFT_API void TrackBufferSetPan(void* ptr, float pan);
	SCOREDRAFT_API float TrackBufferGetPan(void* ptr);
	SCOREDRAFT_API unsigned TrackBufferGetNumberOfSamples(void* ptr);
	SCOREDRAFT_API unsigned TrackBufferGetAlignPos(void* ptr);
	SCOREDRAFT_API float TrackBufferGetCursor(void* ptr);
	SCOREDRAFT_API void TrackBufferSetCursor(void* ptr, float cursor);
	SCOREDRAFT_API void TrackBufferMoveCursor(void* ptr, float cursor_delta);
	SCOREDRAFT_API void MixTrackBufferList(void* ptr, void* ptr_list);
	SCOREDRAFT_API void WriteTrackBufferToWav(void* ptr, const char* fn);
	SCOREDRAFT_API void ReadTrackBufferFromWav(void* ptr, const char* fn);
	SCOREDRAFT_API void TrackBufferWriteBlend(void* ptr, void* ptr_wav_buf);

}

#include <memory.h>
#include <math.h>
#include "utils.h"
#include "TrackBuffer.h"

// general
void* PtrArrayCreate(unsigned long long size, const void** ptrs)
{
	PtrArray* ret = new PtrArray(size);
	memcpy(ret->data(), ptrs, sizeof(void*)*size);
	return ret;
}

void PtrArrayDestroy(void* ptr_arr)
{
	PtrArray* arr = (PtrArray*)ptr_arr;
	delete arr;
}

// F32Buf
void* F32BufCreate(unsigned long long size, float value)
{
	return new F32Buf(size, value);
}

void F32BufDestroy(void* ptr)
{
	F32Buf* buf = (F32Buf*)ptr;
	delete buf;
}

float* F32BufData(void* ptr)
{
	F32Buf* buf = (F32Buf*)ptr;
	return buf->data();
}

int F32BufSize(void* ptr)
{
	F32Buf* buf = (F32Buf*)ptr;
	return (int)(buf->size());
}

void F32BufToS16(void* ptr, short* dst, float amplitude)
{
	F32Buf* buf = (F32Buf*)ptr;
	for (size_t i = 0; i < buf->size(); i++)
		dst[i] = (short)((*buf)[i] * 32767.0f*amplitude + 0.5f);
}

void F32BufFromS16(void* ptr, const short* data, unsigned long long size)
{
	F32Buf* buf = (F32Buf*)ptr;
	buf->resize(size);
	for (size_t i = 0; i < size; i++)
	{
		(*buf)[i] = (float)data[i] / 32767.0f;
	}	
}

float F32BufMaxValue(void* ptr)
{
	F32Buf* buf = (F32Buf*)ptr;

	float maxV = 0.0f;
	for (size_t i = 0; i < buf->size(); i++)
	{
		float v = fabsf((*buf)[i]);
		if (v > maxV) maxV = v;
	}

	return maxV;
}

void F32BufMix(void* ptr, void* ptr_lst)
{
	F32Buf* target_buf = (F32Buf*)ptr;
	PtrArray* list = (PtrArray*)ptr_lst;

	unsigned numBufs = (unsigned)list->size();
	size_t maxLen = 0;
	for (unsigned i = 0; i < numBufs; i++)
	{
		F32Buf* buf = (F32Buf*)(*list)[i];
		size_t len = buf->size();

		if (maxLen < len)
			maxLen = (unsigned)len;
	}

	target_buf->resize(maxLen);	
	float* f32Out = target_buf->data();
	memset(f32Out, 0, maxLen * sizeof(float));

	for (unsigned i = 0; i < numBufs; i++)
	{
		F32Buf* buf = (F32Buf*)(*list)[i];
		size_t len = buf->size();
		const float* f32In = buf->data();

		for (unsigned j = 0; j < len; j++)
			f32Out[j] += f32In[j];
	}
}

// WavBuffer
void* WavBufferCreate(float sampleRate, unsigned channelNum, void* ptr_data, unsigned alignPos, float volume, float pan)
{
	WavBuffer* buf = new WavBuffer;
	buf->m_sampleRate = sampleRate;
	buf->m_channelNum = channelNum;
	buf->m_sampleNum = ((F32Buf*)ptr_data)->size() / channelNum;
	buf->p_data = (F32Buf*)ptr_data;
	buf->m_data = &(*buf->p_data)[0];
	buf->m_alignPos = alignPos;
	buf->m_volume = volume;
	buf->m_pan = pan;
	return buf;
}

void WavBufferDestroy(void *ptr)
{
	delete (WavBuffer*)ptr;
}

float WavBufferGetSampleRate(void* ptr)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	return buf->m_sampleRate;
}

unsigned WavBufferGetChannelNum(void *ptr)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	return buf->m_channelNum;
}

unsigned long long WavBufferGetSampleNum(void *ptr)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	return buf->m_sampleNum;
}

unsigned WavBufferGetAlignPos(void* ptr)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	return buf->m_alignPos;
}

void WavBufferSetAlignPos(void* ptr, unsigned alignPos)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	buf->m_alignPos = alignPos;
}

float WavBufferGetVolume(void* ptr)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	return buf->m_volume;
}

void WavBufferSetVolume(void* ptr, float volume)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	buf->m_volume = volume;
}

float WavBufferGetPan(void* ptr)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	return buf->m_pan;
}

void WavBufferSetPan(void* ptr, float pan)
{
	WavBuffer* buf = (WavBuffer*)ptr;
	buf->m_pan = pan;
}

// TrackBuffer
void* TrackBufferCreate(unsigned chn)
{
	return new TrackBuffer(44100, chn);
}

void TrackBufferDestroy(void* ptr)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	delete buffer;
}

void TrackBufferSetVolume(void* ptr, float volume)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	buffer->SetVolume(volume);
}

float TrackBufferGetVolume(void* ptr)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	return buffer->Volume();
}

void TrackBufferSetPan(void* ptr, float pan)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	buffer->SetPan(pan);
}

float TrackBufferGetPan(void* ptr)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	return buffer->Pan();
}

unsigned TrackBufferGetNumberOfSamples(void* ptr)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	return buffer->NumberOfChannels();
}

unsigned TrackBufferGetAlignPos(void* ptr)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	return buffer->AlignPos();
}

float TrackBufferGetCursor(void* ptr)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	return buffer->GetCursor();
}

void TrackBufferSetCursor(void* ptr, float cursor)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	buffer->SetCursor(cursor);
}

void TrackBufferMoveCursor(void* ptr, float cursor_delta)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	buffer->MoveCursor(cursor_delta);
}

void MixTrackBufferList(void* ptr, void* ptr_list)
{
	TrackBuffer* targetBuffer = (TrackBuffer*)ptr;
	PtrArray* list = (PtrArray*)ptr_list;
	targetBuffer->CombineTracks((unsigned)list->size(), (TrackBuffer**)list->data());
}

void WriteTrackBufferToWav(void* ptr, const char* fn)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	WriteToWav(*buffer, fn);
}

void ReadTrackBufferFromWav(void* ptr, const char* fn)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	ReadFromWav(*buffer, fn);
}

void TrackBufferWriteBlend(void* ptr, void* ptr_wav_buf)
{
	TrackBuffer* buffer = (TrackBuffer*)ptr;
	WavBuffer* wavBuf = (WavBuffer*)ptr_wav_buf;
	buffer->WriteBlend(*wavBuf);
}





================================================
FILE: ScoreDraftCore/api.h
================================================
#pragma once

#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#pragma warning( disable: 4251 )
#if defined SCOREDRAFTCORE_DLL_EXPORT
#define SCOREDRAFTCORE_API __declspec(dllexport)
#elif defined SCOREDRAFTCORE_DLL_IMPORT
#define SCOREDRAFTCORE_API __declspec(dllimport)
#endif
#endif

#ifndef SCOREDRAFTCORE_API
#define SCOREDRAFTCORE_API
#endif


================================================
FILE: ScoreDraftCore/utils.h
================================================
#pragma once
#include <cstdint>
#include <chrono>
#include <mutex>
#include <condition_variable>
#include <vector>


inline uint64_t time_micro_sec()
{
	std::chrono::time_point<std::chrono::system_clock> tpSys = std::chrono::system_clock::now();
	std::chrono::time_point<std::chrono::system_clock, std::chrono::microseconds> tpMicro
		= std::chrono::time_point_cast<std::chrono::microseconds>(tpSys);
	return tpMicro.time_since_epoch().count();
}

inline uint64_t time_milli_sec()
{
	return (time_micro_sec() + 500) / 1000;
}

inline double time_sec()
{
	return (double)time_micro_sec() / 1000000.0;
}



#ifndef max
#define max(a,b)            (((a) > (b)) ? (a) : (b))
#endif

#ifndef min
#define min(a,b)            (((a) < (b)) ? (a) : (b))
#endif


typedef std::vector<void*> PtrArray;
typedef std::vector<float> F32Buf;

inline void CalcPan(float pan, float& l, float& r)
{
	if (pan == 0.0f) return;
	else if (pan < 0.0f)
	{
		pan = -pan;
		float ll = l;
		float rl = r * pan;
		float rr = r * (1.0f - pan);
		l = ll + rl;
		r = rr;
	}
	else
	{
		float ll = l * (1.0f - pan);
		float lr = l * pan;
		float rr = r;
		l = ll;
		r = lr + rr;
	}
}

#include "TrackBuffer.h"
#include "ReadWav.h"
#include "WriteWav.h"

inline void WriteToWav(TrackBuffer& track, const char* fileName)
{
	unsigned numSamples = track.NumberOfSamples();
	unsigned chn = track.NumberOfChannels();
	unsigned sampleRate = track.Rate();
	float volume = track.AbsoluteVolume();
	float pan = track.Pan();

	WriteWav writer;
	writer.OpenFile(fileName);
	writer.WriteHeader(sampleRate, numSamples, chn);

	unsigned localBufferSize = track.GetLocalBufferSize();
	float *buffer = new float[localBufferSize*chn];
	unsigned pos = 0;
	while (numSamples > 0)
	{
		unsigned writeCount = min(numSamples, localBufferSize);
		track.GetSamples(pos, writeCount, buffer);
		writer.WriteSamples(buffer, writeCount, volume, pan);
		numSamples -= writeCount;
		pos += writeCount;
	}

	delete[] buffer;
}

inline void ReadFromWav(TrackBuffer& track, const char* fileName)
{
	unsigned numSamples;
	unsigned chn;
	unsigned sampleRate;

	ReadWav reader;
	reader.OpenFile(fileName);
	reader.ReadHeader(sampleRate, numSamples, chn);

	unsigned localBufferSize = track.GetLocalBufferSize();

	WavBuffer buf;
	buf.m_sampleRate = (float)sampleRate;
	buf.Allocate(chn, localBufferSize);

	while (numSamples > 0)
	{
		unsigned readCount = min(numSamples, localBufferSize);
		float maxv;
		reader.ReadSamples(buf.m_data, readCount, maxv);
		buf.m_sampleNum = readCount;
		track.WriteBlend(buf);
		track.MoveCursor((float)readCount / (float)track.Rate()*1000.0f);
		numSamples -= readCount;
	}
}

class Semaphore {
public:
	Semaphore(int count_ = 0)
		: count(count_) {}

	inline void notify()
	{
		std::unique_lock<std::mutex> lock(mtx);
		count++;
		cv.notify_one();
	}

	inline void wait()
	{
		std::unique_lock<std::mutex> lock(mtx);

		while (count == 0) {
			cv.wait(lock);
		}
		count--;
	}

private:
	std::mutex mtx;
	std::condition_variable cv;
	int count;
};


================================================
FILE: SimpleInstruments/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(SimpleInstruments)

set (INCLUDE_DIR
../ScoreDraftCore
)


if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)
endif()

include_directories(${INCLUDE_DIR})
add_definitions(${DEFINES})
add_library (SimpleInstruments SHARED SimpleInstruments.cpp)
target_link_libraries(SimpleInstruments ScoreDraftCore)

if (WIN32) 
target_compile_definitions(SimpleInstruments PUBLIC SCOREDRAFTCORE_DLL_IMPORT)
endif()

if (WIN32) 
install(TARGETS SimpleInstruments RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS SimpleInstruments DESTINATION ScoreDraft)
endif()



================================================
FILE: SimpleInstruments/SimpleInstruments.cpp
================================================
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
#define SCOREDRAFT_API __declspec(dllexport)
#else
#define SCOREDRAFT_API 
#endif

extern "C"
{
	SCOREDRAFT_API void GeneratePureSin(void* ptr_wavbuf, float freq, float fduration);
	SCOREDRAFT_API void GenerateSquare(void* ptr_wavbuf, float freq, float fduration);
	SCOREDRAFT_API void GenerateTriangle(void* ptr_wavbuf, float freq, float fduration);
	SCOREDRAFT_API void GenerateSawtooth(void* ptr_wavbuf, float freq, float fduration);
	SCOREDRAFT_API void GenerateNaivePiano(void* ptr_wavbuf, float freq, float fduration);
	SCOREDRAFT_API void GenerateBottleBlow(void* ptr_wavbuf, float freq, float fduration);
}

#include <WavBuffer.h>
#include <cmath>

#define PI 3.14159265359f

void GeneratePureSin(void* ptr_wavbuf, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(1, len);

	float wave = 1.0f;
	float Dwave = 0.0f;
	float a = powf(2.0f * PI*sampleFreq, 2.0f);

	for (size_t j = 0; j < len; j++)
	{
		float amplitude = sinf(PI*(float)j / (float)len);
		wavbuf->m_data[j] = amplitude * wave;
		float DDwave = -a * wave;
		Dwave += DDwave;
		wave += Dwave;
	}
}

void GenerateSquare(void* ptr_wavbuf, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(1, len);

	for (size_t j = 0; j < len; j++)
	{
		float x = sampleFreq * j;
		x = x - floor(x);
		float wave = x > 0.5f ? -1.0f : 1.0f;
		wavbuf->m_data[j] = wave;
	}
}

void GenerateTriangle(void* ptr_wavbuf, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(1, len);

	for (size_t j = 0; j < len; j++)
	{
		float amplitude = 1.0f - 2.0f*fabsf((float)j / (float)(len - 1) - 0.5f);
		float x = sampleFreq * j;
		x = x - floor(x);
		float wave = x > 0.5f ? (x - 0.75f)*4.0f : (0.25f - x)*4.0f;
		wavbuf->m_data[j] = wave * amplitude;
	}
}

void GenerateSawtooth(void* ptr_wavbuf, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(1, len);

	for (size_t j = 0; j < len; j++)
	{
		float amplitude = 1.0f - ((float)j / (float)(len - 1));
		float phase = sampleFreq * j;
		float wave = 1.0f - 2.0f*(phase - floor(phase));
		wavbuf->m_data[j] = amplitude * wave;
	}
}

void GenerateNaivePiano(void* ptr_wavbuf, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(1, len);
	
	for (size_t j = 0; j < len; j++)
	{
		float x = sampleFreq * j;
		x = x - floor(x);

		float x2 = (float)j / fNumOfSamples;

		float amplitude = 1.0f - powf(x2 - 0.5f, 3.0f)*8.0f;
		float wave = (1.0f + 0.5f*cos(2 * PI*x * 5))*sin(PI*x)* powf(1.0f - 2.0f * x, 3.0f);

		wavbuf->m_data[j] = amplitude * wave;
	}
}

inline float rand01()
{
	float f = (float)rand() / (float)RAND_MAX;
	if (f < 0.0000001f) f = 0.0000001f;
	if (f > 0.9999999f) f = 0.9999999f;
	return f;
}


void GenerateBottleBlow(void* ptr_wavbuf, float freq, float fduration)
{
	WavBuffer* wavbuf = (WavBuffer*)ptr_wavbuf;
	float sampleRate = wavbuf->m_sampleRate;

	float fNumOfSamples = fduration * sampleRate*0.001f;
	size_t len = (size_t)ceilf(fNumOfSamples);
	float sampleFreq = freq / sampleRate;

	wavbuf->Allocate(1, len);	

	float out = 0.0f;
	float Dout = 0.0f;

	//float FreqCut = 1.0f / 5000.0f;
	float k = 0.02f;
	float FreqCut = k * sampleFreq;
	float a = powf(2 * PI, 2.0f)*sqrtf(powf(FreqCut, 4.0f) + powf(sampleFreq, 4.0f));
	//float b = 2 * PI * powf(2.0f*(sqrtf(powf(FreqCut, 4.0f) + powf(sampleFreq, 4.0f)) - powf(sampleFreq, 2.0f)),0.5f);
	float b = 2 * PI * FreqCut*FreqCut / sampleFreq;

	float ampfac = powf(FreqCut, 1.5f);

	for (size_t j = 0; j < len; j++)
	{
		float x2 = (float)j / fNumOfSamples;
		float amplitude = 1.0f - powf(x2 - 0.5f, 3.0f)*8.0f;

		wavbuf->m_data[j] = amplitude * out*ampfac;

		//float e = randGauss();
		float e = rand01() - 0.5f;
		float DDout = e - b * Dout - a * out;
		Dout += DDout;
		out += Dout;
	}
}


================================================
FILE: SoundFont2/CMakeLists.txt
================================================
cmake_minimum_required (VERSION 3.0)

project(SoundFont2)


set(SOURCES
api.cpp
SF2.cpp
Presets.cpp
Synth.cpp
SF2Synth.cpp
)

set(HEADERS 
SF2.h
Presets.h
Synth.h
SF2Synth.h
)


set (INCLUDE_DIR
../ScoreDraftCore
)


if (WIN32) 
set (DEFINES  ${DEFINES}
-D"_CRT_SECURE_NO_DEPRECATE"  
-D"_SCL_SECURE_NO_DEPRECATE" 
)
else()
add_definitions(-std=c++0x)
add_compile_options(-fPIC)
endif()

include_directories(${INCLUDE_DIR})
add_definitions(${DEFINES})
add_library (SoundFont2 SHARED  ${SOURCES} ${HEADERS})
target_link_libraries(SoundFont2 ScoreDraftCore)

if (WIN32) 
target_compile_definitions(SoundFont2 PUBLIC SCOREDRAFTCORE_DLL_IMPORT)
endif()

if (WIN32) 
install(TARGETS SoundFont2 RUNTIME DESTINATION ScoreDraft)
else()
install(TARGETS SoundFont2 DESTINATION ScoreDraft)
endif()



================================================
FILE: SoundFont2/Presets.cpp
================================================
#include "Presets.h"


#if !defined(TSF_POW) || !defined(TSF_POWF) || !defined(TSF_EXPF) || !defined(TSF_LOG) || !defined(TSF_TAN) || !defined(TSF_LOG10) || !defined(TSF_SQRT)
#  include <math.h>
#  if !defined(__cplusplus) && !defined(NAN) && !defined(powf) && !defined(expf) && !defined(sqrtf)
#    define powf (float)pow // deal with old math.h
#    define expf (float)exp // files that come without
#    define sqrtf (float)sqrt // powf, expf and sqrtf
#  endif
#  define TSF_POW     pow
#  define TSF_POWF    powf
#  define TSF_EXPF    expf
#  define TSF_LOG     log
#  define TSF_TAN     tan
#  define TSF_LOG10   log10
#  define TSF_SQRTF   sqrtf
#endif


static void tsf_region_clear(struct tsf_region* i, TSF_BOOL for_relative)
{
	TSF_MEMSET(i, 0, sizeof(struct tsf_region));
	i->hikey = i->hivel = 127;
	i->pitch_keycenter = 60; // C4
	if (for_relative) return;

	i->pitch_keytrack = 100;

	i->pitch_keycenter = -1;

	// SF2 defaults in timecents.
	i->ampenv.delay = i->ampenv.attack = i->ampenv.hold = i->ampenv.decay = i->ampenv.release = -12000.0f;
	i->modenv.delay = i->modenv.attack = i->modenv.hold = i->modenv.decay = i->modenv.release = -12000.0f;

	i->initialFilterFc = 13500;

	i->delayModLFO = -12000.0f;
	i->delayVibLFO = -12000.0f;
}

static float tsf_timecents2Secsf(float timecents) { return TSF_POWF(2.0f, timecents / 1200.0f); }
static float tsf_decibelsToGain(float db) { return (db > -100.f ? TSF_POWF(10.0f, db * 0.05f) : 0); }

static void tsf_region_envtosecs(struct tsf_envelope* p, TSF_BOOL sustainIsGain)
{
	// EG times need to be converted from timecents to seconds.
	// Pin very short EG segments.  Timecents don't get to zero, and our EG is
	// happier with zero values.
	p->delay = (p->delay   < -11950.0f ? 0.0f : tsf_timecents2Secsf(p->delay));
	p->attack = (p->attack  < -11950.0f ? 0.0f : tsf_timecents2Secsf(p->attack));
	p->release = (p->release < -11950.0f ? 0.0f : tsf_timecents2Secsf(p->release));

	// If we have dynamic hold or decay times depending on key number we need
	// to keep the values in timecents so we can calculate it during startNote
	if (!p->keynumToHold)  p->hold = (p->hold  < -11950.0f ? 0.0f : tsf_timecents2Secsf(p->hold));
	if (!p->keynumToDecay) p->decay = (p->decay < -11950.0f ? 0.0f : tsf_timecents2Secsf(p->decay));

	if (p->sustain < 0.0f) p->sustain = 0.0f;
	else if (sustainIsGain) p->sustain = tsf_decibelsToGain(-p->sustain / 10.0f);
	else p->sustain = 1.0f - (p->sustain / 1000.0f);
}

static void tsf_region_operator(struct tsf_region* region, tsf_u16 genOper, union tsf_hydra_genamount* amount)
{
	enum
	{
		StartAddrsOffset, EndAddrsOffset, StartloopAddrsOffset, EndloopAddrsOffset, StartAddrsCoarseOffset, ModLfoToPitch, VibLfoToPitch, ModEnvToPitch,
		InitialFilterFc, InitialFilterQ, ModLfoToFilterFc, ModEnvToFilterFc, EndAddrsCoarseOffset, ModLfoToVolume, Unused1, ChorusEffectsSend,
		ReverbEffectsSend, Pan, Unused2, Unused3, Unused4, DelayModLFO, FreqModLFO, DelayVibLFO, FreqVibLFO, DelayModEnv, AttackModEnv, HoldModEnv,
		DecayModEnv, SustainModEnv, ReleaseModEnv, KeynumToModEnvHold, KeynumToModEnvDecay, DelayVolEnv, AttackVolEnv, HoldVolEnv, DecayVolEnv,
		SustainVolEnv, ReleaseVolEnv, KeynumToVolEnvHold, KeynumToVolEnvDecay, Instrument, Reserved1, KeyRange, VelRange, StartloopAddrsCoarseOffset,
		Keynum, Velocity, InitialAttenuation, Reserved2, EndloopAddrsCoarseOffset, CoarseTune, FineTune, SampleID, SampleModes, Reserved3, ScaleTuning,
		ExclusiveClass, OverridingRootKey, Unused5, EndOper
	};
	switch (genOper)
	{
	case StartAddrsOffset:           region->offset += amount->shortAmount; break;
	case EndAddrsOffset:             region->end += amount->shortAmount; break;
	case StartloopAddrsOffset:       region->loop_start += amount->shortAmount; break;
	case EndloopAddrsOffset:         region->loop_end += amount->shortAmount; break;
	case StartAddrsCoarseOffset:     region->offset += amount->shortAmount * 32768; break;
	case ModLfoToPitch:              region->modLfoToPitch = amount->shortAmount; break;
	case VibLfoToPitch:              region->vibLfoToPitch = amount->shortAmount; break;
	case ModEnvToPitch:              region->modEnvToPitch = amount->shortAmount; break;
	case InitialFilterFc:            region->initialFilterFc = amount->shortAmount; break;
	case InitialFilterQ:             region->initialFilterQ = amount->shortAmount; break;
	case ModLfoToFilterFc:           region->modLfoToFilterFc = amount->shortAmount; break;
	case ModEnvToFilterFc:           region->modEnvToFilterFc = amount->shortAmount; break;
	case EndAddrsCoarseOffset:       region->end += amount->shortAmount * 32768; break;
	case ModLfoToVolume:             region->modLfoToVolume = amount->shortAmount; break;
	case Pan:                        region->pan = amount->shortAmount / 1000.0f; break;
	case DelayModLFO:                region->delayModLFO = amount->shortAmount; break;
	case FreqModLFO:                 region->freqModLFO = amount->shortAmount; break;
	case DelayVibLFO:                region->delayVibLFO = amount->shortAmount; break;
	case FreqVibLFO:                 region->freqVibLFO = amount->shortAmount; break;
	case DelayModEnv:                region->modenv.delay = amount->shortAmount; break;
	case AttackModEnv:               region->modenv.attack = amount->shortAmount; break;
	case HoldModEnv:                 region->modenv.hold = amount->shortAmount; break;
	case DecayModEnv:                region->modenv.decay = amount->shortAmount; break;
	case SustainModEnv:              region->modenv.sustain = amount->shortAmount; break;
	case ReleaseModEnv:              region->modenv.release = amount->shortAmount; break;
	case KeynumToModEnvHold:         region->modenv.keynumToHold = amount->shortAmount; break;
	case KeynumToModEnvDecay:        region->modenv.keynumToDecay = amount->shortAmount; break;
	case DelayVolEnv:                region->ampenv.delay = amount->shortAmount; break;
	case AttackVolEnv:               region->ampenv.attack = amount->shortAmount; break;
	case HoldVolEnv:                 region->ampenv.hold = amount->shortAmount; break;
	case DecayVolEnv:                region->ampenv.decay = amount->shortAmount; break;
	case SustainVolEnv:              region->ampenv.sustain = amount->shortAmount; break;
	case ReleaseVolEnv:              region->ampenv.release = amount->shortAmount; break;
	case KeynumToVolEnvHold:         region->ampenv.keynumToHold = amount->shortAmount; break;
	case KeynumToVolEnvDecay:        region->ampenv.keynumToDecay = amount->shortAmount; break;
	case KeyRange:                   region->lokey = amount->range.lo; region->hikey = amount->range.hi; break;
	case VelRange:                   region->lovel = amount->range.lo; region->hivel = amount->range.hi; break;
	case StartloopAddrsCoarseOffset: region->loop_start += amount->shortAmount * 32768; break;
	case InitialAttenuation:         region->attenuation += amount->shortAmount * 0.1f; break;
	case EndloopAddrsCoarseOffset:   region->loop_end += amount->shortAmount * 32768; break;
	case CoarseTune:                 region->transpose += amount->shortAmount; break;
	case FineTune:                   region->tune += amount->shortAmount; break;
	case SampleModes:                region->loop_mode = ((amount->wordAmount & 3) == 3 ? TSF_LOOPMODE_SUSTAIN : ((amount->wordAmount & 3) == 1 ? TSF_LOOPMODE_CONTINUOUS : TSF_LOOPMODE_NONE)); break;
	case ScaleTuning:                region->pitch_keytrack = amount->shortAmount; break;
	case ExclusiveClass:             region->group = amount->wordAmount; break;
	case OverridingRootKey:          region->pitch_keycenter = amount->shortAmount; break;
		//case gen_endOper: break; // Ignore.
		//default: addUnsupportedOpcode(generator_name);
	}
}


void LoadPresets(SF2& sf2, Presets& presets)
{
	Hydra* hydra = &sf2.hydra;
	unsigned fontSampleCount = (unsigned) sf2.fontSamples->size();
	unsigned presetNum = (unsigned)sf2.hydra.phdrs.size() - 1;
	presets.resize(presetNum);

	enum { GenInstrument = 41, GenKeyRange = 43, GenVelRange = 44, GenSampleID = 53 };

	// Read each preset.
	std::vector<tsf_hydra_phdr>::iterator pphdr, pphdrMax;
	for (pphdr = hydra->phdrs.begin(), pphdrMax = pphdr + presetNum; pphdr != pphdrMax; pphdr++)
	{
		int sortedIndex = 0, region_index = 0;
		std::vector<tsf_hydra_phdr>::iterator otherphdr;
		tsf_preset* preset;
		std::vector<tsf_hydra_pbag>::iterator ppbag, ppbagEnd;
		tsf_region globalRegion;
		for (otherphdr = hydra->phdrs.begin(); otherphdr != pphdrMax; otherphdr++)
		{
			if (otherphdr == pphdr || otherphdr->bank > pphdr->bank) continue;
			else if (otherphdr->bank < pphdr->bank) sortedIndex++;
			else if (otherphdr->preset > pphdr->preset) continue;
			else if (otherphdr->preset < pphdr->preset) sortedIndex++;
			else if (otherphdr < pphdr) sortedIndex++;
		}

		preset = &presets[sortedIndex];
		TSF_MEMCPY(preset->presetName, pphdr->presetName, sizeof(preset->presetName));
		preset->presetName[sizeof(preset->presetName) - 1] = '\0'; //should be zero terminated in source file but make sure
		preset->bank = pphdr->bank;
		preset->preset = pphdr->preset;

		unsigned regionNum = 0;

		//count regions covered by this preset
		for (ppbag = hydra->pbags.begin() + pphdr->presetBagNdx, ppbagEnd = hydra->pbags.begin() + pphdr[1].presetBagNdx; ppbag != ppbagEnd; ppbag++)
		{
			unsigned char plokey = 0, phikey = 127, plovel = 0, phivel = 127;
			std::vector<tsf_hydra_pgen>::iterator ppgen, ppgenEnd; 
			std::vector<tsf_hydra_inst>::iterator pinst; 
			std::vector<tsf_hydra_ibag>::iterator pibag, pibagEnd; 
			std::vector<tsf_hydra_igen>::iterator pigen, pigenEnd;
			for (ppgen = hydra->pgens.begin() + ppbag->genNdx, ppgenEnd = hydra->pgens.begin() + ppbag[1].genNdx; ppgen != ppgenEnd; ppgen++)
			{
				if (ppgen->genOper == GenKeyRange) { plokey = ppgen->genAmount.range.lo; phikey = ppgen->genAmount.range.hi; continue; }
				if (ppgen->genOper == GenVelRange) { plovel = ppgen->genAmount.range.lo; phivel = ppgen->genAmount.range.hi; continue; }
				if (ppgen->genOper != GenInstrument) continue;
				if (ppgen->genAmount.wordAmount >= hydra->insts.size()) continue;
				pinst = hydra->insts.begin() + ppgen->genAmount.wordAmount;
				for (pibag = hydra->ibags.begin() + pinst->instBagNdx, pibagEnd = hydra->ibags.begin() + pinst[1].instBagNdx; pibag != pibagEnd; pibag++)
				{
					unsigned char ilokey = 0, ihikey = 127, ilovel = 0, ihivel = 127;
					for (pigen = hydra->igens.begin() + pibag->instGenNdx, pigenEnd = hydra->igens.begin() + pibag[1].instGenNdx; pigen != pigenEnd; pigen++)
					{
						if (pigen->genOper == GenKeyRange) { ilokey = pigen->genAmount.range.lo; ihikey = pigen->genAmount.range.hi; continue; }
						if (pigen->genOper == GenVelRange) { ilovel = pigen->genAmount.range.lo; ihivel = pigen->genAmount.range.hi; continue; }
						if (pigen->genOper == GenSampleID && ihikey >= plokey && ilokey <= phikey && ihivel >= plovel && ilovel <= phivel) regionNum++;
					}
				}
			}
		}

		preset->regions.resize(regionNum);
		tsf_region_clear(&globalRegion, TSF_TRUE);

		// Zones.
		for (ppbag = hydra->pbags.begin() + pphdr->presetBagNdx, ppbagEnd = hydra->pbags.begin() + pphdr[1].presetBagNdx; ppbag != ppbagEnd; ppbag++)
		{
			std::vector<tsf_hydra_pgen>::iterator ppgen, ppgenEnd;
			std::vector<tsf_hydra_inst>::iterator pinst;
			std::vector<tsf_hydra_ibag>::iterator pibag, pibagEnd;
			std::vector<tsf_hydra_igen>::iterator pigen, pigenEnd;
			struct tsf_region presetRegion = globalRegion;
			int hadGenInstrument = 0;

			// Generators.
			for (ppgen = hydra->pgens.begin() + ppbag->genNdx, ppgenEnd = hydra->pgens.begin() + ppbag[1].genNdx; ppgen != ppgenEnd; ppgen++)
			{
				// Instrument.
				if (ppgen->genOper == GenInstrument)
				{
					struct tsf_region instRegion;
					tsf_u16 whichInst = ppgen->genAmount.wordAmount;
					if (whichInst >= hydra->insts.size()) continue;

					tsf_region_clear(&instRegion, TSF_FALSE);
					pinst = hydra->insts.begin()+whichInst;
					for (pibag = hydra->ibags.begin() + pinst->instBagNdx, pibagEnd = hydra->ibags.begin() + pinst[1].instBagNdx; pibag != pibagEnd; pibag++)
					{
						// Generators.
						struct tsf_region zoneRegion = instRegion;
						int hadSampleID = 0;
						for (pigen = hydra->igens.begin() + pibag->instGenNdx, pigenEnd = hydra->igens.begin() + pibag[1].instGenNdx; pigen != pigenEnd; pigen++)
						{
							if (pigen->genOper == GenSampleID)
							{
								struct tsf_hydra_shdr* pshdr;

								//preset region key and vel ranges are a filter for the zone regions
								if (zoneRegion.hikey < presetRegion.lokey || zoneRegion.lokey > presetRegion.hikey) continue;
								if (zoneRegion.hivel < presetRegion.lovel || zoneRegion.lovel > presetRegion.hivel) continue;
								if (presetRegion.lokey > zoneRegion.lokey) zoneRegion.lokey = presetRegion.lokey;
								if (presetRegion.hikey < zoneRegion.hikey) zoneRegion.hikey = presetRegion.hikey;
								if (presetRegion.lovel > zoneRegion.lovel) zoneRegion.lovel = presetRegion.lovel;
								if (presetRegion.hivel < zoneRegion.hivel) zoneRegion.hivel = presetRegion.hivel;

								//sum regions
								zoneRegion.offset += presetRegion.offset;
								zoneRegion.end += presetRegion.end;
								zoneRegion.loop_start += presetRegion.loop_start;
								zoneRegion.loop_end += presetRegion.loop_end;
								zoneRegion.transpose += presetRegion.transpose;
								zoneRegion.tune += presetRegion.tune;
								zoneRegion.pitch_keytrack += presetRegion.pitch_keytrack;
								zoneRegion.attenuation += presetRegion.attenuation;
								zoneRegion.pan += presetRegion.pan;
								zoneRegion.ampenv.delay += presetRegion.ampenv.delay;
								zoneRegion.ampenv.attack += presetRegion.ampenv.attack;
								zoneRegion.ampenv.hold += presetRegion.ampenv.hold;
								zoneRegion.ampenv.decay += presetRegion.ampenv.decay;
								zoneRegion.ampenv.sustain += presetRegion.ampenv.sustain;
								zoneRegion.ampenv.release += presetRegion.ampenv.release;
								zoneRegion.modenv.delay += presetRegion.modenv.delay;
								zoneRegion.modenv.attack += presetRegion.modenv.attack;
								zoneRegion.modenv.hold += presetRegion.modenv.hold;
								zoneRegion.modenv.decay += presetRegion.modenv.decay;
								zoneRegion.modenv.sustain += presetRegion.modenv.sustain;
								zoneRegion.modenv.release += presetRegion.modenv.release;
								zoneRegion.initialFilterQ += presetRegion.initialFilterQ;
								zoneRegion.initialFilterFc += presetRegion.initialFilterFc;
								zoneRegion.modEnvToPitch += presetRegion.modEnvToPitch;
								zoneRegion.modEnvToFilterFc += presetRegion.modEnvToFilterFc;
								zoneRegion.delayModLFO += presetRegion.delayModLFO;
								zoneRegion.freqModLFO += presetRegion.freqModLFO;
								zoneRegion.modLfoToPitch += presetRegion.modLfoToPitch;
								zoneRegion.modLfoToFilterFc += presetRegion.modLfoToFilterFc;
								zoneRegion.modLfoToVolume += presetRegion.modLfoToVolume;
								zoneRegion.delayVibLFO += presetRegion.delayVibLFO;
								zoneRegion.freqVibLFO += presetRegion.freqVibLFO;
								zoneRegion.vibLfoToPitch += presetRegion.vibLfoToPitch;

								// EG times need to be converted from timecents to seconds.
								tsf_region_envtosecs(&zoneRegion.ampenv, TSF_TRUE);
								tsf_region_envtosecs(&zoneRegion.modenv, TSF_FALSE);

								// LFO times need to be converted from timecents to seconds.
								zoneRegion.delayModLFO = (zoneRegion.delayModLFO < -11950.0f ? 0.0f : tsf_timecents2Secsf(zoneRegion.delayModLFO));
								zoneRegion.delayVibLFO = (zoneRegion.delayVibLFO < -11950.0f ? 0.0f : tsf_timecents2Secsf(zoneRegion.delayVibLFO));

								// Pin values to their ranges.
								if (zoneRegion.pan < -0.5f) zoneRegion.pan = -0.5f;
								else if (zoneRegion.pan > 0.5f) zoneRegion.pan = 0.5f;
								if (zoneRegion.initialFilterQ < 1500 || zoneRegion.initialFilterQ > 13500) zoneRegion.initialFilterQ = 0;

								pshdr = &hydra->shdrs[pigen->genAmount.wordAmount];
								zoneRegion.offset += pshdr->start;
								zoneRegion.end += pshdr->end;
								zoneRegion.loop_start += pshdr->startLoop;
								zoneRegion.loop_end += pshdr->endLoop;
								if (pshdr->endLoop > 0) zoneRegion.loop_end -= 1;
								if (zoneRegion.pitch_keycenter == -1) zoneRegion.pitch_keycenter = pshdr->originalPitch;
								zoneRegion.tune += pshdr->pitchCorrection;
								zoneRegion.sample_rate = pshdr->sampleRate;
								if (zoneRegion.end && zoneRegion.end < fontSampleCount) zoneRegion.end++;
								else zoneRegion.end = fontSampleCount;

								preset->regions[region_index] = zoneRegion;
								region_index++;
								hadSampleID = 1;
							}
							else tsf_region_operator(&zoneRegion, pigen->genOper, &pigen->genAmount);
						}

						// Handle instrument's global zone.
						if (pibag == hydra->ibags.begin() + pinst->instBagNdx && !hadSampleID)
							instRegion = zoneRegion;

						// Modulators (TODO)
						//if (ibag->instModNdx < ibag[1].instModNdx) addUnsupportedOpcode("any modulator");
					}
					hadGenInstrument = 1;
				}
				else tsf_region_operator(&presetRegion, ppgen->genOper, &ppgen->genAmount);
			}

			// Modulators (TODO)
			//if (pbag->modNdx < pbag[1].modNdx) addUnsupportedOpcode("any modulator");

			// Handle preset's global zone.
			if (ppbag == hydra->pbags.begin() + pphdr->presetBagNdx && !hadGenInstrument)
				globalRegion = presetRegion;
		}
	}
}


================================================
FILE: SoundFont2/Presets.h
================================================
#ifndef _Presets_h
#define _Presets_h

#include "SF2.h"

#include <stdio.h>

enum { TSF_LOOPMODE_NONE, TSF_LOOPMODE_CONTINUOUS, TSF_LOOPMODE_SUSTAIN };

struct tsf_envelope 
{ 
	float delay, attack, hold, decay, sustain, release, keynumToHold, keynumToDecay; 

	void print(FILE* fp, const char* prefix) const
	{
		fprintf(fp, "%s - delay: %f\n", prefix, delay);
		fprintf(fp, "%s - attack: %f\n", prefix, attack);
		fprintf(fp, "%s - hold: %f\n", prefix, hold);
		fprintf(fp, "%s - decay: %f\n", prefix, decay);
		fprintf(fp, "%s - sustain: %f\n", prefix, sustain);
		fprintf(fp, "%s - release: %f\n", prefix, release);
		fprintf(fp, "%s - keynumToHold: %f\n", prefix, keynumToHold);
		fprintf(fp, "%s - keynumToDecay: %f\n", prefix, keynumToDecay);
	}
};

struct tsf_region
{
	int loop_mode;
	unsigned int sample_rate;
	unsigned char lokey, hikey, lovel, hivel;
	unsigned int group, offset, end, loop_start, loop_end;
	int transpose, tune, pitch_keycenter, pitch_keytrack;
	float attenuation, pan;
	tsf_envelope ampenv, modenv;
	int initialFilterQ, initialFilterFc;
	int modEnvToPitch, modEnvToFilterFc, modLfoToFilterFc, modLfoToVolume;
	float delayModLFO;
	int freqModLFO, modLfoToPitch;
	float delayVibLFO;
	int freqVibLFO, vibLfoToPitch;

	void print(FILE* fp) const
	{
		fprintf(fp, "loop_mode: %d\n", loop_mode);
		fprintf(fp, "sample_rate: %u\n", sample_rate);
		fprintf(fp, "offset: %u\n", offset);
		fprintf(fp, "end: %u\n", end);
		fprintf(fp, "loop_start: %u\n", loop_start);
		fprintf(fp, "loop_end: %u\n", loop_end);
		fprintf(fp, "transpose: %d\n", transpose);
		fprintf(fp, "tune: %d\n", tune);
		fprintf(fp, "pitch_keycenter: %d\n", pitch_keycenter);
		fprintf(fp, "pitch_keytrack: %d\n", pitch_keytrack);
		fprintf(fp, "attenuation: %f\n", attenuation);
		fprintf(fp, "pan: %f\n", pan);
		ampenv.print(fp, "ampenv");
		modenv.print(fp, "modenv");
		fprintf(fp, "initialFilterQ: %d\n", initialFilterQ);
		fprintf(fp, "initialFilterFc: %d\n", initialFilterFc);
		fprintf(fp, "modEnvToPitch: %d\n", modEnvToPitch);
		fprintf(fp, "modEnvToFilterFc: %d\n", modEnvToFilterFc);
		fprintf(fp, "modLfoToFilterFc: %d\n", modLfoToFilterFc);
		fprintf(fp, "modLfoToVolume: %d\n", modLfoToVolume);
		fprintf(fp, "delayModLFO: %f\n", delayModLFO);
		fprintf(fp, "freqModLFO: %d\n", freqModLFO);
		fprintf(fp, "modLfoToPitch: %d\n", modLfoToPitch);
		fprintf(fp, "delayVibLFO: %f\n", delayVibLFO);
		fprintf(fp, "freqVibLFO: %d\n", freqVibLFO);
		fprintf(fp, "vibLfoToPitch: %d\n", vibLfoToPitch);	
	}
};

struct tsf_preset
{
	tsf_char20 presetName;
	tsf_u16 preset, bank;
	std::vector<tsf_region> regions;
};

typedef std::vector<tsf_preset> Presets;

void LoadPresets(SF2& sf2, Presets& presets);


#endif



================================================
FILE: SoundFont2/SF2.cpp
================================================
#include "SF2.h"

struct tsf_riffchunk { tsf_fourcc id; tsf_u32 size; };
#define TSF_FourCCEquals(value1, value2) (value1[0] == value2[0] && value1[1] == value2[1] && value1[2] == value2[2] && value1[3] == value2[3])

static TSF_BOOL tsf_riffchunk_read(struct tsf_riffchunk* parent, struct tsf_riffchunk* chunk, struct tsf_stream* stream)
{
	TSF_BOOL IsRiff, IsList;
	if (parent && sizeof(tsf_fourcc) + sizeof(tsf_u32) > parent->size) return TSF_FALSE;
	if (!stream->read(stream->data, &chunk->id, sizeof(tsf_fourcc)) || *chunk->id <= ' ' || *chunk->id >= 'z') return TSF_FALSE;
	if (!stream->read(stream->data, &chunk->size, sizeof(tsf_u32))) return TSF_FALSE;
	if (parent && sizeof(tsf_fourcc) + sizeof(tsf_u32) + chunk->size > parent->size) return TSF_FALSE;
	if (parent) parent->size -= sizeof(tsf_fourcc) + sizeof(tsf_u32) + chunk->size;
	IsRiff = TSF_FourCCEquals(chunk->id, "RIFF"), IsList = TSF_FourCCEquals(chunk->id, "LIST");
	if (IsRiff && parent) return TSF_FALSE; //not allowed
	if (!IsRiff && !IsList) return TSF_TRUE; //custom type without sub type
	if (!stream->read(stream->data, &chunk->id, sizeof(tsf_fourcc)) || *chunk->id <= ' ' || *chunk->id >= 'z') return TSF_FALSE;
	chunk->size -= sizeof(tsf_fourcc);
	return TSF_TRUE;
}

#define TSFR(FIELD) stream->read(stream->data, &i->FIELD, sizeof(i->FIELD));
inline void tsf_hydra_read_phdr(struct tsf_hydra_phdr* i, struct tsf_stream* stream) { TSFR(presetName) TSFR(preset) TSFR(bank) TSFR(presetBagNdx) TSFR(library) TSFR(genre) TSFR(morphology) }
inline void tsf_hydra_read_pbag(struct tsf_hydra_pbag* i, struct tsf_stream* stream) { TSFR(genNdx) TSFR(modNdx) }
inline void tsf_hydra_read_pmod(struct tsf_hydra_pmod* i, struct tsf_stream* stream) { TSFR(modSrcOper) TSFR(modDestOper) TSFR(modAmount) TSFR(modAmtSrcOper) TSFR(modTransOper) }
inline void tsf_hydra_read_pgen(struct tsf_hydra_pgen* i, struct tsf_stream* stream) { TSFR(genOper) TSFR(genAmount) }
inline void tsf_hydra_read_inst(struct tsf_hydra_inst* i, struct tsf_stream* stream) { TSFR(instName) TSFR(instBagNdx) }
inline void tsf_hydra_read_ibag(struct tsf_hydra_ibag* i, struct tsf_stream* stream) { TSFR(instGenNdx) TSFR(instModNdx) }
inline void tsf_hydra_read_imod(struct tsf_hydra_imod* i, struct tsf_stream* stream) { TSFR(modSrcOper) TSFR(modDestOper) TSFR(modAmount) TSFR(modAmtSrcOper) TSFR(modTransOper) }
inline void tsf_hydra_read_igen(struct tsf_hydra_igen* i, struct tsf_stream* stream) { TSFR(genOper) TSFR(genAmount) }
inline void tsf_hydra_read_shdr(struct tsf_hydra_shdr* i, struct tsf_stream* stream) { TSFR(sampleName) TSFR(start) TSFR(end) TSFR(startLoop) TSFR(endLoop) TSFR(sampleRate) TSFR(originalPitch) TSFR(pitchCorrection) TSFR(sampleLink) TSFR(sampleType) }
#undef TSFR


static void tsf_load_samples(F32Samples* samples, struct tsf_riffchunk *chunkSmpl, struct tsf_stream* stream)
{
	// Read sample data into float format buffer.
	float* out; unsigned int samplesTotal, samplesLeft, samplesToRead, samplesToConvert;
	samplesTotal = chunkSmpl->size / sizeof(short);
	samplesLeft = samplesTotal;
	samples->resize(samplesTotal);
	out = samples->data();
	for (; samplesLeft; samplesLeft -= samplesToRead)
	{
		short sampleBuffer[1024], *in = sampleBuffer;;
		samplesToRead = (samplesLeft > 1024 ? 1024 : samplesLeft);
		stream->read(stream->data, sampleBuffer, samplesToRead * sizeof(short));

		// Convert from signed 16-bit to float.
		for (samplesToConvert = samplesToRead; samplesToConvert > 0; --samplesToConvert)
			// If we ever need to compile for big-endian platforms, we'll need to byte-swap here.
			*out++ = (float)(*in++ / 32767.0);
	}
}

void LoadSF2(struct tsf_stream* stream, SF2& sf2)
{
	struct tsf_riffchunk chunkHead;
	struct tsf_riffchunk chunkList;
	Hydra& hydra = sf2.hydra;

	if (!tsf_riffchunk_read(TSF_NULL, &chunkHead, stream) || !TSF_FourCCEquals(chunkHead.id, "sfbk"))
	{
		//if (e) *e = TSF_INVALID_NOSF2HEADER;
		return;
	}

	// Read hydra and locate sample data.
	while (tsf_riffchunk_read(&chunkHead, &chunkList, stream))
	{
		struct tsf_riffchunk chunk;
		if (TSF_FourCCEquals(chunkList.id, "pdta"))
		{
			while (tsf_riffchunk_read(&chunkList, &chunk, stream))
			{
#define HandleChunk(chunkName) (TSF_FourCCEquals(chunk.id, #chunkName) && !(chunk.size % chunkName##SizeInFile)) \
											{ \
						int num = chunk.size / chunkName##SizeInFile, i; \
						hydra.chunkName##s.resize(num);\
						for (i = 0; i < num; ++i) tsf_hydra_read_##chunkName(&hydra.chunkName##s[i], stream); \
								}
				enum
				{
					phdrSizeInFile = 38, pbagSizeInFile = 4, pmodSizeInFile = 10,
					pgenSizeInFile = 4, instSizeInFile = 22, ibagSizeInFile = 4,
					imodSizeInFile = 10, igenSizeInFile = 4, shdrSizeInFile = 46
				};
				if      HandleChunk(phdr) else if HandleChunk(pbag) else if HandleChunk(pmod)
				else if HandleChunk(pgen) else if HandleChunk(inst) else if HandleChunk(ibag)
				else if HandleChunk(imod) else if HandleChunk(igen) else if HandleChunk(shdr)
				else stream->skip(stream->data, chunk.size);
#undef HandleChunk

			}
		}
		else if (TSF_FourCCEquals(chunkList.id, "sdta"))
		{
			while (tsf_riffchunk_read(&chunkList, &chunk, stream))
			{
				if (TSF_FourCCEquals(chunk.id, "smpl"))
				{
					sf2.fontSamples = std::shared_ptr<F32Samples>(new F32Samples);
					tsf_load_samples(sf2.fontSamples.get(), &chunk, stream);
				}
				else stream->skip(stream->data, chunk.size);
			}
		}
		else stream->skip(stream->data, chunkList.size);
	}
}


================================================
FILE: SoundFont2/SF2.h
================================================
#ifndef __SF2_h
#define __SF2_h

#include <vector>
#include <memory>

#if !defined(TSF_MALLOC) || !defined(TSF_FREE) || !defined(TSF_REALLOC)
#  include <stdlib.h>
#  define TSF_MALLOC  malloc
#  define TSF_FREE    free
#  define TSF_REALLOC realloc
#endif

#if !defined(TSF_MEMCPY) || !defined(TSF_MEMSET)
#  include <string.h>
#  define TSF_MEMCPY  memcpy
#  define TSF_MEMSET  memset
#endif

#ifndef TSF_NO_STDIO
#  include <stdio.h>
#endif

#define TSF_TRUE 1
#define TSF_FALSE 0
#define TSF_BOOL char
#define TSF_PI 3.14159265358979323846264338327950288
#define TSF_NULL 0

typedef char tsf_fourcc[4];
typedef signed char tsf_s8;
typedef unsigned char tsf_u8;
typedef unsigned short tsf_u16;
typedef signed short tsf_s16;
typedef unsigned int tsf_u32;
typedef char tsf_char20[20];

union tsf_hydra_genamount { struct { tsf_u8 lo, hi; } range; tsf_s16 shortAmount; tsf_u16 wordAmount; };
struct tsf_hydra_phdr { tsf_char20 presetName; tsf_u16 preset, bank, presetBagNdx; tsf_u32 library, genre, morphology; };
struct tsf_hydra_pbag { tsf_u16 genNdx, modNdx; };
struct tsf_hydra_pmod { tsf_u16 modSrcOper, modDestOper; tsf_s16 modAmount; tsf_u16 modAmtSrcOper, modTransOper; };
struct tsf_hydra_pgen { tsf_u16 genOper; union tsf_hydra_genamount genAmount; };
struct tsf_hydra_inst { tsf_char20 instName; tsf_u16 instBagNdx; };
struct tsf_hydra_ibag { tsf_u16 instGenNdx, instModNdx; };
struct tsf_hydra_imod { tsf_u16 modSrcOper, modDestOper; tsf_s16 modAmount; tsf_u16 modAmtSrcOper, modTransOper; };
struct tsf_hydra_igen { tsf_u16 genOper; union tsf_hydra_genamount genAmount; };
struct tsf_hydra_shdr { tsf_char20 sampleName; tsf_u32 start, end, startLoop, endLoop, sampleRate; tsf_u8 originalPitch; tsf_s8 pitchCorrection; tsf_u16 sampleLink, sampleType; };


// Stream structure for the generic loading
struct tsf_stream
{
	// Custom data given to the functions as the first parameter
	void* data;

	// Function pointer will be called to read 'size' bytes into ptr (returns number of read bytes)
	int(*read)(void* data, void* ptr, unsigned int size);

	// Function pointer will be called to skip ahead over 'count' bytes (returns 1 on success, 0 on error)
	int(*skip)(void* data, unsigned int count);
};

struct Hydra
{
	std::vector<tsf_hydra_phdr> phdrs; std::vector<tsf_hydra_pbag> pbags; std::vector<tsf_hydra_pmod> pmods;
	std::vector<tsf_hydra_pgen> pgens; std::vector<tsf_hydra_inst> insts; std::vector<tsf_hydra_ibag> ibags;
	std::vector<tsf_hydra_imod> imods; std::vector<tsf_hydra_igen> igens; std::vector<tsf_hydra_shdr> shdrs;
};

typedef std::vector<float> F32Samples;

struct SF2
{
	Hydra hydra;
	std::shared_ptr<F32Samples> fontSamples;
};

void LoadSF2(struct tsf_stream* stream, SF2& sf2);

#ifndef TSF_NO_STDIO
inline int tsf_stream_stdio_read(FILE* f, void* ptr, unsigned int size) { return (int)fread(ptr, 1, size, f); }
inline int tsf_stream_stdio_skip(FILE* f, unsigned int count) { return !fseek(f, count, SEEK_CUR); }
inline void LoadSF2Filename(const char* filename, SF2& sf2)
{
	struct tsf_stream stream = { TSF_NULL, (int(*)(void*, void*, unsigned int))&tsf_stream_stdio_read, (int(*)(void*, unsigned int))&tsf_stream_stdio_skip };
#if __STDC_WANT_SECURE_LIB__
	FILE* f = TSF_NULL; fopen_s(&f, filename, "rb");
#else
	FILE* f = fopen(filename, "rb");
#endif
	if (!f)
	{
		//if (e) *e = TSF_FILENOTFOUND;
		return;
	}
	stream.data = f;
	LoadSF2(&stream, sf2);
	fclose(f);
}
#endif

struct tsf_stream_memory { const char* buffer; unsigned int total, pos; };
inline int tsf_stream_memory_read(struct tsf_stream_memory* m, void* ptr, unsigned int size) { if (size > m->total - m->pos) size = m->total - m->pos; TSF_MEMCPY(ptr, m->buffer + m->pos, size); m->pos += size; return size; }
inline int tsf_stream_memory_skip(struct tsf_stream_memory* m, unsigned int count) { if (m->pos + count > m->total) return 0; m->pos += count; return 1; }

inline void LoadSF2Memory(const void* buffer, int size, SF2& sf2)
{
	struct tsf_stream stream = { TSF_NULL, (int(*)(void*, void*, unsigned int))&tsf_stream_memory_read, (int(*)(void*, unsigned int))&tsf_stream_memory_skip };
	struct tsf_stream_memory f = { 0, 0, 0 };
	f.buffer = (const char*)buffer;
	f.total = size;
	stream.data = &f;
	return LoadSF2(&stream, sf2);
}


#endif


================================================
FILE: SoundFont2/SF2Synth.cpp
================================================
#include "SF2Synth.h"
#include <memory>

struct LowPass
{
	char active;
	double QInv;
	double a0, a1, b1, b2;
};

struct tsf_voice_envelope { float level, slope; int samplesUntilNextSegment; short segment, midiVelocity; struct tsf_envelope parameters; TSF_BOOL segmentIsExponential, isAmpEnv; };
struct tsf_voice_lfo { int samplesUntil; float level, delta; };

#if !defined(TSF_POW) || !defined(TSF_POWF) || !defined(TSF_EXPF) || !defined(TSF_LOG) || !defined(TSF_TAN) || !defined(TSF_LOG10) || !defined(TSF_SQRT)
#  include <math.h>
#  if !defined(__cplusplus) && !defined(NAN) && !defined(powf) && !defined(expf) && !defined(sqrtf)
#    define powf (float)pow // deal with old math.h
#    define expf (float)exp // files that come without
#    define sqrtf (float)sqrt // powf, expf and sqrtf
#  endif
#  define TSF_POW     pow
#  define TSF_POWF    powf
#  define TSF_EXPF    expf
#  define TSF_LOG     log
#  define TSF_TAN     tan
#  define TSF_LOG10   log10
#  define TSF_SQRTF   sqrtf
#endif

static float tsf_gainToDecibels(float gain) { return (gain <= .00001f ? -100.f : (float)(20.0 * TSF_LOG10(gain))); }
static double tsf_timecents2Secsd(double timecents) { return TSF_POW(2.0, timecents / 1200.0); }
static float tsf_timecents2Secsf(float timecents) { return TSF_POWF(2.0f, timecents / 1200.0f); }
static float tsf_cents2Hertz(float cents) { return 8.176f * TSF_POWF(2.0f, cents / 1200.0f); }
static float tsf_decibelsToGain(float db) { return (db > -100.f ? TSF_POWF(10.0f, db * 0.05f) : 0); }

enum { TSF_SEGMENT_NONE, TSF_SEGMENT_DELAY, TSF_SEGMENT_ATTACK, TSF_SEGMENT_HOLD, TSF_SEGMENT_DECAY, TSF_SEGMENT_SUSTAIN, TSF_SEGMENT_RELEASE, TSF_SEGMENT_DONE };
#define TSF_FASTRELEASETIME 0.01f

static void tsf_voice_envelope_nextsegment(struct tsf_voice_envelope* e, short active_segment, float outSampleRate)
{
	switch (active_segment)
	{
	case TSF_SEGMENT_NONE:
		e->samplesUntilNextSegment = (int)(e->parameters.delay * outSampleRate);
		if (e->samplesUntilNextSegment > 0)
		{
			e->segment = TSF_SEGMENT_DELAY;
			e->segmentIsExponential = TSF_FALSE;
			e->level = 0.0;
			e->slope = 0.0;
			return;
		}
	case TSF_SEGMENT_DELAY:
		e->samplesUntilNextSegment = (int)(e->parameters.attack * outSampleRate);
		if (e->samplesUntilNextSegment > 0)
		{
			if (!e->isAmpEnv)
			{
				//mod env attack duration scales with velocity (velocity of 1 is full duration, max velocity is 0.125 times duration)
				e->samplesUntilNextSegment = (int)(e->parameters.attack * ((145 - e->midiVelocity) / 144.0f) * outSampleRate);
			}
			e->segment = TSF_SEGMENT_ATTACK;
			e->segmentIsExponential = TSF_FALSE;
			e->level = 0.0f;
			e->slope = 1.0f / e->samplesUntilNextSegment;
			return;
		}
	case TSF_SEGMENT_ATTACK:
		e->samplesUntilNextSegment = (int)(e->parameters.hold * outSampleRate);
		if (e->samplesUntilNextSegment > 0)
		{
			e->segment = TSF_SEGMENT_HOLD;
			e->segmentIsExponential = TSF_FALSE;
			e->level = 1.0f;
			e->slope = 0.0f;
			return;
		}
	case TSF_SEGMENT_HOLD:
		e->samplesUntilNextSegment = (int)(e->parameters.decay * outSampleRate);
		if (e->samplesUntilNextSegment > 0)
		{
			e->segment = TSF_SEGMENT_DECAY;
			e->level = 1.0f;
			if (e->isAmpEnv)
			{
				// I don't truly understand this; just following what LinuxSampler does.
				float mysterySlope = -9.226f / e->samplesUntilNextSegment;
				e->slope = TSF_EXPF(mysterySlope);
				e->segmentIsExponential = TSF_TRUE;
				if (e->parameters.sustain > 0.0f)
				{
					// Again, this is following LinuxSampler's example, which is similar to
					// SF2-style decay, where "decay" specifies the time it would take to
					// get to zero, not to the sustain level.  The SFZ spec is not that
					// specific about what "decay" means, so perhaps it's really supposed
					// to specify the time to reach the sustain level.
					e->samplesUntilNextSegment = (int)(TSF_LOG(e->parameters.sustain) / mysterySlope);
				}
			}
			else
			{
				e->slope = -1.0f / e->samplesUntilNextSegment;
				e->samplesUntilNextSegment = (int)(e->parameters.decay * (1.0f - e->parameters.sustain) * outSampleRate);
				e->segmentIsExponential = TSF_FALSE;
			}
			return;
		}
	case TSF_SEGMENT_DECAY:
		e->segment = TSF_SEGMENT_SUSTAIN;
		e->level = e->parameters.sustain;
		e->slope = 0.0f;
		e->samplesUntilNextSegment = 0x7FFFFFFF;
		e->segmentIsExponential = TSF_FALSE;
		return;
	case TSF_SEGMENT_SUSTAIN:
		e->segment = TSF_SEGMENT_RELEASE;
		e->samplesUntilNextSegment = (int)((e->parameters.release <= 0 ? TSF_FASTRELEASETIME : e->parameters.release) * outSampleRate);
		if (e->isAmpEnv)
		{
			// I don't truly understand this; just following what LinuxSampler does.
			float mysterySlope = -9.226f / e->samplesUntilNextSegment;
			e->slope = TSF_EXPF(mysterySlope);
			e->segmentIsExponential = TSF_TRUE;
		}
		else
		{
			e->slope = -e->level / e->samplesUntilNextSegment;
			e->segmentIsExponential = TSF_FALSE;
		}
		return;
	case TSF_SEGMENT_RELEASE:
	default:
		e->segment = TSF_SEGMENT_DONE;
		e->segmentIsExponential = TSF_FALSE;
		e->level = e->slope = 0.0f;
		e->samplesUntilNextSegment = 0x7FFFFFF;
	}
}

static void tsf_voice_envelope_setup(struct tsf_voice_envelope* e, const struct tsf_envelope* new_parameters, float midiNoteNumber, short midiVelocity, TSF_BOOL isAmpEnv, float outSampleRate)
{
	e->parameters = *new_parameters;
	if (e->parameters.keynumToHold!=0.0f)
	{
		e->parameters.hold += e->parameters.keynumToHold * (60.0f - midiNoteNumber);
		e->parameters.hold = (e->parameters.hold < -10000.0f ? 0.0f : tsf_timecents2Secsf(e->parameters.hold));
	}
	if (e->parameters.keynumToDecay != 0.0f)
	{
		e->parameters.decay += e->parameters.keynumToDecay * (60.0f - midiNoteNumber);
		e->parameters.decay = (e->parameters.decay < -10000.0f ? 0.0f : tsf_timecents2Secsf(e->parameters.decay));
	}
	e->midiVelocity = midiVelocity;
	e->isAmpEnv = isAmpEnv;
	tsf_voice_envelope_nextsegment(e, TSF_SEGMENT_NONE, outSampleRate);
}

static void tsf_voice_lowpass_setup(LowPass* e, float Fc)
{
	// Lowpass filter from http://www.earlevel.com/main/2012/11/26/biquad-c-source-code/
	double  K = TSF_TAN(TSF_PI * Fc), KK = K * K;
	double  norm = 1 / (1 + K * e->QInv + KK);
	e->a0 = KK * norm;
	e->a1 = 2 * e->a0;
	e->b1 = 2 * (KK - 1) * norm;
	e->b2 = (1 - K * e->QInv + KK) * norm;
}


static void tsf_voice_lfo_setup(struct tsf_voice_lfo* e, float delay, int freqCents, float outSampleRate)
{
	e->samplesUntil = (int)(delay * outSampleRate);
	e->delta = (4.0f * tsf_cents2Hertz((float)freqCents) / outSampleRate);
	e->level = 0;
}

static void tsf_voice_envelope_process(struct tsf_voice_envelope* e, int numSamples, float outSampleRate)
{
	if (e->slope)
	{
		if (e->segmentIsExponential) e->level *= TSF_POWF(e->slope, (float)numSamples);
		else e->level += (e->slope * numSamples);
	}
	if ((e->samplesUntilNextSegment -= numSamples) <= 0)
		tsf_voice_envelope_nextsegment(e, e->segment, outSampleRate);
}


static void tsf_voice_lfo_process(struct tsf_voice_lfo* e, int blockSamples)
{
	if (e->samplesUntil > blockSamples) { e->samplesUntil -= blockSamples; return; }
	e->level += e->delta * blockSamples;
	if (e->level >  1.0f) { e->delta = -e->delta; e->level = 2.0f - e->level; }
	else if (e->level < -1.0f) { e->delta = -e->delta; e->level = -2.0f - e->level; }
}

// The lower this block size is the more accurate the effects are.
// Increasing the value significantly lowers the CPU usage of the voice rendering.
// If LFO affects the low-pass filter it can be hearable even as low as 8.
#ifndef TSF_RENDER_EFFECTSAMPLEBLOCK
#define TSF_RENDER_EFFECTSAMPLEBLOCK 64
#endif

void SynthRegion(F32Samples& output, F32Samples& input, const tsf_region& region, float key, float vel,
	unsigned& numSamples, OutputMode outputmode, float samplerate, float global_gain_db)
{
	/*FILE *fp = fopen("dump.txt", "a");
	region.print(fp);
	fclose(fp);*/
	int midiVelocity = (int)(vel * 127);

	float noteGainDB =global_gain_db - region.attenuation - tsf_gainToDecibels(1.0f / vel);
	double note = (double)key + (double)region.transpose + (double)region.tune / 100.0;
	double adjustedPitch = (double)region.pitch_keycenter + (note - (double)region.pitch_keycenter)* ((double)region.pitch_keytrack / 100.0);
	double pitchInputTimecents = adjustedPitch * 100.0;
	double pitchOutputFactor = (double)region.sample_rate / (tsf_timecents2Secsd((double)region.pitch_keycenter * 100.0) * (double)samplerate);
	// The SFZ spec is silent about the pan curve, but a 3dB pan law seems common. This sqrt() curve matches what Dimension LE does; Alchemy Free seems closer to sin(adjustedPan * pi/2).
	float panFactorLeft = TSF_SQRTF(0.5f - region.pan);
	float panFactorRight = TSF_SQRTF(0.5f + region.pan);
	// Offset/end.
	NoteState ns;
	ns.sourceSamplePosition = region.offset;
	bool doLoop = (region.loop_mode != TSF_LOOPMODE_NONE && region.loop_start < region.loop_end);
	// Loop.
	unsigned loopStart = (doLoop ? region.loop_start : 0);
	unsigned loopEnd = (doLoop ? region.loop_end : 0);
	// Setup envelopes.
	tsf_voice_envelope ampenv, modenv;
	tsf_voice_envelope_setup(&ampenv, &region.ampenv, key, midiVelocity, TSF_TRUE, samplerate);
	tsf_voice_envelope_setup(&modenv, &region.modenv, key, midiVelocity, TSF_FALSE, samplerate);
	// Setup lowpass filter.
	float filterQDB = region.initialFilterQ / 10.0f;
	LowPass lowpass;
	lowpass.QInv = 1.0f / TSF_POW(10.0f, (filterQDB / 20.0f));
	ns.lowPass.z1 = 0.0;
	ns.lowPass.z2 = 0.0;
	lowpass.active = (region.initialFilterFc <= 13500);
	if (lowpass.active)
		tsf_voice_lowpass_setup(&lowpass, tsf_cents2Hertz((float)region.initialFilterFc) / samplerate);
	// Setup LFO filters.
	tsf_voice_lfo modlfo, viblfo;
	tsf_voice_lfo_setup(&modlfo, region.delayModLFO, region.freqModLFO, samplerate);
	tsf_voice_lfo_setup(&viblfo, region.delayVibLFO, region.freqVibLFO, samplerate);

	TSF_BOOL updateModEnv = (region.modEnvToPitch != 0 || region.modEnvToFilterFc != 0);
	TSF_BOOL updateModLFO = (modlfo.delta != 0.0f && (region.modLfoToPitch != 0 || region.modLfoToFilterFc != 0 || region.modLfoToVolume != 0));
	TSF_BOOL updateVibLFO = (viblfo.delta != 0.0f && (region.vibLfoToPitch != 0));
	TSF_BOOL isLooping = (loopStart < loopEnd);

	double tmpSampleEndDbl = (double)region.end;
	double tmpLoopEndDbl = (double)loopEnd + 1.0f;
	double tmpSourceSamplePosition = ns.sourceSamplePosition;

	TSF_BOOL dynamicLowpass = (region.modLfoToFilterFc != 0 || region.modEnvToFilterFc != 0);
	float tmpSampleRate, tmpInitialFilterFc, tmpModLfoToFilterFc, tmpModEnvToFilterFc;

	TSF_BOOL dynamicPitchRatio = (region.modLfoToPitch != 0 || region.modEnvToPitch != 0 || region.vibLfoToPitch != 0);
	double pitchRatio;
	float tmpModLfoToPitch, tmpVibLfoToPitch, tmpModEnvToPitch;

	TSF_BOOL dynamicGain = (region.modLfoToVolume != 0);
	float noteGain = 0, tmpModLfoToVolume;

	if (dynamicLowpass) tmpSampleRate = samplerate, tmpInitialFilterFc = (float)region.initialFilterFc, tmpModLfoToFilterFc = (float)region.modLfoToFilterFc, tmpModEnvToFilterFc = (float)region.modEnvToFilterFc;
	else tmpSampleRate = 0, tmpInitialFilterFc = 0, tmpModLfoToFilterFc = 0, tmpModEnvToFilterFc = 0;
	if (dynamicPitchRatio) pitchRatio = 0, tmpModLfoToPitch = (float)region.modLfoToPitch, tmpVibLfoToPitch = (float)region.vibLfoToPitch, tmpModEnvToPitch = (float)region.modEnvToPitch;
	else pitchRatio = tsf_timecents2Secsd(pitchInputTimecents) * pitchOutputFactor, tmpModLfoToPitch = 0, tmpVibLfoToPitch = 0, tmpModEnvToPitch = 0;

	if (dynamicGain) tmpModLfoToVolume = (float)region.modLfoToVolume * 0.1f;
	else noteGain = tsf_decibelsToGain(noteGainDB), tmpModLfoToVolume = 0;

	SynthCtrl control;
	control.outputmode = outputmode;
	control.loopStart = loopStart;
	control.loopEnd = loopEnd;
	control.end = region.end;
	control.panFactorLeft = panFactorLeft;
	control.panFactorRight = panFactorRight;
	control.effect_sample_block = TSF_RENDER_EFFECTSAMPLEBLOCK;

	unsigned countSamples = 0;

	while (true)
	{
		float gainMono;
		int blockSamples = TSF_RENDER_EFFECTSAMPLEBLOCK;
		countSamples += blockSamples;

		if (countSamples >= numSamples && ampenv.segment<TSF_SEGMENT_RELEASE)
		{
			tsf_voice_envelope_nextsegment(&ampenv, TSF_SEGMENT_SUSTAIN, samplerate);
			tsf_voice_envelope_nextsegment(&modenv, TSF_SEGMENT_SUSTAIN, samplerate);
			if (region.loop_mode == TSF_LOOPMODE_SUSTAIN)
				// Continue playing, but stop looping.
				isLooping = false;
		}

		if (dynamicLowpass)
		{
			float fres = tmpInitialFilterFc + modlfo.level * tmpModLfoToFilterFc + modenv.level * tmpModEnvToFilterFc;
			lowpass.active = (fres <= 13500.0f);
			if (lowpass.active) tsf_voice_lowpass_setup(&lowpass, tsf_cents2Hertz(fres) / tmpSampleRate);
		}

		if (dynamicPitchRatio)
			pitchRatio = tsf_timecents2Secsd(pitchInputTimecents + (modlfo.level * tmpModLfoToPitch + viblfo.level * tmpVibLfoToPitch + modenv.level * tmpModEnvToPitch)) *  pitchOutputFactor;

		if (dynamicGain)
			noteGain = tsf_decibelsToGain(noteGainDB + (modlfo.level * tmpModLfoToVolume));

		gainMono = noteGain * ampenv.level;

		// Update EG.
		tsf_voice_envelope_process(&ampenv, blockSamples, samplerate);
		if (updateModEnv) tsf_voice_envelope_process(&modenv, blockSamples, samplerate);

		// Update LFOs.
		if (updateModLFO) tsf_voice_lfo_process(&modlfo, blockSamples);
		if (updateVibLFO) tsf_voice_lfo_process(&viblfo, blockSamples);

		SynthCtrlPnt ctrlPnt;
		ctrlPnt.looping = isLooping;
		ctrlPnt.gainMono = gainMono;
		ctrlPnt.pitchRatio = pitchRatio;
		ctrlPnt.lowPass.active = lowpass.active;
		ctrlPnt.lowPass.a0 = lowpass.a0;
		ctrlPnt.lowPass.a1 = lowpass.a1;
		ctrlPnt.lowPass.b1 = lowpass.b1;
		ctrlPnt.lowPass.b2 = lowpass.b2;
		control.controlPnts.push_back(ctrlPnt);

		tmpSourceSamplePosition += pitchRatio*(float)blockSamples;
		while (tmpSourceSamplePosition >= tmpLoopEndDbl && isLooping)
			tmpSourceSamplePosition -= (loopEnd - loopStart + 1.0f);

		if (tmpSourceSamplePosition >= tmpSampleEndDbl || ampenv.segment == TSF_SEGMENT_DONE)
			break;
	}

	numSamples = countSamples;
	unsigned chn = outputmode == MONO ? 1 : 2;

	output.resize(countSamples*chn);

	memset(output.data(), 0, sizeof(float)* countSamples*chn);
	Synth(input.data(), output.data(), countSamples, ns, control);	

}


void SF2Synth(F32Samples& output, F32Samples& input, tsf_preset& preset, float key, float vel,
	unsigned& numSamples, OutputMode outputmode, float samplerate, float global_gain_db)
{
	int midiVelocity = (int)(vel * 127);
	int iKey = (int)(key + 0.5f);
	std::vector<tsf_region>::iterator region, regionEnd;
	std::vector<std::shared_ptr<F32Samples>> results;

	unsigned max_numSamples = 0;
	for (region = preset.regions.begin(), regionEnd = region + preset.regions.size();
		region != regionEnd; region++)
	{
		if (iKey < region->lokey || iKey > region->hikey || midiVelocity < region->lovel || midiVelocity > region->hivel) continue;

		unsigned region_numSamples = numSamples;
		std::shared_ptr<F32Samples> result = std::shared_ptr<F32Samples>(new F32Samples);
		SynthRegion(*result, input, *region, key, vel, region_numSamples, outputmode, samplerate, global_gain_db);
		results.push_back(result);
		if (region_numSamples > max_numSamples)
			max_numSamples = region_numSamples;
	}
	numSamples = max_numSamples;

	if (results.size() < 1)	return;	
	
	unsigned chn = outputmode == MONO ? 1 : 2;
	output.resize(max_numSamples*chn);
	memset(output.data(), 0, sizeof(float)*output.size());
	for (unsigned i = 0; i < results.size(); i++)
	{
		std::shared_ptr<F32Samples> result = results[i];
		for (unsigned j = 0; j < result->size(); j++)
			output[j] += (*result)[j];
	}
}




================================================
FILE: SoundFont2/SF2Synth.h
================================================
#ifndef _SF2Synth_h
#define _SF2Synth_h

#include "SF2.h"
#include "Presets.h"
#include "Synth.h"

#include <memory>

void SF2Synth(F32Samples& output, F32Samples& input, tsf_preset& preset, float key, float vel, unsigned& numSamples,
	OutputMode outputmode = STEREO_INTERLEAVED, float samplerate = 44100.0f, float global_gain_db = 0.0f);


#endif 



================================================
FILE: SoundFont2/Synth.cpp
================================================
#include "Synth.h"
#include <cmath>

void Synth(const float* input, float* outputBuffer, unsigned numSamples, NoteState& noteState, const SynthCtrl& control)
{
	float* outL = outputBuffer;
	float* outR = (control.outputmode == STEREO_UNWEAVED ? outL + numSamples : nullptr);

	unsigned tmpLoopStart = control.loopStart;
	unsigned tmpLoopEnd = control.loopEnd;
	unsigned tmpEnd = control.end;
	double tmpSourceSamplePosition = noteState.sourceSamplePosition;

	double tmpSampleEndDbl = (double)tmpEnd;
	double tmpLoopEndDbl = (double)tmpLoopEnd + 1.0;

	unsigned i_ctrl = 0;
	SynthCtrlPnt ctrlPnt;

	LowPassState lowPassState = noteState.lowPass;

	while (numSamples)
	{
		float gainLeft, gainRight;
		int blockSamples = (numSamples > control.effect_sample_block ? control.effect_sample_block : numSamples);
		numSamples -= blockSamples;

		if (i_ctrl<control.controlPnts.size())
			ctrlPnt = control.controlPnts[i_ctrl];
		else
			break;

		float gainMono = ctrlPnt.gainMono;
		double pitchRatio = ctrlPnt.pitchRatio;
		bool interpolation = pitchRatio <= 1.0f;

		gainLeft = gainMono *control.panFactorLeft;
		gainRight = gainMono  * control.panFactorRight;

		LowPassCtrlPnt lowPassCtrlPnt = ctrlPnt.lowPass;

		while (blockSamples-- && tmpSourceSamplePosition < tmpSampleEndDbl)
		{
			float val = 0.0f;
			if (interpolation)
			{
				int ipos1 = (int)tmpSourceSamplePosition;
				float frac = (float)(tmpSourceSamplePosition - (double)ipos1);
				int ipos2 = ipos1 + 1;
				int ipos3 = ipos1 + 2;
				int ipos0 = ipos1 - 1;

				if (ipos1 > (int)tmpLoopEnd && ctrlPnt.looping)
				{
					ipos2 = tmpLoopStart;
					ipos3 = tmpLoopStart + 1;
				}
				if (ipos2 >= (int)tmpEnd) ipos2 = tmpEnd - 1;
				if (ipos3 >= (int)tmpEnd) ipos3 = tmpEnd - 1;
				if (ipos0 < 0) ipos0 = 0;

				float p0 = input[ipos0];
				float p1 = input[ipos1];
				float p2 = input[ipos2];
				float p3 = input[ipos3];

				val = (-0.5f*p0 + 1.5f*p1 - 1.5f*p2 + 0.5f*p3)*powf(frac, 3.0f) +
					(p0 - 2.5f*p1 + 2.0f*p2 - 0.5f*p3)*powf(frac, 2.0f) +
					(-0.5f*p0 + 0.5f*p2)*frac + p1;
			}
			else
			{
				int ipos1 = (int)ceil(tmpSourceSamplePosition - 0.5* pitchRatio);
				int ipos2 = (int)floor(tmpSourceSamplePosition + 0.5* pitchRatio);
				int count = ipos2 - ipos1 + 1;
				for (int ipos = ipos1; ipos <= ipos2; ipos++)
				{
					int _ipos = ipos;
					if (_ipos < 0) _ipos = 0;
					if (_ipos > (int)tmpLoopEnd && ctrlPnt.looping)
					{
						_ipos += (int)tmpLoopStart - (int)tmpLoopEnd -1;
					}
					if (_ipos >= (int)tmpEnd)
					{
						_ipos = tmpEnd - 1;
					}
					val += input[_ipos];
				}
				val /= (float)count;
			}

			if (lowPassCtrlPnt.active)
			{
				double In = val;
				val = (float)(In * lowPassCtrlPnt.a0 + lowPassState.z1);
				lowPassState.z1 = In * lowPassCtrlPnt.a1 + lowPassState.z2 - lowPassCtrlPnt.b1 * val; 
				lowPassState.z2 = In * lowPassCtrlPnt.a0 - lowPassCtrlPnt.b2 * val; 
			}

			switch (control.outputmode)
			{
			case STEREO_INTERLEAVED:
				*outL++ += val * gainLeft;
				*outL++ += val * gainRight;
				break;
			case STEREO_UNWEAVED:
				*outL++ += val * gainLeft;
				*outR++ += val * gainRight;
				break;
			case MONO:
				*outL++ += val * gainMono;
				break;
			}
			// Next sample.
			tmpSourceSamplePosition += pitchRatio;
			if (tmpSourceSamplePosition >= tmpLoopEndDbl && ctrlPnt.looping) 
				tmpSourceSamplePosition -= (tmpLoopEnd - tmpLoopStart + 1.0f);

		}

		if (tmpSourceSamplePosition >= tmpSampleEndDbl)
			break;

		i_ctrl++;
	}

	noteState.sourceSamplePosition= tmpSourceSamplePosition;
	noteState.lowPass = lowPassState;
}


================================================
FILE: SoundFont2/Synth.h
================================================
#ifndef _Synth_h
#define _Synth_h

#include <vector>

struct LowPassState
{
	double z1, z2;
};

struct NoteState
{
	double sourceSamplePosition;
	LowPassState lowPass;
};

struct LowPassCtrlPnt
{
	char active;
	double a0, a1, b1, b2;
};

struct SynthCtrlPnt
{
	char looping;
	float gainMono;
	double pitchRatio;

	LowPassCtrlPnt lowPass;	
};

enum OutputMode
{
	// Two channels with single left/right samples one after another
	STEREO_INTERLEAVED,
	// Two channels with all samples for the left channel first then right
	STEREO_UNWEAVED,
	// A single channel (stereo instruments are mixed into center)
	MONO,
};

struct SynthCtrl
{
	OutputMode outputmode;
	unsigned loopStart, loopEnd;
	unsigned end;
	float panFactorLeft, panFactorRight;
	unsigned effect_sample_block;
	std::vector<SynthCtrlPnt> controlPnts;
};

void Synth(const float* input, float* o
Download .txt
gitextract_fqqiew6r/

├── BasicSamplers/
│   ├── CMakeLists.txt
│   ├── FrequencyDetection.cpp
│   ├── FrequencyDetection.h
│   ├── InstrumentMultiSampler.cpp
│   ├── InstrumentMultiSampler.h
│   ├── InstrumentSingleSampler.cpp
│   ├── InstrumentSingleSampler.h
│   ├── PercussionSampler.cpp
│   ├── PercussionSampler.h
│   ├── Sample.h
│   └── api.cpp
├── CMakeLists.txt
├── DSPUtil/
│   ├── complex.cpp
│   ├── complex.h
│   ├── fft.cpp
│   └── fft.h
├── KarplusStrong/
│   ├── CMakeLists.txt
│   └── KarplusStrong.cpp
├── LICENSE
├── MIDIWriter/
│   ├── CMakeLists.txt
│   └── MIDIWriter.cpp
├── Meteor/
│   ├── CMakeLists.txt
│   ├── DrawText.cpp
│   ├── DrawText.h
│   ├── Meteor.cpp
│   ├── Meteor.h
│   ├── MeteorPlayer.cpp
│   ├── MeteorPlayer.h
│   ├── SubListLookUp.h
│   ├── api.cpp
│   ├── base64.hpp
│   └── blob.hpp
├── PCMPlayer/
│   ├── CMakeLists.txt
│   ├── PCMPlayer.cpp
│   ├── PCMPlayer.h
│   └── api.cpp
├── README.md
├── README_cn.md
├── ScoreDraftCore/
│   ├── CMakeLists.txt
│   ├── ReadWav.cpp
│   ├── ReadWav.h
│   ├── TrackBuffer.cpp
│   ├── TrackBuffer.h
│   ├── WavBuffer.h
│   ├── WriteWav.cpp
│   ├── WriteWav.h
│   ├── api.cpp
│   ├── api.h
│   └── utils.h
├── SimpleInstruments/
│   ├── CMakeLists.txt
│   └── SimpleInstruments.cpp
├── SoundFont2/
│   ├── CMakeLists.txt
│   ├── Presets.cpp
│   ├── Presets.h
│   ├── SF2.cpp
│   ├── SF2.h
│   ├── SF2Synth.cpp
│   ├── SF2Synth.h
│   ├── Synth.cpp
│   ├── Synth.h
│   └── api.cpp
├── Test/
│   ├── FlyMeToTheMoon.py
│   ├── FlyMeToTheMoon_eq.py
│   ├── Hello.py
│   ├── HelloMeteor.py
│   ├── InstrumentSamples/
│   │   ├── Ah.freq
│   │   ├── Cello.freq
│   │   ├── CleanGuitar.freq
│   │   ├── Lah.freq
│   │   ├── Piano/
│   │   │   ├── Alesis-Fusion-Bright-Acoustic-Piano-C2.freq
│   │   │   ├── Alesis-Fusion-Bright-Acoustic-Piano-C4.freq
│   │   │   └── Alesis-Fusion-Bright-Acoustic-Piano-C6.freq
│   │   ├── String.freq
│   │   └── Violin.freq
│   ├── PrintCatalog.py
│   ├── ZhenDeAiNi.ly
│   ├── ZhenDeAiNi.xml
│   ├── ZhenDeAiNi.yaml
│   ├── florestan-subset.sf2
│   ├── percussion_test.py
│   ├── piano_test.py
│   ├── sunshine.yaml
│   ├── test.yaml
│   ├── test_xml.py
│   └── test_yaml.py
├── VoiceSampler/
│   ├── CMakeLists.txt
│   ├── DVVector.hpp
│   ├── FrequencyDetection.cpp
│   ├── FrequencyDetection.h
│   ├── HNM.cu
│   ├── SentenceDescriptor.h
│   ├── SentenceGeneratorCPU.cpp
│   ├── SentenceGeneratorCPU.h
│   ├── SentenceGeneratorCUDA.cpp
│   ├── SentenceGeneratorCUDA.h
│   ├── SentenceGeneratorGeneral.cpp
│   ├── SentenceGeneratorGeneral.h
│   ├── VoiceUtil.cuh
│   ├── VoiceUtil.h
│   ├── api.cpp
│   ├── fft.cuh
│   └── helper_math.h
├── docs/
│   ├── README.md
│   ├── _config.yml
│   ├── intro_cn.html_files/
│   │   └── github-markdown.css
│   ├── intro_cn.md
│   ├── intro_eng.md
│   └── meteor/
│       ├── MyLove.html_files/
│       │   └── github-markdown.css
│       ├── MyLove.md
│       ├── MyLove.meteor
│       ├── SoreFeetSong.md
│       ├── SoreFeetSong.meteor
│       ├── TaLang.md
│       ├── TaLang.meteor
│       ├── WuYa.md
│       ├── WuYa.meteor
│       ├── meteor.js
│       ├── ouchi.md
│       ├── ouchi.meteor
│       ├── tiktok.md
│       └── tiktok.meteor
├── python/
│   ├── CMakeLists.txt
│   ├── README.md
│   ├── ScoreDraft/
│   │   ├── BasicSamplers.py
│   │   ├── CVVCChineseConverter.py
│   │   ├── Catalog.py
│   │   ├── Document.py
│   │   ├── Initializers.py
│   │   ├── Instrument.py
│   │   ├── JPVCVConverter.py
│   │   ├── KarplusStrong.py
│   │   ├── MIDIWriter.py
│   │   ├── Meteor.py
│   │   ├── MusicXMLDocument.py
│   │   ├── Notes.py
│   │   ├── PCMPlayer.py
│   │   ├── Percussion.py
│   │   ├── RapChinese.py
│   │   ├── ScoreDraftCore.py
│   │   ├── SimpleInstruments.py
│   │   ├── Singer.py
│   │   ├── SoundFont2.py
│   │   ├── TTEnglishConverter.py
│   │   ├── TTLyricSet.data
│   │   ├── TsuroVCVConverter.py
│   │   ├── UTAUUtils.py
│   │   ├── UtauDraft.py
│   │   ├── VCCVEnglishConverter.py
│   │   ├── VCCVLyricSet.data
│   │   ├── VoiceSampler.py
│   │   ├── XiaYYConverter.py
│   │   ├── YAMLDocument.py
│   │   ├── __init__.py
│   │   └── musicxml/
│   │       ├── __init__.py
│   │       ├── musicxml.py
│   │       ├── xlink.py
│   │       └── xml.py
│   └── setup.py
└── thirdparty/
    ├── fonts/
    │   ├── NotoSansSC-Bold.hpp
    │   └── NotoSansSC-Bold.otf
    ├── freetype/
    │   ├── include/
    │   │   └── freetype2/
    │   │       ├── freetype/
    │   │       │   ├── config/
    │   │       │   │   ├── ftconfig.h
    │   │       │   │   ├── ftheader.h
    │   │       │   │   ├── ftmodule.h
    │   │       │   │   ├── ftoption.h
    │   │       │   │   ├── ftstdlib.h
    │   │       │   │   ├── integer-types.h
    │   │       │   │   ├── mac-support.h
    │   │       │   │   └── public-macros.h
    │   │       │   ├── freetype.h
    │   │       │   ├── ftadvanc.h
    │   │       │   ├── ftbbox.h
    │   │       │   ├── ftbdf.h
    │   │       │   ├── ftbitmap.h
    │   │       │   ├── ftbzip2.h
    │   │       │   ├── ftcache.h
    │   │       │   ├── ftchapters.h
    │   │       │   ├── ftcid.h
    │   │       │   ├── ftcolor.h
    │   │       │   ├── ftdriver.h
    │   │       │   ├── fterrdef.h
    │   │       │   ├── fterrors.h
    │   │       │   ├── ftfntfmt.h
    │   │       │   ├── ftgasp.h
    │   │       │   ├── ftglyph.h
    │   │       │   ├── ftgxval.h
    │   │       │   ├── ftgzip.h
    │   │       │   ├── ftimage.h
    │   │       │   ├── ftincrem.h
    │   │       │   ├── ftlcdfil.h
    │   │       │   ├── ftlist.h
    │   │       │   ├── ftlogging.h
    │   │       │   ├── ftlzw.h
    │   │       │   ├── ftmac.h
    │   │       │   ├── ftmm.h
    │   │       │   ├── ftmodapi.h
    │   │       │   ├── ftmoderr.h
    │   │       │   ├── ftotval.h
    │   │       │   ├── ftoutln.h
    │   │       │   ├── ftparams.h
    │   │       │   ├── ftpfr.h
    │   │       │   ├── ftrender.h
    │   │       │   ├── ftsizes.h
    │   │       │   ├── ftsnames.h
    │   │       │   ├── ftstroke.h
    │   │       │   ├── ftsynth.h
    │   │       │   ├── ftsystem.h
    │   │       │   ├── fttrigon.h
    │   │       │   ├── fttypes.h
    │   │       │   ├── ftwinfnt.h
    │   │       │   ├── t1tables.h
    │   │       │   ├── ttnameid.h
    │   │       │   ├── tttables.h
    │   │       │   └── tttags.h
    │   │       └── ft2build.h
    │   └── lib/
    │       └── freetype.lib
    ├── glfw/
    │   ├── CMake/
    │   │   ├── GenerateMappings.cmake
    │   │   ├── MacOSXBundleInfo.plist.in
    │   │   ├── i686-w64-mingw32-clang.cmake
    │   │   ├── i686-w64-mingw32.cmake
    │   │   ├── modules/
    │   │   │   ├── FindEpollShim.cmake
    │   │   │   ├── FindOSMesa.cmake
    │   │   │   ├── FindWaylandProtocols.cmake
    │   │   │   └── FindXKBCommon.cmake
    │   │   ├── x86_64-w64-mingw32-clang.cmake
    │   │   └── x86_64-w64-mingw32.cmake
    │   ├── CMakeLists.txt
    │   ├── LICENSE.md
    │   ├── README.md
    │   ├── cmake_uninstall.cmake.in
    │   ├── deps/
    │   │   ├── getopt.c
    │   │   ├── getopt.h
    │   │   ├── glad/
    │   │   │   ├── gl.h
    │   │   │   ├── khrplatform.h
    │   │   │   ├── vk_platform.h
    │   │   │   └── vulkan.h
    │   │   ├── glad_gl.c
    │   │   ├── glad_vulkan.c
    │   │   ├── linmath.h
    │   │   ├── mingw/
    │   │   │   ├── _mingw_dxhelper.h
    │   │   │   ├── dinput.h
    │   │   │   └── xinput.h
    │   │   ├── nuklear.h
    │   │   ├── nuklear_glfw_gl2.h
    │   │   ├── stb_image_write.h
    │   │   ├── tinycthread.c
    │   │   ├── tinycthread.h
    │   │   └── vs2008/
    │   │       └── stdint.h
    │   ├── docs/
    │   │   ├── CMakeLists.txt
    │   │   ├── CODEOWNERS
    │   │   ├── CONTRIBUTING.md
    │   │   ├── Doxyfile.in
    │   │   ├── DoxygenLayout.xml
    │   │   ├── SUPPORT.md
    │   │   ├── build.dox
    │   │   ├── compat.dox
    │   │   ├── compile.dox
    │   │   ├── context.dox
    │   │   ├── extra.css
    │   │   ├── extra.less
    │   │   ├── footer.html
    │   │   ├── header.html
    │   │   ├── html/
    │   │   │   ├── bug.html
    │   │   │   ├── build_8dox.html
    │   │   │   ├── build_guide.html
    │   │   │   ├── compat_8dox.html
    │   │   │   ├── compat_guide.html
    │   │   │   ├── compile_8dox.html
    │   │   │   ├── compile_guide.html
    │   │   │   ├── context_8dox.html
    │   │   │   ├── context_guide.html
    │   │   │   ├── deprecated.html
    │   │   │   ├── dir_15a5176d7c9cc5c407ed4f611edf0684.html
    │   │   │   ├── dir_a58ef735c5cc5a9a31d321e1abe7c42e.html
    │   │   │   ├── dir_abae1f34c5d965773b98e3c915cdaeb5.html
    │   │   │   ├── dir_bc6505cac00d7a6291dbfd9af70666b7.html
    │   │   │   ├── doxygen.css
    │   │   │   ├── dynsections.js
    │   │   │   ├── extra.css
    │   │   │   ├── files.html
    │   │   │   ├── glfw3_8h.html
    │   │   │   ├── glfw3_8h_source.html
    │   │   │   ├── glfw3native_8h.html
    │   │   │   ├── glfw3native_8h_source.html
    │   │   │   ├── group__buttons.html
    │   │   │   ├── group__context.html
    │   │   │   ├── group__errors.html
    │   │   │   ├── group__gamepad__axes.html
    │   │   │   ├── group__gamepad__buttons.html
    │   │   │   ├── group__hat__state.html
    │   │   │   ├── group__init.html
    │   │   │   ├── group__input.html
    │   │   │   ├── group__joysticks.html
    │   │   │   ├── group__keys.html
    │   │   │   ├── group__mods.html
    │   │   │   ├── group__monitor.html
    │   │   │   ├── group__native.html
    │   │   │   ├── group__shapes.html
    │   │   │   ├── group__vulkan.html
    │   │   │   ├── group__window.html
    │   │   │   ├── index.html
    │   │   │   ├── input_8dox.html
    │   │   │   ├── input_guide.html
    │   │   │   ├── internal_8dox.html
    │   │   │   ├── internals_guide.html
    │   │   │   ├── intro_8dox.html
    │   │   │   ├── intro_guide.html
    │   │   │   ├── jquery.js
    │   │   │   ├── main_8dox.html
    │   │   │   ├── menu.js
    │   │   │   ├── menudata.js
    │   │   │   ├── modules.html
    │   │   │   ├── monitor_8dox.html
    │   │   │   ├── monitor_guide.html
    │   │   │   ├── moving_8dox.html
    │   │   │   ├── moving_guide.html
    │   │   │   ├── news.html
    │   │   │   ├── news_8dox.html
    │   │   │   ├── pages.html
    │   │   │   ├── quick_8dox.html
    │   │   │   ├── quick_guide.html
    │   │   │   ├── search/
    │   │   │   │   ├── all_0.html
    │   │   │   │   ├── all_0.js
    │   │   │   │   ├── all_1.html
    │   │   │   │   ├── all_1.js
    │   │   │   │   ├── all_10.html
    │   │   │   │   ├── all_10.js
    │   │   │   │   ├── all_11.html
    │   │   │   │   ├── all_11.js
    │   │   │   │   ├── all_2.html
    │   │   │   │   ├── all_2.js
    │   │   │   │   ├── all_3.html
    │   │   │   │   ├── all_3.js
    │   │   │   │   ├── all_4.html
    │   │   │   │   ├── all_4.js
    │   │   │   │   ├── all_5.html
    │   │   │   │   ├── all_5.js
    │   │   │   │   ├── all_6.html
    │   │   │   │   ├── all_6.js
    │   │   │   │   ├── all_7.html
    │   │   │   │   ├── all_7.js
    │   │   │   │   ├── all_8.html
    │   │   │   │   ├── all_8.js
    │   │   │   │   ├── all_9.html
    │   │   │   │   ├── all_9.js
    │   │   │   │   ├── all_a.html
    │   │   │   │   ├── all_a.js
    │   │   │   │   ├── all_b.html
    │   │   │   │   ├── all_b.js
    │   │   │   │   ├── all_c.html
    │   │   │   │   ├── all_c.js
    │   │   │   │   ├── all_d.html
    │   │   │   │   ├── all_d.js
    │   │   │   │   ├── all_e.html
    │   │   │   │   ├── all_e.js
    │   │   │   │   ├── all_f.html
    │   │   │   │   ├── all_f.js
    │   │   │   │   ├── classes_0.html
    │   │   │   │   ├── classes_0.js
    │   │   │   │   ├── defines_0.html
    │   │   │   │   ├── defines_0.js
    │   │   │   │   ├── files_0.html
    │   │   │   │   ├── files_0.js
    │   │   │   │   ├── files_1.html
    │   │   │   │   ├── files_1.js
    │   │   │   │   ├── files_2.html
    │   │   │   │   ├── files_2.js
    │   │   │   │   ├── files_3.html
    │   │   │   │   ├── files_3.js
    │   │   │   │   ├── files_4.html
    │   │   │   │   ├── files_4.js
    │   │   │   │   ├── files_5.html
    │   │   │   │   ├── files_5.js
    │   │   │   │   ├── files_6.html
    │   │   │   │   ├── files_6.js
    │   │   │   │   ├── files_7.html
    │   │   │   │   ├── files_7.js
    │   │   │   │   ├── files_8.html
    │   │   │   │   ├── files_8.js
    │   │   │   │   ├── functions_0.html
    │   │   │   │   ├── functions_0.js
    │   │   │   │   ├── groups_0.html
    │   │   │   │   ├── groups_0.js
    │   │   │   │   ├── groups_1.html
    │   │   │   │   ├── groups_1.js
    │   │   │   │   ├── groups_2.html
    │   │   │   │   ├── groups_2.js
    │   │   │   │   ├── groups_3.html
    │   │   │   │   ├── groups_3.js
    │   │   │   │   ├── groups_4.html
    │   │   │   │   ├── groups_4.js
    │   │   │   │   ├── groups_5.html
    │   │   │   │   ├── groups_5.js
    │   │   │   │   ├── groups_6.html
    │   │   │   │   ├── groups_6.js
    │   │   │   │   ├── groups_7.html
    │   │   │   │   ├── groups_7.js
    │   │   │   │   ├── groups_8.html
    │   │   │   │   ├── groups_8.js
    │   │   │   │   ├── groups_9.html
    │   │   │   │   ├── groups_9.js
    │   │   │   │   ├── groups_a.html
    │   │   │   │   ├── groups_a.js
    │   │   │   │   ├── nomatches.html
    │   │   │   │   ├── pages_0.html
    │   │   │   │   ├── pages_0.js
    │   │   │   │   ├── pages_1.html
    │   │   │   │   ├── pages_1.js
    │   │   │   │   ├── pages_2.html
    │   │   │   │   ├── pages_2.js
    │   │   │   │   ├── pages_3.html
    │   │   │   │   ├── pages_3.js
    │   │   │   │   ├── pages_4.html
    │   │   │   │   ├── pages_4.js
    │   │   │   │   ├── pages_5.html
    │   │   │   │   ├── pages_5.js
    │   │   │   │   ├── pages_6.html
    │   │   │   │   ├── pages_6.js
    │   │   │   │   ├── pages_7.html
    │   │   │   │   ├── pages_7.js
    │   │   │   │   ├── pages_8.html
    │   │   │   │   ├── pages_8.js
    │   │   │   │   ├── pages_9.html
    │   │   │   │   ├── pages_9.js
    │   │   │   │   ├── pages_a.html
    │   │   │   │   ├── pages_a.js
    │   │   │   │   ├── search.css
    │   │   │   │   ├── search.js
    │   │   │   │   ├── searchdata.js
    │   │   │   │   ├── typedefs_0.html
    │   │   │   │   ├── typedefs_0.js
    │   │   │   │   ├── variables_0.html
    │   │   │   │   ├── variables_0.js
    │   │   │   │   ├── variables_1.html
    │   │   │   │   ├── variables_1.js
    │   │   │   │   ├── variables_2.html
    │   │   │   │   ├── variables_2.js
    │   │   │   │   ├── variables_3.html
    │   │   │   │   ├── variables_3.js
    │   │   │   │   ├── variables_4.html
    │   │   │   │   ├── variables_4.js
    │   │   │   │   ├── variables_5.html
    │   │   │   │   ├── variables_5.js
    │   │   │   │   ├── variables_6.html
    │   │   │   │   ├── variables_6.js
    │   │   │   │   ├── variables_7.html
    │   │   │   │   └── variables_7.js
    │   │   │   ├── structGLFWgamepadstate.html
    │   │   │   ├── structGLFWgammaramp.html
    │   │   │   ├── structGLFWimage.html
    │   │   │   ├── structGLFWvidmode.html
    │   │   │   ├── tabs.css
    │   │   │   ├── vulkan_8dox.html
    │   │   │   ├── vulkan_guide.html
    │   │   │   ├── window_8dox.html
    │   │   │   └── window_guide.html
    │   │   ├── input.dox
    │   │   ├── internal.dox
    │   │   ├── intro.dox
    │   │   ├── main.dox
    │   │   ├── monitor.dox
    │   │   ├── moving.dox
    │   │   ├── news.dox
    │   │   ├── quick.dox
    │   │   ├── vulkan.dox
    │   │   └── window.dox
    │   ├── examples/
    │   │   ├── CMakeLists.txt
    │   │   ├── boing.c
    │   │   ├── gears.c
    │   │   ├── glfw.icns
    │   │   ├── glfw.rc
    │   │   ├── heightmap.c
    │   │   ├── offscreen.c
    │   │   ├── particles.c
    │   │   ├── sharing.c
    │   │   ├── simple.c
    │   │   ├── splitview.c
    │   │   └── wave.c
    │   ├── include/
    │   │   └── GLFW/
    │   │       ├── glfw3.h
    │   │       └── glfw3native.h
    │   ├── src/
    │   │   ├── CMakeLists.txt
    │   │   ├── cocoa_init.m
    │   │   ├── cocoa_joystick.h
    │   │   ├── cocoa_joystick.m
    │   │   ├── cocoa_monitor.m
    │   │   ├── cocoa_platform.h
    │   │   ├── cocoa_time.c
    │   │   ├── cocoa_window.m
    │   │   ├── context.c
    │   │   ├── egl_context.c
    │   │   ├── egl_context.h
    │   │   ├── glfw3.pc.in
    │   │   ├── glfw3Config.cmake.in
    │   │   ├── glfw_config.h.in
    │   │   ├── glx_context.c
    │   │   ├── glx_context.h
    │   │   ├── init.c
    │   │   ├── input.c
    │   │   ├── internal.h
    │   │   ├── linux_joystick.c
    │   │   ├── linux_joystick.h
    │   │   ├── mappings.h
    │   │   ├── mappings.h.in
    │   │   ├── monitor.c
    │   │   ├── nsgl_context.h
    │   │   ├── nsgl_context.m
    │   │   ├── null_init.c
    │   │   ├── null_joystick.c
    │   │   ├── null_joystick.h
    │   │   ├── null_monitor.c
    │   │   ├── null_platform.h
    │   │   ├── null_window.c
    │   │   ├── osmesa_context.c
    │   │   ├── osmesa_context.h
    │   │   ├── posix_thread.c
    │   │   ├── posix_thread.h
    │   │   ├── posix_time.c
    │   │   ├── posix_time.h
    │   │   ├── vulkan.c
    │   │   ├── wgl_context.c
    │   │   ├── wgl_context.h
    │   │   ├── win32_init.c
    │   │   ├── win32_joystick.c
    │   │   ├── win32_joystick.h
    │   │   ├── win32_monitor.c
    │   │   ├── win32_platform.h
    │   │   ├── win32_thread.c
    │   │   ├── win32_time.c
    │   │   ├── win32_window.c
    │   │   ├── window.c
    │   │   ├── wl_init.c
    │   │   ├── wl_monitor.c
    │   │   ├── wl_platform.h
    │   │   ├── wl_window.c
    │   │   ├── x11_init.c
    │   │   ├── x11_monitor.c
    │   │   ├── x11_platform.h
    │   │   ├── x11_window.c
    │   │   ├── xkb_unicode.c
    │   │   └── xkb_unicode.h
    │   └── tests/
    │       ├── CMakeLists.txt
    │       ├── clipboard.c
    │       ├── cursor.c
    │       ├── empty.c
    │       ├── events.c
    │       ├── gamma.c
    │       ├── glfwinfo.c
    │       ├── icon.c
    │       ├── iconify.c
    │       ├── inputlag.c
    │       ├── joysticks.c
    │       ├── monitors.c
    │       ├── msaa.c
    │       ├── opacity.c
    │       ├── reopen.c
    │       ├── tearing.c
    │       ├── threads.c
    │       ├── timeout.c
    │       ├── title.c
    │       ├── triangle-vulkan.c
    │       └── windows.c
    └── portaudio/
        ├── .editorconfig
        ├── .gitattributes
        ├── .github/
        │   ├── ISSUE_TEMPLATE/
        │   │   └── bug_report.md
        │   └── workflows/
        │       ├── MSBuild.yml
        │       └── c-cpp.yml
        ├── .gitignore
        ├── CMakeLists.txt
        ├── Doxyfile
        ├── Doxyfile.developer
        ├── LICENSE.txt
        ├── Makefile.in
        ├── README.configure.txt
        ├── README.md
        ├── SConstruct
        ├── aclocal.m4
        ├── bindings/
        │   ├── cpp/
        │   │   ├── AUTHORS
        │   │   ├── COPYING
        │   │   ├── ChangeLog
        │   │   ├── INSTALL
        │   │   ├── Makefile.am
        │   │   ├── Makefile.in
        │   │   ├── NEWS
        │   │   ├── README
        │   │   ├── SConscript
        │   │   ├── aclocal.m4
        │   │   ├── bin/
        │   │   │   ├── Makefile.am
        │   │   │   └── Makefile.in
        │   │   ├── build/
        │   │   │   ├── gnu/
        │   │   │   │   ├── Makefile.in
        │   │   │   │   ├── OUT_OF_DATE
        │   │   │   │   ├── aclocal.m4
        │   │   │   │   ├── config.guess
        │   │   │   │   ├── config.sub
        │   │   │   │   ├── configure
        │   │   │   │   ├── configure.ac
        │   │   │   │   └── install-sh
        │   │   │   ├── vc6/
        │   │   │   │   ├── devs_example.dsp
        │   │   │   │   ├── devs_example.dsw
        │   │   │   │   ├── sine_example.dsp
        │   │   │   │   ├── sine_example.dsw
        │   │   │   │   ├── static_library.dsp
        │   │   │   │   └── static_library.dsw
        │   │   │   ├── vc7/
        │   │   │   │   └── OUT_OF_DATE
        │   │   │   └── vc7_1/
        │   │   │       ├── devs_example.sln
        │   │   │       ├── devs_example.vcproj
        │   │   │       ├── sine_example.sln
        │   │   │       ├── sine_example.vcproj
        │   │   │       ├── static_library.sln
        │   │   │       └── static_library.vcproj
        │   │   ├── configure
        │   │   ├── configure.ac
        │   │   ├── doc/
        │   │   │   ├── Makefile.am
        │   │   │   ├── Makefile.in
        │   │   │   ├── README
        │   │   │   ├── config.doxy
        │   │   │   └── config.doxy.linux
        │   │   ├── example/
        │   │   │   ├── devs.cxx
        │   │   │   └── sine.cxx
        │   │   ├── include/
        │   │   │   ├── Makefile.am
        │   │   │   ├── Makefile.in
        │   │   │   └── portaudiocpp/
        │   │   │       ├── AsioDeviceAdapter.hxx
        │   │   │       ├── AutoSystem.hxx
        │   │   │       ├── BlockingStream.hxx
        │   │   │       ├── CFunCallbackStream.hxx
        │   │   │       ├── CallbackInterface.hxx
        │   │   │       ├── CallbackStream.hxx
        │   │   │       ├── CppFunCallbackStream.hxx
        │   │   │       ├── Device.hxx
        │   │   │       ├── DirectionSpecificStreamParameters.hxx
        │   │   │       ├── Exception.hxx
        │   │   │       ├── HostApi.hxx
        │   │   │       ├── InterfaceCallbackStream.hxx
        │   │   │       ├── MemFunCallbackStream.hxx
        │   │   │       ├── PortAudioCpp.hxx
        │   │   │       ├── SampleDataFormat.hxx
        │   │   │       ├── Stream.hxx
        │   │   │       ├── StreamParameters.hxx
        │   │   │       ├── System.hxx
        │   │   │       ├── SystemDeviceIterator.hxx
        │   │   │       └── SystemHostApiIterator.hxx
        │   │   ├── lib/
        │   │   │   ├── Makefile.am
        │   │   │   └── Makefile.in
        │   │   ├── portaudiocpp.pc.in
        │   │   └── source/
        │   │       └── portaudiocpp/
        │   │           ├── AsioDeviceAdapter.cxx
        │   │           ├── BlockingStream.cxx
        │   │           ├── CFunCallbackStream.cxx
        │   │           ├── CallbackInterface.cxx
        │   │           ├── CallbackStream.cxx
        │   │           ├── CppFunCallbackStream.cxx
        │   │           ├── Device.cxx
        │   │           ├── DirectionSpecificStreamParameters.cxx
        │   │           ├── Exception.cxx
        │   │           ├── HostApi.cxx
        │   │           ├── InterfaceCallbackStream.cxx
        │   │           ├── MemFunCallbackStream.cxx
        │   │           ├── Stream.cxx
        │   │           ├── StreamParameters.cxx
        │   │           ├── System.cxx
        │   │           ├── SystemDeviceIterator.cxx
        │   │           └── SystemHostApiIterator.cxx
        │   └── java/
        │       ├── c/
        │       │   ├── build/
        │       │   │   └── vs2010/
        │       │   │       └── PortAudioJNI/
        │       │   │           ├── PortAudioJNI.sln
        │       │   │           ├── PortAudioJNI.vcproj
        │       │   │           └── PortAudioJNI.vcxproj
        │       │   └── src/
        │       │       ├── com_portaudio_BlockingStream.c
        │       │       ├── com_portaudio_BlockingStream.h
        │       │       ├── com_portaudio_PortAudio.c
        │       │       ├── com_portaudio_PortAudio.h
        │       │       ├── jpa_tools.c
        │       │       └── jpa_tools.h
        │       ├── jportaudio/
        │       │   ├── .classpath
        │       │   ├── .project
        │       │   ├── jtests/
        │       │   │   └── com/
        │       │   │       └── portaudio/
        │       │   │           ├── PlaySine.java
        │       │   │           └── TestBasic.java
        │       │   └── src/
        │       │       └── com/
        │       │           └── portaudio/
        │       │               ├── BlockingStream.java
        │       │               ├── DeviceInfo.java
        │       │               ├── HostApiInfo.java
        │       │               ├── PortAudio.java
        │       │               ├── StreamInfo.java
        │       │               └── StreamParameters.java
        │       ├── jportaudio.dox
        │       └── scripts/
        │           └── make_header.bat
        ├── build/
        │   ├── msvc/
        │   │   ├── portaudio.def
        │   │   ├── portaudio.dsp
        │   │   ├── portaudio.dsw
        │   │   ├── portaudio.sln
        │   │   ├── portaudio.vcproj
        │   │   └── readme.txt
        │   └── scons/
        │       ├── SConscript_common
        │       └── SConscript_opts
        ├── clear_gitrevision.sh
        ├── cmake_support/
        │   ├── FindASIOSDK.cmake
        │   ├── FindJack.cmake
        │   ├── cmake_uninstall.cmake.in
        │   ├── options_cmake.h.in
        │   ├── portaudio-2.0.pc.in
        │   ├── portaudioConfig.cmake.in
        │   └── template_portaudio.def
        ├── config.guess
        ├── config.sub
        ├── configure
        ├── configure.in
        ├── depcomp
        ├── doc/
        │   ├── src/
        │   │   ├── api_overview.dox
        │   │   ├── license.dox
        │   │   ├── mainpage.dox
        │   │   ├── srcguide.dox
        │   │   └── tutorial/
        │   │       ├── blocking_read_write.dox
        │   │       ├── compile_cmake.dox
        │   │       ├── compile_linux.dox
        │   │       ├── compile_mac_coreaudio.dox
        │   │       ├── compile_windows.dox
        │   │       ├── compile_windows_asio_msvc.dox
        │   │       ├── compile_windows_mingw.dox
        │   │       ├── exploring.dox
        │   │       ├── initializing_portaudio.dox
        │   │       ├── open_default_stream.dox
        │   │       ├── querying_devices.dox
        │   │       ├── start_stop_abort.dox
        │   │       ├── terminating_portaudio.dox
        │   │       ├── tutorial_start.dox
        │   │       ├── utility_functions.dox
        │   │       └── writing_a_callback.dox
        │   └── utils/
        │       └── checkfiledocs.py
        ├── examples/
        │   ├── CMakeLists.txt
        │   ├── pa_devs.c
        │   ├── pa_fuzz.c
        │   ├── paex_mono_asio_channel_select.c
        │   ├── paex_ocean_shore.c
        │   ├── paex_pink.c
        │   ├── paex_read_write_wire.c
        │   ├── paex_record.c
        │   ├── paex_record_file.c
        │   ├── paex_saw.c
        │   ├── paex_sine.c
        │   ├── paex_sine_c++.cpp
        │   ├── paex_wmme_ac3.c
        │   ├── paex_wmme_surround.c
        │   ├── paex_write_sine.c
        │   └── paex_write_sine_nonint.c
        ├── i686-w64-mingw32.cmake
        ├── include/
        │   ├── pa_asio.h
        │   ├── pa_jack.h
        │   ├── pa_linux_alsa.h
        │   ├── pa_mac_core.h
        │   ├── pa_win_ds.h
        │   ├── pa_win_wasapi.h
        │   ├── pa_win_waveformat.h
        │   ├── pa_win_wdmks.h
        │   ├── pa_win_wmme.h
        │   └── portaudio.h
        ├── install-sh
        ├── ltmain.sh
        ├── missing
        ├── pablio/
        │   ├── README.txt
        │   ├── pablio.c
        │   ├── pablio.def
        │   ├── pablio.h
        │   ├── test_rw.c
        │   ├── test_rw_echo.c
        │   ├── test_w_saw.c
        │   └── test_w_saw8.c
        ├── portaudio-2.0.pc.in
        ├── qa/
        │   ├── loopback/
        │   │   ├── README.txt
        │   │   └── src/
        │   │       ├── audio_analyzer.c
        │   │       ├── audio_analyzer.h
        │   │       ├── biquad_filter.c
        │   │       ├── biquad_filter.h
        │   │       ├── paqa.c
        │   │       ├── paqa_tools.c
        │   │       ├── paqa_tools.h
        │   │       ├── qa_tools.h
        │   │       ├── test_audio_analyzer.c
        │   │       ├── test_audio_analyzer.h
        │   │       ├── write_wav.c
        │   │       └── write_wav.h
        │   ├── paqa_devs.c
        │   ├── paqa_errs.c
        │   └── paqa_latency.c
        ├── src/
        │   ├── SConscript
        │   ├── common/
        │   │   ├── pa_allocation.c
        │   │   ├── pa_allocation.h
        │   │   ├── pa_converters.c
        │   │   ├── pa_converters.h
        │   │   ├── pa_cpuload.c
        │   │   ├── pa_cpuload.h
        │   │   ├── pa_debugprint.c
        │   │   ├── pa_debugprint.h
        │   │   ├── pa_dither.c
        │   │   ├── pa_dither.h
        │   │   ├── pa_endianness.h
        │   │   ├── pa_front.c
        │   │   ├── pa_gitrevision.h
        │   │   ├── pa_hostapi.h
        │   │   ├── pa_memorybarrier.h
        │   │   ├── pa_process.c
        │   │   ├── pa_process.h
        │   │   ├── pa_ringbuffer.c
        │   │   ├── pa_ringbuffer.h
        │   │   ├── pa_stream.c
        │   │   ├── pa_stream.h
        │   │   ├── pa_trace.c
        │   │   ├── pa_trace.h
        │   │   ├── pa_types.h
        │   │   └── pa_util.h
        │   ├── hostapi/
        │   │   ├── alsa/
        │   │   │   └── pa_linux_alsa.c
        │   │   ├── asihpi/
        │   │   │   └── pa_linux_asihpi.c
        │   │   ├── asio/
        │   │   │   ├── ASIO-README.txt
        │   │   │   ├── iasiothiscallresolver.cpp
        │   │   │   ├── iasiothiscallresolver.h
        │   │   │   └── pa_asio.cpp
        │   │   ├── coreaudio/
        │   │   │   ├── notes.txt
        │   │   │   ├── pa_mac_core.c
        │   │   │   ├── pa_mac_core_blocking.c
        │   │   │   ├── pa_mac_core_blocking.h
        │   │   │   ├── pa_mac_core_internal.h
        │   │   │   ├── pa_mac_core_utilities.c
        │   │   │   └── pa_mac_core_utilities.h
        │   │   ├── dsound/
        │   │   │   ├── pa_win_ds.c
        │   │   │   ├── pa_win_ds_dynlink.c
        │   │   │   └── pa_win_ds_dynlink.h
        │   │   ├── jack/
        │   │   │   └── pa_jack.c
        │   │   ├── oss/
        │   │   │   ├── low_latency_tip.txt
        │   │   │   ├── pa_unix_oss.c
        │   │   │   └── recplay.c
        │   │   ├── skeleton/
        │   │   │   ├── README.txt
        │   │   │   └── pa_hostapi_skeleton.c
        │   │   ├── wasapi/
        │   │   │   ├── mingw-include/
        │   │   │   │   ├── AudioSessionTypes.h
        │   │   │   │   ├── PropIdl.h
        │   │   │   │   ├── ShTypes.h
        │   │   │   │   ├── audioclient.h
        │   │   │   │   ├── devicetopology.h
        │   │   │   │   ├── endpointvolume.h
        │   │   │   │   ├── functiondiscoverykeys.h
        │   │   │   │   ├── functiondiscoverykeys_devpkey.h
        │   │   │   │   ├── ks.h
        │   │   │   │   ├── ksguid.h
        │   │   │   │   ├── ksmedia.h
        │   │   │   │   ├── ksproxy.h
        │   │   │   │   ├── ksuuids.h
        │   │   │   │   ├── mmdeviceapi.h
        │   │   │   │   ├── propkey.h
        │   │   │   │   ├── propkeydef.h
        │   │   │   │   ├── propsys.h
        │   │   │   │   ├── rpcsal.h
        │   │   │   │   ├── sal.h
        │   │   │   │   ├── sdkddkver.h
        │   │   │   │   ├── structuredquery.h
        │   │   │   │   └── winapifamily.h
        │   │   │   ├── pa_win_wasapi.c
        │   │   │   └── readme.txt
        │   │   ├── wdmks/
        │   │   │   ├── pa_win_wdmks.c
        │   │   │   └── readme.txt
        │   │   └── wmme/
        │   │       └── pa_win_wmme.c
        │   └── os/
        │       ├── unix/
        │       │   ├── pa_unix_hostapis.c
        │       │   ├── pa_unix_util.c
        │       │   └── pa_unix_util.h
        │       └── win/
        │           ├── pa_win_coinitialize.c
        │           ├── pa_win_coinitialize.h
        │           ├── pa_win_hostapis.c
        │           ├── pa_win_util.c
        │           ├── pa_win_waveformat.c
        │           ├── pa_win_wdmks_utils.c
        │           ├── pa_win_wdmks_utils.h
        │           ├── pa_x86_plain_converters.c
        │           └── pa_x86_plain_converters.h
        ├── test/
        │   ├── CMakeLists.txt
        │   ├── README.txt
        │   ├── pa_minlat.c
        │   ├── patest1.c
        │   ├── patest_buffer.c
        │   ├── patest_callbackstop.c
        │   ├── patest_clip.c
        │   ├── patest_converters.c
        │   ├── patest_dither.c
        │   ├── patest_dsound_find_best_latency_params.c
        │   ├── patest_dsound_low_level_latency_params.c
        │   ├── patest_dsound_surround.c
        │   ├── patest_hang.c
        │   ├── patest_in_overflow.c
        │   ├── patest_jack_wasapi.c
        │   ├── patest_latency.c
        │   ├── patest_leftright.c
        │   ├── patest_longsine.c
        │   ├── patest_many.c
        │   ├── patest_maxsines.c
        │   ├── patest_mono.c
        │   ├── patest_multi_sine.c
        │   ├── patest_out_underflow.c
        │   ├── patest_prime.c
        │   ├── patest_read_record.c
        │   ├── patest_ringmix.c
        │   ├── patest_sine8.c
        │   ├── patest_sine_channelmaps.c
        │   ├── patest_sine_formats.c
        │   ├── patest_sine_srate.c
        │   ├── patest_sine_time.c
        │   ├── patest_start_stop.c
        │   ├── patest_stop.c
        │   ├── patest_stop_playout.c
        │   ├── patest_suggested_vs_streaminfo_latency.c
        │   ├── patest_suggested_vs_streaminfo_latency.py
        │   ├── patest_sync.c
        │   ├── patest_timing.c
        │   ├── patest_toomanysines.c
        │   ├── patest_two_rates.c
        │   ├── patest_underflow.c
        │   ├── patest_unplug.c
        │   ├── patest_wire.c
        │   ├── patest_wmme_find_best_latency_params.c
        │   ├── patest_wmme_low_level_latency_params.c
        │   ├── patest_write_stop.c
        │   └── patest_write_stop_hang_illegal.c
        └── update_gitrevision.sh
Download .txt
Showing preview only (649K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (8641 symbols across 401 files)

FILE: BasicSamplers/FrequencyDetection.cpp
  class Window (line 12) | class Window
    method Allocate (line 19) | void Allocate(float halfWidth)
    method SetZero (line 30) | void SetZero()
    method CreateFromBuffer (line 35) | void CreateFromBuffer(const Buffer& src, float center, float halfWidth)
    method MergeToBuffer (line 58) | void MergeToBuffer(Buffer& buf, float pos)
    method GetHalfWidthOfData (line 71) | virtual unsigned GetHalfWidthOfData() const
    method GetSample (line 79) | virtual float GetSample(int i) const
    method SetSample (line 99) | virtual void SetSample(int i, float v)
  function fetchFrequency (line 121) | float fetchFrequency(const Buffer& buf, unsigned sampleRate)

FILE: BasicSamplers/FrequencyDetection.h
  function class (line 8) | class Buffer

FILE: BasicSamplers/InstrumentMultiSampler.cpp
  function s_generateNoteWave (line 14) | static void s_generateNoteWave(const InstrumentSample& sample, float* ou...
  function InstrumentMultiSample (line 85) | void InstrumentMultiSample(const std::vector<InstrumentSample>& samples,...

FILE: BasicSamplers/InstrumentMultiSampler.h
  type InstrumentSample (line 6) | struct InstrumentSample

FILE: BasicSamplers/InstrumentSingleSampler.cpp
  function InstrumentSingleSample (line 14) | void InstrumentSingleSample(const InstrumentSample& sample, float* outBu...

FILE: BasicSamplers/InstrumentSingleSampler.h
  type InstrumentSample (line 4) | struct InstrumentSample

FILE: BasicSamplers/PercussionSampler.cpp
  function PercussionSample (line 14) | void PercussionSample(const Sample& sample, float* outBuf, unsigned outB...

FILE: BasicSamplers/PercussionSampler.h
  type Sample (line 4) | struct Sample

FILE: BasicSamplers/Sample.h
  type Sample (line 3) | struct Sample
  function Sample (line 15) | struct InstrumentSample : public Sample

FILE: BasicSamplers/api.cpp
  function CreateSample (line 25) | void CreateSample(Sample* sample, unsigned origin_sample_rate, unsigned ...
  function s_DetectBaseFreq (line 53) | static float s_DetectBaseFreq(const Sample& sample)
  function SampleDestroy (line 96) | void SampleDestroy(void *ptr)
  function PercussionGenerate (line 101) | void PercussionGenerate(void* ptr_wavbuf, void* ptr_sample, float fdurat...
  function InstrumentSingleGenerate (line 116) | void InstrumentSingleGenerate(void* ptr_wavbuf, void* ptr_sample, float ...
  function compareSampleWav (line 132) | static int compareSampleWav(const void* a, const void* b)
  function InstrumentMultiGenerate (line 143) | void InstrumentMultiGenerate(void* ptr_wavbuf, void* ptr_sample_lst, flo...

FILE: DSPUtil/complex.cpp
  function DCEnergy (line 5) | double DCEnergy(const DComp* c)
  function DCAbs (line 10) | double DCAbs(const DComp* c)
  function DCAng (line 14) | double DCAng(const DComp* c)
  function DCSetAA (line 18) | void DCSetAA(DComp* c,double Abs,double Ang)
  function DCConjugate (line 23) | void DCConjugate(DComp* c,const DComp* c1)
  function DCAdd (line 29) | void DCAdd(DComp* c,const DComp* c1,const DComp* c2)
  function DCSub (line 34) | void DCSub(DComp* c,const DComp* c1,const DComp* c2)
  function DCMul (line 39) | void DCMul(DComp* c,const DComp* c1,const DComp* c2)
  function DCCW90 (line 46) | void DCCW90(DComp* c,const DComp* c1)
  function DCCCW90 (line 53) | void DCCCW90(DComp* c,const DComp* c1)
  function DCPowN (line 60) | void DCPowN(DComp* c,const DComp* c1,int n)
  function DCPrint (line 64) | void DCPrint(const DComp *c,FILE* f)

FILE: DSPUtil/complex.h
  type DComp (line 3) | typedef struct

FILE: DSPUtil/fft.cpp
  function fft (line 3) | void fft(DComp *a,unsigned l)
  function ifft (line 49) | void ifft(DComp *a,unsigned l)

FILE: KarplusStrong/KarplusStrong.cpp
  function rand01 (line 19) | inline float rand01()
  function GeneratePinkNoise (line 27) | inline void GeneratePinkNoise(float period, std::vector<float>& buf)
  function KarplusStrongGenerate (line 76) | void KarplusStrongGenerate(void* ptr_wavbuf, float freq, float fduration...

FILE: MIDIWriter/MIDIWriter.cpp
  function ByteSwap (line 18) | inline void ByteSwap(unsigned short& word)
  function ByteSwap (line 26) | inline void ByteSwap(unsigned& word)
  function ToVariableLength (line 39) | inline void ToVariableLength(unsigned fixed, unsigned& variable, unsigne...
  function WriteBigEdianWord (line 58) | inline void WriteBigEdianWord(FILE *fp, unsigned short aword)
  function WriteBigEdianDWord (line 64) | inline void WriteBigEdianDWord(FILE *fp, unsigned int adword)
  function WriteVariableLengthDWord (line 70) | inline void WriteVariableLengthDWord(FILE *fp, unsigned fixeddword)
  type Note (line 79) | struct Note
  function NoteDestroy (line 90) | void NoteDestroy(void* ptr)
  type NoteEvent (line 95) | struct NoteEvent
  function AddNoteEvent (line 104) | inline void AddNoteEvent(NoteEventList& list, const NoteEvent& nevent)

FILE: Meteor/DrawText.cpp
  function exists_test (line 15) | inline bool exists_test(const char* name)
  class LibHolder (line 29) | class LibHolder
    method LibHolder (line 32) | static LibHolder& singlton()
    method FT_Library (line 42) | FT_Library get_library() const
    method add_face (line 47) | void add_face(const std::string& name, const std::string& path_ttf)
    method set_current_face (line 52) | void set_current_face(const std::string& name)
    method FT_Face (line 57) | FT_Face get_face(const std::string& name = "") const
    method LibHolder (line 77) | LibHolder()
  function FTAddFont (line 96) | void FTAddFont(const std::string& name, const std::string& path_ttf)
  function FTSetCurrentFont (line 101) | void FTSetCurrentFont(const std::string& name)
  function UTF8_to_wchar (line 106) | std::wstring UTF8_to_wchar(const char * in)
  type Character (line 141) | struct Character

FILE: Meteor/DrawText.h
  function class (line 5) | class Text

FILE: Meteor/Meteor.h
  function class (line 7) | class Event
  function class (line 24) | class EventInst : public Event
  type VisNote (line 77) | struct VisNote
  type VisBeat (line 85) | struct VisBeat
  type std (line 92) | typedef std::vector<std::pair<int, float>> TempoMap;
  type VisSinging (line 94) | struct VisSinging
  function class (line 107) | class Meteor

FILE: Meteor/MeteorPlayer.cpp
  class AudioBufferQueue (line 27) | class AudioBufferQueue
    method AudioBufferQueue (line 30) | AudioBufferQueue(int cache_size) : m_semaphore_in(cache_size)
    method Size (line 38) | size_t Size()
    method AudioBuffer (line 43) | AudioBuffer* Front()
    method Push (line 48) | void Push(AudioBuffer* packet)
    method AudioBuffer (line 57) | AudioBuffer* Pop()
  function rand01 (line 185) | inline float rand01()

FILE: Meteor/MeteorPlayer.h
  type std (line 8) | typedef std::unordered_map<unsigned, unsigned
  type Pos2D (line 10) | struct Pos2D
  function namespace (line 16) | namespace std
  type AudioBuffer (line 22) | struct AudioBuffer
  type PaStreamCallbackTimeInfo (line 30) | struct PaStreamCallbackTimeInfo
  type GLFWwindow (line 32) | struct GLFWwindow
  type VisSinging (line 35) | struct VisSinging
  function class (line 36) | class MeteorPlayer

FILE: Meteor/SubListLookUp.h
  type std (line 10) | typedef std::vector<unsigned> SubList;
  function class (line 12) | class SubLists

FILE: Meteor/api.cpp
  function CtrlPntDestroy (line 36) | void CtrlPntDestroy(void* ptr)
  function SyllableDestroy (line 54) | void SyllableDestroy(void* ptr)
  function EventDestroy (line 59) | void EventDestroy(void* ptr)
  function EventSetOffset (line 64) | void EventSetOffset(void* ptr, float offset)
  function MeteorDestroy (line 101) | void MeteorDestroy(void* ptr)
  function MeteorSaveToFile (line 106) | void MeteorSaveToFile(void* ptr, const char* filename)
  function MeteorLoadFromFile (line 112) | void MeteorLoadFromFile(void* ptr, const char* filename)
  function MeteorPlay (line 118) | void MeteorPlay(void* ptr_meteor, void* ptr_track)
  function Base64Destroy (line 134) | void Base64Destroy(void* ptr)

FILE: Meteor/base64.hpp
  function base64_encode (line 8) | inline void base64_encode(const std::vector<uint8_t>& input, std::string...

FILE: Meteor/blob.hpp
  function blob_write (line 8) | inline void blob_write(std::vector<uint8_t>& blob, const void* data, siz...

FILE: PCMPlayer/PCMPlayer.cpp
  class TrackBufferCopy (line 25) | class TrackBufferCopy
    method TrackBufferCopy (line 28) | TrackBufferCopy(TrackBuffer& input)
  class TrackBufferQueue (line 65) | class TrackBufferQueue
    method TrackBufferQueue (line 68) | TrackBufferQueue()
    method Size (line 78) | size_t Size()
    method Front2 (line 83) | void Front2(TrackBufferCopy*& track0, TrackBufferCopy*& track1)
    method Push (line 101) | void Push(TrackBufferCopy* buf)
    method TrackBufferCopy (line 108) | TrackBufferCopy* Pop()
  class AudioBufferQueue (line 122) | class AudioBufferQueue
    method AudioBufferQueue (line 125) | AudioBufferQueue(int cache_size) : m_semaphore_in(cache_size)
    method Size (line 133) | size_t Size()
    method AudioBuffer (line 138) | AudioBuffer* Front()
    method Push (line 143) | void Push(AudioBuffer* packet)
    method AudioBuffer (line 152) | AudioBuffer* Pop()

FILE: PCMPlayer/PCMPlayer.h
  function namespace (line 7) | namespace std
  type AudioBuffer (line 13) | struct AudioBuffer
  type PaStreamCallbackTimeInfo (line 22) | struct PaStreamCallbackTimeInfo
  type GLFWwindow (line 24) | struct GLFWwindow
  function class (line 27) | class PCMPlayer

FILE: PCMPlayer/api.cpp
  function PCMPlayerDestroy (line 24) | void PCMPlayerDestroy(void* ptr)
  function PlayTrack (line 30) | void PlayTrack(void* ptr, void* ptr_track)
  function GetRemainingTime (line 37) | float GetRemainingTime(void* ptr)
  function MainLoop (line 43) | void MainLoop(void* ptr)

FILE: ScoreDraftCore/ReadWav.cpp
  type WavHeader (line 12) | struct WavHeader

FILE: ScoreDraftCore/ReadWav.h
  function class (line 5) | class ReadWav

FILE: ScoreDraftCore/TrackBuffer.h
  function class (line 8) | class SCOREDRAFTCORE_API TrackBuffer

FILE: ScoreDraftCore/WavBuffer.h
  function class (line 6) | class SCOREDRAFTCORE_API WavBuffer

FILE: ScoreDraftCore/WriteWav.cpp
  type WavHeader (line 11) | struct WavHeader
  function CalcPan (line 76) | inline void CalcPan(float pan, float& l, float& r)

FILE: ScoreDraftCore/WriteWav.h
  function class (line 5) | class WriteWav

FILE: ScoreDraftCore/api.cpp
  function PtrArrayDestroy (line 68) | void PtrArrayDestroy(void* ptr_arr)
  function F32BufDestroy (line 80) | void F32BufDestroy(void* ptr)
  function F32BufSize (line 92) | int F32BufSize(void* ptr)
  function F32BufToS16 (line 98) | void F32BufToS16(void* ptr, short* dst, float amplitude)
  function F32BufFromS16 (line 105) | void F32BufFromS16(void* ptr, const short* data, unsigned long long size)
  function F32BufMaxValue (line 115) | float F32BufMaxValue(void* ptr)
  function F32BufMix (line 129) | void F32BufMix(void* ptr, void* ptr_lst)
  function WavBufferDestroy (line 175) | void WavBufferDestroy(void *ptr)
  function WavBufferGetSampleRate (line 180) | float WavBufferGetSampleRate(void* ptr)
  function WavBufferGetChannelNum (line 186) | unsigned WavBufferGetChannelNum(void *ptr)
  function WavBufferGetSampleNum (line 192) | unsigned long long WavBufferGetSampleNum(void *ptr)
  function WavBufferGetAlignPos (line 198) | unsigned WavBufferGetAlignPos(void* ptr)
  function WavBufferSetAlignPos (line 204) | void WavBufferSetAlignPos(void* ptr, unsigned alignPos)
  function WavBufferGetVolume (line 210) | float WavBufferGetVolume(void* ptr)
  function WavBufferSetVolume (line 216) | void WavBufferSetVolume(void* ptr, float volume)
  function WavBufferGetPan (line 222) | float WavBufferGetPan(void* ptr)
  function WavBufferSetPan (line 228) | void WavBufferSetPan(void* ptr, float pan)
  function TrackBufferDestroy (line 240) | void TrackBufferDestroy(void* ptr)
  function TrackBufferSetVolume (line 246) | void TrackBufferSetVolume(void* ptr, float volume)
  function TrackBufferGetVolume (line 252) | float TrackBufferGetVolume(void* ptr)
  function TrackBufferSetPan (line 258) | void TrackBufferSetPan(void* ptr, float pan)
  function TrackBufferGetPan (line 264) | float TrackBufferGetPan(void* ptr)
  function TrackBufferGetNumberOfSamples (line 270) | unsigned TrackBufferGetNumberOfSamples(void* ptr)
  function TrackBufferGetAlignPos (line 276) | unsigned TrackBufferGetAlignPos(void* ptr)
  function TrackBufferGetCursor (line 282) | float TrackBufferGetCursor(void* ptr)
  function TrackBufferSetCursor (line 288) | void TrackBufferSetCursor(void* ptr, float cursor)
  function TrackBufferMoveCursor (line 294) | void TrackBufferMoveCursor(void* ptr, float cursor_delta)
  function MixTrackBufferList (line 300) | void MixTrackBufferList(void* ptr, void* ptr_list)
  function WriteTrackBufferToWav (line 307) | void WriteTrackBufferToWav(void* ptr, const char* fn)
  function ReadTrackBufferFromWav (line 313) | void ReadTrackBufferFromWav(void* ptr, const char* fn)
  function TrackBufferWriteBlend (line 319) | void TrackBufferWriteBlend(void* ptr, void* ptr_wav_buf)

FILE: ScoreDraftCore/utils.h
  function time_micro_sec (line 9) | inline uint64_t time_micro_sec()
  function time_milli_sec (line 17) | inline uint64_t time_milli_sec()
  function time_sec (line 22) | inline double time_sec()
  type std (line 38) | typedef std::vector<void*> PtrArray;
  type std (line 39) | typedef std::vector<float> F32Buf;
  function CalcPan (line 41) | inline void CalcPan(float pan, float& l, float& r)
  function WriteToWav (line 67) | inline void WriteToWav(TrackBuffer& track, const char* fileName)
  function ReadFromWav (line 94) | inline void ReadFromWav(TrackBuffer& track, const char* fileName)
  function class (line 122) | class Semaphore {

FILE: SimpleInstruments/SimpleInstruments.cpp
  function GeneratePureSin (line 22) | void GeneratePureSin(void* ptr_wavbuf, float freq, float fduration)
  function GenerateSquare (line 47) | void GenerateSquare(void* ptr_wavbuf, float freq, float fduration)
  function GenerateTriangle (line 67) | void GenerateTriangle(void* ptr_wavbuf, float freq, float fduration)
  function GenerateSawtooth (line 88) | void GenerateSawtooth(void* ptr_wavbuf, float freq, float fduration)
  function GenerateNaivePiano (line 108) | void GenerateNaivePiano(void* ptr_wavbuf, float freq, float fduration)
  function rand01 (line 133) | inline float rand01()
  function GenerateBottleBlow (line 142) | void GenerateBottleBlow(void* ptr_wavbuf, float freq, float fduration)

FILE: SoundFont2/Presets.cpp
  function tsf_region_clear (line 21) | static void tsf_region_clear(struct tsf_region* i, TSF_BOOL for_relative)
  function tsf_timecents2Secsf (line 42) | static float tsf_timecents2Secsf(float timecents) { return TSF_POWF(2.0f...
  function tsf_decibelsToGain (line 43) | static float tsf_decibelsToGain(float db) { return (db > -100.f ? TSF_PO...
  function tsf_region_envtosecs (line 45) | static void tsf_region_envtosecs(struct tsf_envelope* p, TSF_BOOL sustai...
  function tsf_region_operator (line 64) | static void tsf_region_operator(struct tsf_region* region, tsf_u16 genOp...
  function LoadPresets (line 130) | void LoadPresets(SF2& sf2, Presets& presets)

FILE: SoundFont2/Presets.h
  type tsf_preset (line 74) | struct tsf_preset
  type std (line 81) | typedef std::vector<tsf_preset> Presets;

FILE: SoundFont2/SF2.cpp
  type tsf_riffchunk (line 3) | struct tsf_riffchunk { tsf_fourcc id; tsf_u32 size; }
  function TSF_BOOL (line 6) | static TSF_BOOL tsf_riffchunk_read(struct tsf_riffchunk* parent, struct ...
  function tsf_hydra_read_phdr (line 23) | inline void tsf_hydra_read_phdr(struct tsf_hydra_phdr* i, struct tsf_str...
  type tsf_hydra_pbag (line 24) | struct tsf_hydra_pbag
  type tsf_stream (line 24) | struct tsf_stream
  function tsf_hydra_read_pmod (line 25) | inline void tsf_hydra_read_pmod(struct tsf_hydra_pmod* i, struct tsf_str...
  type tsf_hydra_pgen (line 26) | struct tsf_hydra_pgen
  type tsf_stream (line 26) | struct tsf_stream
  type tsf_hydra_inst (line 27) | struct tsf_hydra_inst
  type tsf_stream (line 27) | struct tsf_stream
  type tsf_hydra_ibag (line 28) | struct tsf_hydra_ibag
  type tsf_stream (line 28) | struct tsf_stream
  function tsf_hydra_read_imod (line 29) | inline void tsf_hydra_read_imod(struct tsf_hydra_imod* i, struct tsf_str...
  type tsf_hydra_igen (line 30) | struct tsf_hydra_igen
  type tsf_stream (line 30) | struct tsf_stream
  function tsf_hydra_read_shdr (line 31) | inline void tsf_hydra_read_shdr(struct tsf_hydra_shdr* i, struct tsf_str...
  function tsf_load_samples (line 35) | static void tsf_load_samples(F32Samples* samples, struct tsf_riffchunk *...
  function LoadSF2 (line 56) | void LoadSF2(struct tsf_stream* stream, SF2& sf2)

FILE: SoundFont2/SF2.h
  type tsf_s8 (line 31) | typedef signed char tsf_s8;
  type tsf_u8 (line 32) | typedef unsigned char tsf_u8;
  type tsf_u16 (line 33) | typedef unsigned short tsf_u16;
  type tsf_s16 (line 34) | typedef signed short tsf_s16;
  type tsf_u32 (line 35) | typedef unsigned int tsf_u32;
  type tsf_hydra_phdr (line 39) | struct tsf_hydra_phdr { tsf_char20 presetName; tsf_u16 preset, bank, pre...
  type tsf_hydra_pbag (line 40) | struct tsf_hydra_pbag { tsf_u16 genNdx, modNdx; }
  type tsf_hydra_pmod (line 41) | struct tsf_hydra_pmod { tsf_u16 modSrcOper, modDestOper; tsf_s16 modAmou...
  type tsf_hydra_pgen (line 42) | struct tsf_hydra_pgen { tsf_u16 genOper; union tsf_hydra_genamount genAm...
  type tsf_hydra_inst (line 43) | struct tsf_hydra_inst { tsf_char20 instName; tsf_u16 instBagNdx; }
  type tsf_hydra_ibag (line 44) | struct tsf_hydra_ibag { tsf_u16 instGenNdx, instModNdx; }
  type tsf_hydra_imod (line 45) | struct tsf_hydra_imod { tsf_u16 modSrcOper, modDestOper; tsf_s16 modAmou...
  type tsf_hydra_igen (line 46) | struct tsf_hydra_igen { tsf_u16 genOper; union tsf_hydra_genamount genAm...
  type tsf_hydra_shdr (line 47) | struct tsf_hydra_shdr { tsf_char20 sampleName; tsf_u32 start, end, start...
  type tsf_stream (line 51) | struct tsf_stream
  type Hydra (line 63) | struct Hydra
  type std (line 70) | typedef std::vector<float> F32Samples;
  type SF2 (line 72) | struct SF2
  type tsf_stream (line 78) | struct tsf_stream
  function tsf_stream_stdio_read (line 81) | inline int tsf_stream_stdio_read(FILE* f, void* ptr, unsigned int size) ...
  function tsf_stream_stdio_skip (line 82) | inline int tsf_stream_stdio_skip(FILE* f, unsigned int count) { return !...
  function LoadSF2Filename (line 83) | inline void LoadSF2Filename(const char* filename, SF2& sf2)
  type tsf_stream_memory (line 102) | struct tsf_stream_memory { const char* buffer; unsigned int total, pos; }
  function tsf_stream_memory_read (line 103) | inline int tsf_stream_memory_read(struct tsf_stream_memory* m, void* ptr...
  function tsf_stream_memory_skip (line 104) | inline int tsf_stream_memory_skip(struct tsf_stream_memory* m, unsigned ...
  function LoadSF2Memory (line 106) | inline void LoadSF2Memory(const void* buffer, int size, SF2& sf2)

FILE: SoundFont2/SF2Synth.cpp
  type LowPass (line 4) | struct LowPass
  type tsf_voice_envelope (line 11) | struct tsf_voice_envelope { float level, slope; int samplesUntilNextSegm...
    type tsf_envelope (line 11) | struct tsf_envelope
  type tsf_voice_lfo (line 12) | struct tsf_voice_lfo { int samplesUntil; float level, delta; }
  function tsf_gainToDecibels (line 30) | static float tsf_gainToDecibels(float gain) { return (gain <= .00001f ? ...
  function tsf_timecents2Secsd (line 31) | static double tsf_timecents2Secsd(double timecents) { return TSF_POW(2.0...
  function tsf_timecents2Secsf (line 32) | static float tsf_timecents2Secsf(float timecents) { return TSF_POWF(2.0f...
  function tsf_cents2Hertz (line 33) | static float tsf_cents2Hertz(float cents) { return 8.176f * TSF_POWF(2.0...
  function tsf_decibelsToGain (line 34) | static float tsf_decibelsToGain(float db) { return (db > -100.f ? TSF_PO...
  function tsf_voice_envelope_nextsegment (line 39) | static void tsf_voice_envelope_nextsegment(struct tsf_voice_envelope* e,...
  function tsf_voice_envelope_setup (line 140) | static void tsf_voice_envelope_setup(struct tsf_voice_envelope* e, const...
  function tsf_voice_lowpass_setup (line 158) | static void tsf_voice_lowpass_setup(LowPass* e, float Fc)
  function tsf_voice_lfo_setup (line 170) | static void tsf_voice_lfo_setup(struct tsf_voice_lfo* e, float delay, in...
  function tsf_voice_envelope_process (line 177) | static void tsf_voice_envelope_process(struct tsf_voice_envelope* e, int...
  function tsf_voice_lfo_process (line 189) | static void tsf_voice_lfo_process(struct tsf_voice_lfo* e, int blockSamp...
  function SynthRegion (line 204) | void SynthRegion(F32Samples& output, F32Samples& input, const tsf_region...
  function SF2Synth (line 351) | void SF2Synth(F32Samples& output, F32Samples& input, tsf_preset& preset,...

FILE: SoundFont2/Synth.cpp
  function Synth (line 4) | void Synth(const float* input, float* outputBuffer, unsigned numSamples,...

FILE: SoundFont2/Synth.h
  type LowPassState (line 6) | struct LowPassState
  type NoteState (line 11) | struct NoteState
  type LowPassCtrlPnt (line 17) | struct LowPassCtrlPnt
  type SynthCtrlPnt (line 23) | struct SynthCtrlPnt
  type OutputMode (line 32) | enum OutputMode
  type SynthCtrl (line 42) | struct SynthCtrl

FILE: SoundFont2/api.cpp
  type SF2Bank (line 29) | struct SF2Bank
  function SF2BankDestroy (line 45) | void SF2BankDestroy(void* ptr)
  function SF2BankGetNumberPresets (line 51) | unsigned long long SF2BankGetNumberPresets(void* ptr)
  function SF2BankGetPresetBankNum (line 63) | int SF2BankGetPresetBankNum(void* ptr, int i)
  function SF2BankGetPresetNumber (line 69) | int SF2BankGetPresetNumber(void* ptr, int i)
  type SF2Tone (line 76) | struct SF2Tone
  function SF2ToneDestroy (line 91) | void SF2ToneDestroy(void* ptr)
  function SF2SynthNote (line 98) | void SF2SynthNote(void* ptr_wavbuf, void* ptr_tone, float key, float vel...

FILE: Test/FlyMeToTheMoon.py
  function soS (line 7) | def soS(octave=5, duration=48):
  function set_soS (line 10) | def set_soS(freq):

FILE: Test/percussion_test.py
  function dong (line 10) | def dong(duration=48):
  function ca (line 13) | def ca(duration=48):
  function Bl (line 16) | def Bl(duration=48):
  function Bk (line 19) | def Bk(duration=48):

FILE: VoiceSampler/DVVector.hpp
  type VectorView (line 4) | struct VectorView
  class DVVector (line 11) | class DVVector
    method DVVector (line 15) | DVVector()
    method ViewType (line 26) | ViewType view()
    method Count (line 31) | unsigned Count() const
    method T (line 36) | T* Pointer()
    method T (line 41) | const T* ConstPointer() const
    method Free (line 56) | void Free()
    method Allocate (line 66) | void Allocate(unsigned count)
    method DVVector (line 74) | const DVVector& operator = (const std::vector<T>& cpuVec)
    method ToCPU (line 85) | void ToCPU(std::vector<T>& cpuVec) const
    method Update (line 91) | void Update(const std::vector<T>& cpuVec)
  class DVImagedVector (line 105) | class DVImagedVector : public DVVector<typename T_GPU::ViewType>
    method Allocate (line 108) | void Allocate(const std::vector<unsigned>& counts)
    method DVImagedVector (line 121) | const DVImagedVector& operator = (const std::vector<T_CPU>& cpuVecs)
    method ToCPU (line 135) | void ToCPU(std::vector<T_CPU>& cpuVecs) const
    method Update (line 143) | void Update(const std::vector<T_CPU>& cpuVecs)

FILE: VoiceSampler/FrequencyDetection.cpp
  function fetchFrequency (line 15) | void fetchFrequency(unsigned length, float *samples, unsigned sampleRate...

FILE: VoiceSampler/SentenceDescriptor.h
  type Wav (line 6) | struct Wav
  type FrqDataPoint (line 12) | struct FrqDataPoint
  type FrqData (line 18) | struct FrqData
  type Source (line 24) | struct Source
  type SourceMapCtrlPnt (line 30) | struct SourceMapCtrlPnt
  type Piece (line 37) | struct Piece
  type GeneralCtrlPnt (line 43) | struct GeneralCtrlPnt
  type SentenceDescriptor (line 49) | struct SentenceDescriptor

FILE: VoiceSampler/SentenceGeneratorCPU.cpp
  function Clamp01 (line 11) | inline void Clamp01(float& v)
  function GenerateSentenceCPU (line 17) | void GenerateSentenceCPU(const SentenceDescriptor* desc, float* outBuf, ...

FILE: VoiceSampler/SentenceGeneratorCPU.h
  type SentenceDescriptor (line 4) | struct SentenceDescriptor

FILE: VoiceSampler/SentenceGeneratorCUDA.cpp
  function Clamp01 (line 15) | inline void Clamp01(float& v)
  class DVSrcBuf (line 22) | class DVSrcBuf : public DVVector<float>
    method DVSrcBuf (line 25) | const DVSrcBuf&  operator = (const Buffer& cpuVec)
    method ToCPU (line 31) | void ToCPU(Buffer& cpuVec) const
    method Update (line 36) | void Update(const Buffer& cpuVec)
  type SrcSampleInfo (line 44) | struct SrcSampleInfo
  type Job (line 56) | struct Job
  type DstPieceInfo (line 62) | struct DstPieceInfo
  type SynthJobInfo (line 72) | struct SynthJobInfo
  type CUDATempBuffer (line 87) | struct CUDATempBuffer
  function GenerateSentenceCUDA (line 107) | void GenerateSentenceCUDA(const SentenceDescriptor* desc, float* outBuf,...

FILE: VoiceSampler/SentenceGeneratorCUDA.h
  type SentenceDescriptor (line 4) | struct SentenceDescriptor

FILE: VoiceSampler/SentenceGeneratorGeneral.cpp
  function Clamp01 (line 6) | inline void Clamp01(float& v)
  function RegulateSource (line 12) | void RegulateSource(const float* srcData, unsigned len, Buffer& dstBuf, ...
  function _floatBufSmooth (line 38) | static void _floatBufSmooth(float* buf, unsigned size)
  function PreprocessFreqMap (line 78) | void PreprocessFreqMap(const SentenceDescriptor* desc, unsigned outBufLe...

FILE: VoiceSampler/VoiceUtil.h
  function rand01 (line 25) | inline float rand01()
  function randGauss (line 33) | inline float randGauss(float sd)
  function namespace (line 40) | namespace VoiceUtil
  function class (line 103) | class Window
  function class (line 278) | class AmpSpectrum
  function CreateFromAmpSpec_noise (line 424) | void Window::CreateFromAmpSpec_noise(const AmpSpectrum& src, float targe...
  function class (line 475) | class SymmetricWindow_Base : public Window
  function class (line 557) | class SymmetricWindow_Axis : public SymmetricWindow_Base
  function class (line 738) | class SymmetricWindow_Center : public SymmetricWindow_Base
  type SymmetricWindow_Axis (line 917) | typedef SymmetricWindow_Axis SymmetricWindow;
  type SymmetricWindow_Center (line 919) | typedef SymmetricWindow_Center SymmetricWindow;
  function class (line 926) | class AutoRegression

FILE: VoiceSampler/api.cpp
  function HaveCUDA (line 43) | unsigned HaveCUDA()
  function FrqDataPointDestroy (line 65) | void FrqDataPointDestroy(void* ptr)
  function FrqDataDestroy (line 75) | void FrqDataDestroy(void* ptr)
  function FrqDataSet (line 80) | void FrqDataSet(void* ptr, int interval, double key, void* ptr_data_points)
  function DetectFreqs (line 95) | void DetectFreqs(const Buffer& buf, std::vector<float>& frequencies, std...
  function FrqDataDetect (line 119) | void FrqDataDetect(void* ptr, void* ptr_f32_buf, int interval)
  function SourceMapCtrlPntDestroy (line 167) | void SourceMapCtrlPntDestroy(void* ptr)
  function PieceDestroy (line 190) | void PieceDestroy(void* ptr)
  function GeneralCtrlPntDestroy (line 203) | void GeneralCtrlPntDestroy(void* ptr)
  function SentenceDescriptorDestroy (line 248) | void SentenceDescriptorDestroy(void* ptr)
  function GenerateSentenceX (line 253) | inline void GenerateSentenceX(void* ptr_wavbuf, void* ptr_sentence, bool...
  function GenerateSentence (line 300) | void GenerateSentence(void* ptr_wavbuf, void* ptr_sentence)
  function GenerateSentenceCUDA (line 305) | void GenerateSentenceCUDA(void* ptr_wavbuf, void* ptr_sentence)

FILE: VoiceSampler/helper_math.h
  type uint (line 28) | typedef unsigned int uint;
  type ushort (line 29) | typedef unsigned short ushort;
  function fminf (line 42) | inline float fminf(float a, float b)
  function fmaxf (line 47) | inline float fmaxf(float a, float b)
  function max (line 52) | inline int max(int a, int b)
  function min (line 57) | inline int min(int a, int b)
  function rsqrtf (line 62) | inline float rsqrtf(float x)
  function float2 (line 72) | float2 make_float2(float s)
  function float2 (line 76) | float2 make_float2(float3 a)
  function float2 (line 80) | float2 make_float2(int2 a)
  function float2 (line 84) | float2 make_float2(uint2 a)
  function int2 (line 89) | int2 make_int2(int s)
  function int2 (line 93) | int2 make_int2(int3 a)
  function int2 (line 97) | int2 make_int2(uint2 a)
  function int2 (line 101) | int2 make_int2(float2 a)
  function uint2 (line 106) | uint2 make_uint2(uint s)
  function uint2 (line 110) | uint2 make_uint2(uint3 a)
  function uint2 (line 114) | uint2 make_uint2(int2 a)
  function float3 (line 119) | float3 make_float3(float s)
  function float3 (line 123) | float3 make_float3(float2 a)
  function float3 (line 127) | float3 make_float3(float2 a, float s)
  function float3 (line 131) | float3 make_float3(float4 a)
  function float3 (line 135) | float3 make_float3(int3 a)
  function float3 (line 139) | float3 make_float3(uint3 a)
  function int3 (line 144) | int3 make_int3(int s)
  function int3 (line 148) | int3 make_int3(int2 a)
  function int3 (line 152) | int3 make_int3(int2 a, int s)
  function int3 (line 156) | int3 make_int3(uint3 a)
  function int3 (line 160) | int3 make_int3(float3 a)
  function uint3 (line 165) | uint3 make_uint3(uint s)
  function uint3 (line 169) | uint3 make_uint3(uint2 a)
  function uint3 (line 173) | uint3 make_uint3(uint2 a, uint s)
  function uint3 (line 177) | uint3 make_uint3(uint4 a)
  function uint3 (line 181) | uint3 make_uint3(int3 a)
  function float4 (line 186) | float4 make_float4(float s)
  function float4 (line 190) | float4 make_float4(float3 a)
  function float4 (line 194) | float4 make_float4(float3 a, float w)
  function float4 (line 198) | float4 make_float4(int4 a)
  function float4 (line 202) | float4 make_float4(uint4 a)
  function int4 (line 207) | int4 make_int4(int s)
  function int4 (line 211) | int4 make_int4(int3 a)
  function int4 (line 215) | int4 make_int4(int3 a, int w)
  function int4 (line 219) | int4 make_int4(uint4 a)
  function int4 (line 223) | int4 make_int4(float4 a)
  function uint4 (line 229) | uint4 make_uint4(uint s)
  function uint4 (line 233) | uint4 make_uint4(uint3 a)
  function uint4 (line 237) | uint4 make_uint4(uint3 a, uint w)
  function uint4 (line 241) | uint4 make_uint4(int4 a)
  function float2 (line 735) | float2 operator*(float2 a, float2 b)
  function float2 (line 744) | float2 operator*(float2 a, float b)
  function float2 (line 748) | float2 operator*(float b, float2 a)
  function int2 (line 758) | int2 operator*(int2 a, int2 b)
  function int2 (line 767) | int2 operator*(int2 a, int b)
  function int2 (line 771) | int2 operator*(int b, int2 a)
  function uint2 (line 781) | uint2 operator*(uint2 a, uint2 b)
  function uint2 (line 790) | uint2 operator*(uint2 a, uint b)
  function uint2 (line 794) | uint2 operator*(uint b, uint2 a)
  function float3 (line 804) | float3 operator*(float3 a, float3 b)
  function float3 (line 814) | float3 operator*(float3 a, float b)
  function float3 (line 818) | float3 operator*(float b, float3 a)
  function int3 (line 829) | int3 operator*(int3 a, int3 b)
  function int3 (line 839) | int3 operator*(int3 a, int b)
  function int3 (line 843) | int3 operator*(int b, int3 a)
  function uint3 (line 854) | uint3 operator*(uint3 a, uint3 b)
  function uint3 (line 864) | uint3 operator*(uint3 a, uint b)
  function uint3 (line 868) | uint3 operator*(uint b, uint3 a)
  function float4 (line 879) | float4 operator*(float4 a, float4 b)
  function float4 (line 890) | float4 operator*(float4 a, float b)
  function float4 (line 894) | float4 operator*(float b, float4 a)
  function int4 (line 906) | int4 operator*(int4 a, int4 b)
  function int4 (line 917) | int4 operator*(int4 a, int b)
  function int4 (line 921) | int4 operator*(int b, int4 a)
  function uint4 (line 933) | uint4 operator*(uint4 a, uint4 b)
  function uint4 (line 944) | uint4 operator*(uint4 a, uint b)
  function uint4 (line 948) | uint4 operator*(uint b, uint4 a)
  function float2 (line 1043) | float2 fminf(float2 a, float2 b)
  function float3 (line 1047) | float3 fminf(float3 a, float3 b)
  function float4 (line 1051) | float4 fminf(float4 a, float4 b)
  function int2 (line 1056) | int2 min(int2 a, int2 b)
  function int3 (line 1060) | int3 min(int3 a, int3 b)
  function int4 (line 1064) | int4 min(int4 a, int4 b)
  function uint2 (line 1069) | uint2 min(uint2 a, uint2 b)
  function uint3 (line 1073) | uint3 min(uint3 a, uint3 b)
  function uint4 (line 1077) | uint4 min(uint4 a, uint4 b)
  function float2 (line 1086) | float2 fmaxf(float2 a, float2 b)
  function float3 (line 1090) | float3 fmaxf(float3 a, float3 b)
  function float4 (line 1094) | float4 fmaxf(float4 a, float4 b)
  function int2 (line 1099) | int2 max(int2 a, int2 b)
  function int3 (line 1103) | int3 max(int3 a, int3 b)
  function int4 (line 1107) | int4 max(int4 a, int4 b)
  function uint2 (line 1112) | uint2 max(uint2 a, uint2 b)
  function uint3 (line 1116) | uint3 max(uint3 a, uint3 b)
  function uint4 (line 1120) | uint4 max(uint4 a, uint4 b)
  function lerp (line 1130) | float lerp(float a, float b, float t)
  function float2 (line 1134) | float2 lerp(float2 a, float2 b, float t)
  function float3 (line 1138) | float3 lerp(float3 a, float3 b, float t)
  function float4 (line 1142) | float4 lerp(float4 a, float4 b, float t)
  function clamp (line 1152) | float clamp(float f, float a, float b)
  function clamp (line 1156) | int clamp(int f, int a, int b)
  function uint (line 1160) | uint clamp(uint f, uint a, uint b)
  function float2 (line 1165) | float2 clamp(float2 v, float a, float b)
  function float2 (line 1169) | float2 clamp(float2 v, float2 a, float2 b)
  function float3 (line 1173) | float3 clamp(float3 v, float a, float b)
  function float3 (line 1177) | float3 clamp(float3 v, float3 a, float3 b)
  function float4 (line 1181) | float4 clamp(float4 v, float a, float b)
  function float4 (line 1185) | float4 clamp(float4 v, float4 a, float4 b)
  function int2 (line 1190) | int2 clamp(int2 v, int a, int b)
  function int2 (line 1194) | int2 clamp(int2 v, int2 a, int2 b)
  function int3 (line 1198) | int3 clamp(int3 v, int a, int b)
  function int3 (line 1202) | int3 clamp(int3 v, int3 a, int3 b)
  function int4 (line 1206) | int4 clamp(int4 v, int a, int b)
  function int4 (line 1210) | int4 clamp(int4 v, int4 a, int4 b)
  function uint2 (line 1215) | uint2 clamp(uint2 v, uint a, uint b)
  function uint2 (line 1219) | uint2 clamp(uint2 v, uint2 a, uint2 b)
  function uint3 (line 1223) | uint3 clamp(uint3 v, uint a, uint b)
  function uint3 (line 1227) | uint3 clamp(uint3 v, uint3 a, uint3 b)
  function uint4 (line 1231) | uint4 clamp(uint4 v, uint a, uint b)
  function uint4 (line 1235) | uint4 clamp(uint4 v, uint4 a, uint4 b)
  function dot (line 1244) | float dot(float2 a, float2 b)
  function dot (line 1248) | float dot(float3 a, float3 b)
  function dot (line 1252) | float dot(float4 a, float4 b)
  function dot (line 1257) | int dot(int2 a, int2 b)
  function dot (line 1261) | int dot(int3 a, int3 b)
  function dot (line 1265) | int dot(int4 a, int4 b)
  function uint (line 1270) | uint dot(uint2 a, uint2 b)
  function uint (line 1274) | uint dot(uint3 a, uint3 b)
  function uint (line 1278) | uint dot(uint4 a, uint4 b)
  function length (line 1287) | float length(float2 v)
  function length (line 1291) | float length(float3 v)
  function length (line 1295) | float length(float4 v)
  function float2 (line 1304) | float2 normalize(float2 v)
  function float3 (line 1309) | float3 normalize(float3 v)
  function float4 (line 1314) | float4 normalize(float4 v)
  function float2 (line 1324) | float2 floorf(float2 v)
  function float3 (line 1328) | float3 floorf(float3 v)
  function float4 (line 1332) | float4 floorf(float4 v)
  function fracf (line 1341) | float fracf(float v)
  function float2 (line 1345) | float2 fracf(float2 v)
  function float3 (line 1349) | float3 fracf(float3 v)
  function float4 (line 1353) | float4 fracf(float4 v)
  function float2 (line 1362) | float2 fmodf(float2 a, float2 b)
  function float3 (line 1366) | float3 fmodf(float3 a, float3 b)
  function float4 (line 1370) | float4 fmodf(float4 a, float4 b)
  function float2 (line 1379) | float2 fabs(float2 v)
  function float3 (line 1383) | float3 fabs(float3 v)
  function float4 (line 1387) | float4 fabs(float4 v)
  function int2 (line 1392) | int2 abs(int2 v)
  function int3 (line 1396) | int3 abs(int3 v)
  function int4 (line 1400) | int4 abs(int4 v)
  function float3 (line 1411) | float3 reflect(float3 i, float3 n)
  function float3 (line 1420) | float3 cross(float3 a, float3 b)
  function smoothstep (line 1432) | float smoothstep(float a, float b, float x)
  function float2 (line 1437) | float2 smoothstep(float2 a, float2 b, float2 x)
  function float3 (line 1442) | float3 smoothstep(float3 a, float3 b, float3 x)
  function float4 (line 1447) | float4 smoothstep(float4 a, float4 b, float4 x)

FILE: docs/meteor/meteor.js
  function Utf8ArrayToStr (line 42) | function Utf8ArrayToStr(array) {
  function GetIntervalId (line 345) | function GetIntervalId(sublists, v)

FILE: python/ScoreDraft/BasicSamplers.py
  class Sample (line 24) | class Sample:
    method __init__ (line 25) | def __init__(self, origin_sample_rate, channel_num, f32buf, max_value ...
    method __del__ (line 29) | def __del__(self):
  class InstrumentSample (line 32) | class InstrumentSample(Sample):
    method __init__ (line 33) | def __init__(self, origin_sample_rate, channel_num, f32buf, max_value ...
  function loadSample (line 39) | def loadSample(filename, is_instrument):
  function GetSample_Percussion (line 66) | def GetSample_Percussion(fn):
  function GetSample_Single (line 74) | def GetSample_Single(fn):
  function GetSamples_Multi (line 81) | def GetSamples_Multi(path):
  class EnginePercussionSampler (line 101) | class EnginePercussionSampler:
    method __init__ (line 102) | def __init__(self, sample):
    method tune (line 104) | def tune(self, cmd):
    method generateWave (line 106) | def generateWave(self, fduration, sampleRate):
  class EngineInstrumentSampler_Single (line 112) | class EngineInstrumentSampler_Single:
    method __init__ (line 113) | def __init__(self, sample):
    method tune (line 115) | def tune(self, cmd):
    method generateWave (line 117) | def generateWave(self, freq, fduration, sampleRate):
  class EngineInstrumentSampler_Multi (line 123) | class EngineInstrumentSampler_Multi:
    method __init__ (line 124) | def __init__(self, samples):
    method tune (line 127) | def tune(self, cmd):
    method generateWave (line 129) | def generateWave(self, freq, fduration, sampleRate):
  class PercussionSampler (line 135) | class PercussionSampler(Percussion):
    method __init__ (line 136) | def __init__(self, wavPath):
  class InstrumentSampler_Single (line 141) | class InstrumentSampler_Single(Instrument):
    method __init__ (line 142) | def __init__(self, wavPath):
  class InstrumentSampler_Multi (line 147) | class InstrumentSampler_Multi(Instrument):
    method __init__ (line 148) | def __init__(self, folderPath):

FILE: python/ScoreDraft/CVVCChineseConverter.py
  function getCV (line 1) | def getCV(CVLyric):
  function CVVCChineseConverter (line 68) | def CVVCChineseConverter(LyricForEachSyllable):

FILE: python/ScoreDraft/Catalog.py
  function PrintCatalog (line 10) | def PrintCatalog():

FILE: python/ScoreDraft/Document.py
  class Document (line 9) | class Document:
    method __init__ (line 14) | def __init__ (self):
    method getBuffer (line 19) | def getBuffer(self, bufferIndex):
    method getTempo (line 22) | def getTempo(self):
    method setTempo (line 25) | def setTempo(self,tempo):
    method getReferenceFrequency (line 28) | def getReferenceFrequency(self):
    method setReferenceFrequency (line 31) | def setReferenceFrequency(self,refFreq):
    method newBuf (line 34) | def newBuf(self, chn=-1):
    method setTrackVolume (line 43) | def setTrackVolume(self, bufferIndex, volume):
    method setTrackPan (line 46) | def setTrackPan(self, bufferIndex, pan):
    method playNoteSeq (line 49) | def playNoteSeq(self, seq, instrument, bufferIndex=-1):
    method playBeatSeq (line 63) | def playBeatSeq(self, seq, percList, bufferIndex=-1):
    method sing (line 76) | def sing(self, seq, singer, bufferIndex=-1):
    method trackToWav (line 89) | def trackToWav(self, bufferIndex, filename):
    method mix (line 92) | def mix(self, targetBuf):
    method mixDown (line 99) | def mixDown(self,filename,chn=-1):

FILE: python/ScoreDraft/Instrument.py
  function isNumber (line 3) | def isNumber(x):
  function GetTempoMap (line 6) | def GetTempoMap(tMap, beat48):
  class InstrumentShell (line 12) | class InstrumentShell:
    method __init__ (line 13) | def __init__(self):
    method tune (line 16) | def tune(self,cmd):
    method EnginePlayNote (line 28) | def EnginePlayNote(self, engine, buf, freq, fduration):
    method PlayNoteA (line 36) | def PlayNoteA(self,engine, buf, note, tempoMap, tempoMapOffset, refFreq):
    method PlayNoteB (line 49) | def PlayNoteB(self, engine, buf, note, tempo, refFreq):
    method PlaySequence (line 60) | def PlaySequence(self, engine, buf, seq, tempo, refFreq):
  class Instrument (line 123) | class Instrument:
    method __init__ (line 124) | def __init__(self):
    method play (line 126) | def play(self, buf, seq, tempo=80.0, refFreq=261.626):
    method tune (line 128) | def tune(self,cmd):
    method setNoteVolume (line 131) | def setNoteVolume(self,volume):
    method setNotePan (line 133) | def setNotePan(self,pan):
    method isGMDrum (line 135) | def isGMDrum(self):

FILE: python/ScoreDraft/JPVCVConverter.py
  function JPVCVConverter (line 38) | def JPVCVConverter(LyricForEachSyllable):

FILE: python/ScoreDraft/KarplusStrong.py
  class EngineKarplusStrong (line 25) | class EngineKarplusStrong:
    method __init__ (line 26) | def __init__(self):
    method tune (line 30) | def tune(self, cmd):
    method generateWave (line 32) | def generateWave(self, freq, fduration, sampleRate):
  class KarplusStrongInstrument (line 38) | class KarplusStrongInstrument(Instrument):
    method __init__ (line 39) | def __init__(self):
    method setCutFrequency (line 42) | def setCutFrequency(self, cut_freq):
    method setLoopGain (line 45) | def setLoopGain(self, loop_gain):
    method setSustainGain (line 47) | def setSustainGain(self, sustain_gain):

FILE: python/ScoreDraft/MIDIWriter.py
  class Note (line 22) | class Note:
    method __init__ (line 23) | def __init__(self, freq_rel, duration):
    method __del__ (line 26) | def __del__(self):
  function WriteNoteSequencesToMidi (line 29) | def WriteNoteSequencesToMidi(seqList, tempo, refFreq, fileName):

FILE: python/ScoreDraft/Meteor.py
  class CtrlPnt (line 37) | class CtrlPnt:
    method __init__ (line 38) | def __init__(self, freq, fduration):
    method __del__ (line 41) | def __del__(self):
  class Syllable (line 44) | class Syllable:
    method __init__ (line 45) | def __init__(self, lyric, ctrl_pnts):
    method __del__ (line 49) | def __del__(self):
  class Event (line 52) | class Event:
    method __del__ (line 53) | def __del__(self):
    method set_offset (line 56) | def set_offset(self, offset):
  class EventInst (line 59) | class EventInst(Event):
    method __init__ (line 60) | def __init__(self, instrument_id, freq, fduration):
  class EventPerc (line 63) | class EventPerc(Event):
    method __init__ (line 64) | def __init__(self, instrument_id, fduration):
  class EventSing (line 67) | class EventSing(Event):
    method __init__ (line 68) | def __init__(self, instrument_id, syllable_list):
  class Meteor (line 72) | class Meteor:
    method __init__ (line 73) | def __init__(self, event_list = None):
    method __del__ (line 80) | def __del__(self):
    method save_to_file (line 83) | def save_to_file(self, filename):
    method load_from_file (line 86) | def load_from_file(self, filename):
    method to_base64 (line 89) | def to_base64(self):
  function MeteorPlay (line 95) | def MeteorPlay(meteor, track):
  class DummyTrackBuffer (line 112) | class DummyTrackBuffer(TrackBuffer):
    method __init__ (line 113) | def __init__ (self, eventList, chn=-1):
    method writeBlend (line 117) | def writeBlend(self, wavBuf):
  class DummyInstrumentEngine (line 124) | class DummyInstrumentEngine:
    method __init__ (line 125) | def __init__(self, inst_id, engine, isGMDrum):
    method tune (line 130) | def tune(self, cmd):
    method generateWave (line 133) | def generateWave(self, freq, fduration, sampleRate):
  class DummyInstrument (line 147) | class DummyInstrument(Instrument):
    method __init__ (line 148) | def __init__(self, inst_id, inst):
  class DummyInstrumentCreator (line 152) | class DummyInstrumentCreator:
    method __init__ (line 153) | def __init__(self):
    method Create (line 157) | def Create(self, inst):
  class DummyPercussionEngine (line 163) | class DummyPercussionEngine:
    method __init__ (line 164) | def __init__(self, inst_id, engine):
    method tune (line 168) | def tune(self, cmd):
    method generateWave (line 171) | def generateWave(self, fduration, sampleRate):
  class DummyPercussion (line 177) | class DummyPercussion(Percussion):
    method __init__ (line 178) | def __init__(self, inst_id, perc):
  class DummyPercussionCreator (line 183) | class DummyPercussionCreator:
    method __init__ (line 184) | def __init__(self):
    method Create (line 188) | def Create(self, perc):
  class DummySingerEngine (line 194) | class DummySingerEngine:
    method __init__ (line 195) | def __init__(self, inst_id, engine):
    method tune (line 199) | def tune(self, cmd):
    method generateWave (line 202) | def generateWave(self, syllableList, sampleRate):
  class DummySinger (line 209) | class DummySinger(Singer):
    method __init__ (line 210) | def __init__(self, inst_id, singer):
  class DummySingerCreator (line 215) | class DummySingerCreator:
    method __init__ (line 216) | def __init__(self):
    method Create (line 220) | def Create(self, singer):
  class Document (line 226) | class Document:
    method __init__ (line 227) | def __init__ (self):
    method getBuffer (line 236) | def getBuffer(self, bufferIndex):
    method getTempo (line 239) | def getTempo(self):
    method setTempo (line 242) | def setTempo(self,tempo):
    method getReferenceFrequency (line 245) | def getReferenceFrequency(self):
    method setReferenceFrequency (line 248) | def setReferenceFrequency(self,refFreq):
    method newBuf (line 251) | def newBuf(self, chn=-1):
    method setTrackVolume (line 256) | def setTrackVolume(self, bufferIndex, volume):
    method setTrackPan (line 259) | def setTrackPan(self, bufferIndex, pan):
    method playNoteSeq (line 262) | def playNoteSeq(self, seq, instrument, bufferIndex=-1):
    method playBeatSeq (line 270) | def playBeatSeq(self, seq, percList, bufferIndex=-1):
    method sing (line 278) | def sing(self, seq, singer, bufferIndex=-1):
    method trackToWav (line 286) | def trackToWav(self, bufferIndex, filename):
    method mix (line 289) | def mix(self, targetBuf):
    method mixDown (line 292) | def mixDown(self,filename,chn=-1):
    method meteor (line 297) | def meteor(self,chn=-1):
    method saveToFile (line 303) | def saveToFile(self,filename):

FILE: python/ScoreDraft/MusicXMLDocument.py
  function _find_tempo (line 9) | def _find_tempo(score):
  function _part_to_seq (line 30) | def _part_to_seq(part):
  class MusicXMLDocument (line 55) | class MusicXMLDocument(Document):
    method __init__ (line 56) | def __init__(self, str_xml):
    method playXML (line 62) | def playXML(self, instruments):
  function from_music_xml (line 72) | def from_music_xml(filename):
  function from_lilypond (line 76) | def from_lilypond(filename):

FILE: python/ScoreDraft/Notes.py
  function note (line 21) | def note(octave, freq, duration):
  function do (line 24) | def do(octave=5, duration=48):
  function set_do (line 27) | def set_do(freq):
  function re (line 30) | def re(octave=5, duration=48):
  function set_re (line 33) | def set_re(freq):
  function mi (line 36) | def mi(octave=5, duration=48):
  function set_mi (line 39) | def set_mi(freq):
  function fa (line 42) | def fa(octave=5, duration=48):
  function set_fa (line 45) | def set_fa(freq):
  function so (line 48) | def so(octave=5, duration=48):
  function set_so (line 51) | def set_so(freq):
  function la (line 54) | def la(octave=5, duration=48):
  function set_la (line 57) | def set_la(freq):
  function ti (line 60) | def ti(octave=5, duration=48):
  function set_ti (line 63) | def set_ti(freq):
  function BL (line 67) | def BL(duration=48):
  function BK (line 70) | def BK(duration=48):

FILE: python/ScoreDraft/PCMPlayer.py
  class PCMPlayer (line 22) | class PCMPlayer:
    method __init__ (line 23) | def __init__(self, sample_rate = 44100.0, ui = False):
    method __del__ (line 26) | def __del__(self):
    method play_track (line 29) | def play_track(self, track):
    method remaining_time (line 32) | def remaining_time(self):
    method main_loop (line 35) | def main_loop(self):
  class AsyncUIPCMPlayer (line 38) | class AsyncUIPCMPlayer:
    method __init__ (line 39) | def __init__(self, sample_rate = 44100.0):
    method _ui_thread (line 43) | def _ui_thread(self):
    method play_track (line 49) | def play_track(self, track):
    method remaining_time (line 56) | def remaining_time(self):

FILE: python/ScoreDraft/Percussion.py
  function isNumber (line 3) | def isNumber(x):
  function GetTempoMap (line 6) | def GetTempoMap(tMap, beat48):
  class PercussionShell (line 12) | class PercussionShell:
    method __init__ (line 13) | def __init__(self):
    method tune (line 16) | def tune(self,cmd):
    method EnginePlayBeat (line 28) | def EnginePlayBeat(self, engine, buf, fduration):
    method PlayBeatA (line 36) | def PlayBeatA(self, engine, buf, duration, tempoMap, tempoMapOffset):
    method PlayBeatB (line 43) | def PlayBeatB(self, engine, buf, duration, tempo):
    method PlaySilenceA (line 48) | def PlaySilenceA(buf, duration, tempoMap, tempoMapOffset):
    method PlayBackspaceA (line 52) | def PlayBackspaceA(buf, duration, tempoMap, tempoMapOffset):
    method PlaySilenceB (line 56) | def PlaySilenceB(buf, duration, tempo):
    method PlayBackspaceB (line 61) | def PlayBackspaceB(buf, duration, tempo):
  function PlaySequence (line 66) | def PlaySequence(perc_list, buf, seq, tempo):
  class Percussion (line 107) | class Percussion:
    method __init__ (line 108) | def __init__(self):
    method play (line 112) | def play(percList, buf, seq, tempo=80.0):
    method tune (line 115) | def tune(self,cmd):
    method setBeatVolume (line 118) | def setBeatVolume(self,volume):
    method setBeatPan (line 120) | def setBeatPan(self,pan):

FILE: python/ScoreDraft/RapChinese.py
  function SetRapBaseFreq (line 3) | def SetRapBaseFreq(freq):
  function CRap (line 7) | def CRap(lyric, tone, duration=48):

FILE: python/ScoreDraft/ScoreDraftCore.py
  class ObjArray (line 60) | class ObjArray:
    method __init__ (line 61) | def __init__(self, arr):
    method __del__ (line 66) | def __del__(self):
  class F32Buf (line 70) | class F32Buf:
    method __init__ (line 71) | def __init__(self, size, value = 0.0):
    method __del__ (line 74) | def __del__(self):
    method data (line 77) | def data(self):
    method size (line 80) | def size(self):
    method to_s16 (line 83) | def to_s16(self, amplitude):
    method from_s16 (line 91) | def from_s16(cls, s16):
    method max_value (line 97) | def max_value(self):
    method mix (line 101) | def mix(cls, lst_bufs):
  class WavBuffer (line 107) | class WavBuffer:
    method __init__ (line 108) | def __init__(self, sampleRate, channelNum, data, alignPos = 0, volume ...
    method __del__ (line 112) | def __del__(self):
    method get_sample_rate (line 115) | def get_sample_rate(self):
    method get_channel_num (line 118) | def get_channel_num(self):
    method get_sample_num (line 121) | def get_sample_num(self):
    method get_align_pos (line 124) | def get_align_pos(self):
    method set_align_pos (line 127) | def set_align_pos(self, alignPos):
    method get_volume (line 130) | def get_volume(self):
    method set_volume (line 133) | def set_volume(self, volume):
    method get_pan (line 136) | def get_pan(self):
    method set_pan (line 139) | def set_pan(self, pan):
  function setDefaultNumberOfChannels (line 143) | def setDefaultNumberOfChannels(defChn):
  class TrackBuffer (line 151) | class TrackBuffer:
    method __init__ (line 156) | def __init__ (self, chn=-1):
    method __del__ (line 168) | def __del__(self):
    method getSampleRate (line 171) | def getSampleRate(self):
    method setVolume (line 174) | def setVolume(self,volume):
    method getVolume (line 181) | def getVolume(self):
    method setPan (line 188) | def setPan(self, pan):
    method getPan (line 196) | def getPan(self):
    method getNumberOfSamples (line 203) | def getNumberOfSamples(self):
    method getNumberOfChannles (line 210) | def getNumberOfChannles(self):
    method getAlignPosition (line 217) | def getAlignPosition(self):
    method getCursor (line 226) | def getCursor(self):
    method setCursor (line 234) | def setCursor(self, cursor):
    method moveCursor (line 243) | def moveCursor(self, cursor_delta):
    method writeBlend (line 251) | def writeBlend(self, wavBuf):
  function MixTrackBufferList (line 259) | def MixTrackBufferList (targetbuf, bufferList):
  function WriteTrackBufferToWav (line 268) | def WriteTrackBufferToWav(buf, filename):
  function ReadTrackBufferFromWav (line 276) | def ReadTrackBufferFromWav(buf, filename):

FILE: python/ScoreDraft/SimpleInstruments.py
  class Engine (line 26) | class Engine:
    method __init__ (line 27) | def __init__(self, generator):
    method tune (line 29) | def tune(self, cmd):
    method generateWave (line 31) | def generateWave(self, freq, fduration, sampleRate):
  function EnginePureSin (line 37) | def EnginePureSin():
  function EngineSquare (line 40) | def EngineSquare():
  function EngineTriangle (line 43) | def EngineTriangle():
  function EngineSawtooth (line 46) | def EngineSawtooth():
  function EngineNaivePiano (line 49) | def EngineNaivePiano():
  function EngineBottleBlow (line 52) | def EngineBottleBlow():
  class PureSin (line 55) | class PureSin(Instrument):
    method __init__ (line 56) | def __init__(self):
  class Square (line 60) | class Square(Instrument):
    method __init__ (line 61) | def __init__(self):
  class Triangle (line 65) | class Triangle(Instrument):
    method __init__ (line 66) | def __init__(self):
  class Sawtooth (line 70) | class Sawtooth(Instrument):
    method __init__ (line 71) | def __init__(self):
  class NaivePiano (line 75) | class NaivePiano(Instrument):
    method __init__ (line 76) | def __init__(self):
  class BottleBlow (line 80) | class BottleBlow(Instrument):
    method __init__ (line 81) | def __init__(self):

FILE: python/ScoreDraft/Singer.py
  function isNumber (line 3) | def isNumber(x):
  function GetTempoMap (line 6) | def GetTempoMap(tMap, beat48):
  class SingerShell (line 12) | class SingerShell:
    method __init__ (line 13) | def __init__(self):
    method tune (line 17) | def tune(self,cmd):
    method EngineSingSyllables (line 32) | def EngineSingSyllables(self,engine, buf, syllableList,totalDuration):
    method SingSyllablesA (line 40) | def SingSyllablesA(self,engine, buf, syllables, tempoMap, tempoMapOffs...
    method SingSyllablesB (line 81) | def SingSyllablesB(self, engine, buf, syllables, tempo, refFreq):
    method SingSequence (line 119) | def SingSequence(self,engine, buf, seq, tempo, refFreq):
  class Singer (line 211) | class Singer:
    method __init__ (line 212) | def __init__(self):
    method sing (line 214) | def sing(self, buf, seq, tempo=80, refFreq=261.626):
    method tune (line 216) | def tune(self,cmd):
    method setDefaultLyric (line 219) | def setDefaultLyric(self,defaultLyric):
    method setNoteVolume (line 221) | def setNoteVolume(self,volume):
    method setNotePan (line 223) | def setNotePan(self,pan):

FILE: python/ScoreDraft/SoundFont2.py
  class SF2Bank (line 32) | class SF2Bank:
    method __init__ (line 33) | def __init__(self, filename):
    method __del__ (line 36) | def __del__(self):
    method num_presets (line 39) | def num_presets(self):
    method get_preset_info (line 42) | def get_preset_info(self, i):
  function GetSF2Bank (line 51) | def GetSF2Bank(filename):
  function ListPresets (line 56) | def ListPresets(filename):
  class EngineSoundFont2 (line 69) | class EngineSoundFont2:
    method __init__ (line 70) | def __init__(self, bank, preset_index):
    method __del__ (line 77) | def __del__(self):
    method isGMDrum (line 80) | def isGMDrum(self):
    method tune (line 84) | def tune(self, cmd):
    method generateWave (line 93) | def generateWave(self, freq, fduration, sampleRate):
  class SF2Instrument (line 101) | class SF2Instrument(Instrument):
    method __init__ (line 102) | def __init__(self, fn, preset_index):
    method isGMDrum (line 107) | def isGMDrum(self):

FILE: python/ScoreDraft/TTEnglishConverter.py
  function BuildLyricSet (line 12) | def BuildLyricSet():
  function LoadLyricSet (line 32) | def LoadLyricSet():
  function TTEnglishConverter (line 50) | def TTEnglishConverter(inList):

FILE: python/ScoreDraft/TsuroVCVConverter.py
  function getVowel (line 1) | def getVowel(CVLyric):
  function TsuroVCVConverter (line 49) | def TsuroVCVConverter(LyricForEachSyllable):

FILE: python/ScoreDraft/UTAUUtils.py
  function LoadFrq (line 7) | def LoadFrq(filename):
  function LoadOtoINIPath (line 25) | def LoadOtoINIPath(otoMap, path, encoding):
  function LoadPrefixMap (line 105) | def LoadPrefixMap(filename):
  function LookUpPrefixMap (line 125) | def LookUpPrefixMap(prefixMap, freq):
  class VoiceBank (line 144) | class VoiceBank:
    method __init__ (line 145) | def __init__ (self, path):
    method buildOtoMap (line 158) | def buildOtoMap(self,path):
    method initialize (line 163) | def initialize(self):
    method getWavFrq (line 169) | def getWavFrq(self,lyric):
    method getWavFrq_PrefixMap (line 183) | def getWavFrq_PrefixMap(self,lyric, freq):

FILE: python/ScoreDraft/UtauDraft.py
  function loadWav (line 17) | def loadWav(file):
  function GetVoiceBank (line 23) | def GetVoiceBank(path):
  function _PieceMapper (line 28) | def _PieceMapper(syllableLyricList, lyricList, otoList, CZMode=False):
  function DefaultPieceMapper (line 132) | def DefaultPieceMapper(syllableLyricList, lyricList, otoList):
  function CZPieceMapper (line 135) | def CZPieceMapper(syllableLyricList, lyricList, otoList):
  class Engine (line 138) | class Engine:
    method __init__ (line 139) | def __init__(self, voiceBank):
    method tune (line 150) | def tune(self, cmd):
    method _convertLyric (line 163) | def _convertLyric(self, syllableList):
    method generateWave (line 182) | def generateWave(self, syllableList, sampleRate):
  class UtauDraft (line 280) | class UtauDraft(Singer):
    method __init__ (line 281) | def __init__(self, voiceBank, useCUDA=True):
    method setLyricConverter (line 285) | def setLyricConverter(self, lyricConverter):
    method setPieceMapper (line 287) | def setPieceMapper(self, pieceMapper):
    method setUsePrefixMap (line 289) | def setUsePrefixMap(self,usePrefixMap):
    method setCZMode (line 291) | def setCZMode(self):

FILE: python/ScoreDraft/VCCVEnglishConverter.py
  function BuildLyricSet (line 12) | def BuildLyricSet():
  function LoadLyricSet (line 32) | def LoadLyricSet():
  function VCCVEnglishConverter (line 50) | def VCCVEnglishConverter(inList):

FILE: python/ScoreDraft/VoiceSampler.py
  function HaveCUDA (line 35) | def HaveCUDA():
  class FrqDataPoint (line 38) | class FrqDataPoint:
    method __init__ (line 39) | def __init__(self, freq, dyn):
    method __del__ (line 42) | def __del__(self):
  class FrqData (line 45) | class FrqData:
    method __init__ (line 46) | def __init__(self):
    method __del__ (line 49) | def __del__(self):
    method set (line 52) | def set(self, interval, key, lst_data_points):
    method detect (line 56) | def detect(self, f32_buf, interval):
  class SourceMapCtrlPnt (line 59) | class SourceMapCtrlPnt:
    method __init__ (line 60) | def __init__(self, srcPos, dstPos, isVowel):
    method __del__ (line 63) | def __del__(self):
  class Piece (line 66) | class Piece:
    method __init__ (line 67) | def __init__(self, f32buf, frq_data, src_map):
    method __del__ (line 72) | def __del__(self):
  class GeneralCtrlPnt (line 75) | class GeneralCtrlPnt:
    method __init__ (line 76) | def __init__(self, value, dstPos):
    method __del__ (line 79) | def __del__(self):
  class SentenceDescriptor (line 82) | class SentenceDescriptor:
    method __init__ (line 83) | def __init__(self, pieces, piece_map, freq_map, volume_map):
    method __del__ (line 91) | def __del__(self):
  function CreateSentenceDescriptor (line 94) | def CreateSentenceDescriptor(desc_dictionary):
  function GenerateSentence (line 128) | def GenerateSentence(desc_dictionary):
  function GenerateSentenceCUDA (line 135) | def GenerateSentenceCUDA(desc_dictionary):

FILE: python/ScoreDraft/XiaYYConverter.py
  function getCV (line 1) | def getCV(CVLyric):
  function XiaYYConverter (line 88) | def XiaYYConverter(LyricForEachSyllable):

FILE: python/ScoreDraft/YAMLDocument.py
  class YAMLScore (line 8) | class YAMLScore:
    method __init__ (line 9) | def __init__(self, str_yaml):
    method to_ly (line 12) | def to_ly(self):
  class YAMLDocument (line 212) | class YAMLDocument(MusicXMLDocument):
    method __init__ (line 213) | def __init__(self, yaml_score):
    method play (line 331) | def play(self):

FILE: python/ScoreDraft/__init__.py
  function isNumber (line 3) | def isNumber(x):
  function TellDuration (line 6) | def TellDuration(seq):
  function DetectFrqVoice (line 57) | def DetectFrqVoice(wavF32, interval=256):
  function PlayTrackBuffer (line 78) | def PlayTrackBuffer(track):
  function run_yaml (line 96) | def run_yaml():

FILE: python/ScoreDraft/musicxml/musicxml.py
  class AboveBelow (line 16) | class AboveBelow(Enum):
  class AccidentalValue (line 25) | class AccidentalValue(Enum):
  class ArrowDirection (line 87) | class ArrowDirection(Enum):
  class ArrowStyle (line 107) | class ArrowStyle(Enum):
  class BackwardForward (line 126) | class BackwardForward(Enum):
  class BarStyle (line 136) | class BarStyle(Enum):
  class BeamValue (line 157) | class BeamValue(Enum):
  class BeaterValue (line 169) | class BeaterValue(Enum):
  class BendShape (line 197) | class BendShape(Enum):
  class Bookmark (line 208) | class Bookmark:
    class Meta (line 213) | class Meta:
  class BreathMarkValue (line 243) | class BreathMarkValue(Enum):
  class CaesuraValue (line 254) | class CaesuraValue(Enum):
  class CancelLocation (line 266) | class CancelLocation(Enum):
  class CircularArrow (line 280) | class CircularArrow(Enum):
  class ClefSign (line 289) | class ClefSign(Enum):
  class CssFontSize (line 309) | class CssFontSize(Enum):
  class DegreeSymbolValue (line 323) | class DegreeSymbolValue(Enum):
  class DegreeTypeValue (line 335) | class DegreeTypeValue(Enum):
  class Distance (line 347) | class Distance:
    class Meta (line 354) | class Meta:
  class EffectValue (line 372) | class EffectValue(Enum):
  class Empty (line 398) | class Empty:
    class Meta (line 402) | class Meta:
  class EnclosureShape (line 406) | class EnclosureShape(Enum):
  class Fan (line 431) | class Fan(Enum):
  class Feature (line 442) | class Feature:
    class Meta (line 450) | class Meta:
  class FermataShape (line 467) | class FermataShape(Enum):
  class FontStyle (line 483) | class FontStyle(Enum):
  class FontWeight (line 492) | class FontWeight(Enum):
  class GlassValue (line 501) | class GlassValue(Enum):
  class Glyph (line 512) | class Glyph:
    class Meta (line 525) | class Meta:
  class GroupBarlineValue (line 543) | class GroupBarlineValue(Enum):
  class GroupSymbolValue (line 553) | class GroupSymbolValue(Enum):
  class HandbellValue (line 565) | class HandbellValue(Enum):
  class HarmonClosedLocation (line 584) | class HarmonClosedLocation(Enum):
  class HarmonClosedValue (line 595) | class HarmonClosedValue(Enum):
  class HarmonyArrangement (line 605) | class HarmonyArrangement(Enum):
  class HarmonyType (line 619) | class HarmonyType(Enum):
  class HoleClosedLocation (line 632) | class HoleClosedLocation(Enum):
  class HoleClosedValue (line 643) | class HoleClosedValue(Enum):
  class Instrument (line 654) | class Instrument:
    class Meta (line 664) | class Meta:
  class InstrumentLink (line 677) | class InstrumentLink:
    class Meta (line 687) | class Meta:
  class KindValue (line 699) | class KindValue(Enum):
  class LeftCenterRight (line 781) | class LeftCenterRight(Enum):
  class LeftRight (line 791) | class LeftRight(Enum):
  class LineEnd (line 800) | class LineEnd(Enum):
  class LineLength (line 812) | class LineLength(Enum):
  class LineShape (line 822) | class LineShape(Enum):
  class LineType (line 830) | class LineType(Enum):
  class LineWidth (line 842) | class LineWidth:
    class Meta (line 851) | class Meta:
  class MarginType (line 869) | class MarginType(Enum):
  class MeasureLayout (line 880) | class MeasureLayout:
    class Meta (line 892) | class Meta:
  class MeasureNumberingValue (line 904) | class MeasureNumberingValue(Enum):
  class MembraneValue (line 915) | class MembraneValue(Enum):
  class MetalValue (line 939) | class MetalValue(Enum):
  class MidiDevice (line 981) | class MidiDevice:
    class Meta (line 992) | class Meta:
  class MidiInstrument (line 1018) | class MidiInstrument:
    class Meta (line 1055) | class Meta:
  class MiscellaneousField (line 1135) | class MiscellaneousField:
    class Meta (line 1142) | class Meta:
  class Mute (line 1160) | class Mute(Enum):
  class NoteSizeType (line 1184) | class NoteSizeType(Enum):
  class NoteTypeValue (line 1200) | class NoteTypeValue(Enum):
  class NoteheadValue (line 1222) | class NoteheadValue(Enum):
  class NumberOrNormalValue (line 1274) | class NumberOrNormalValue(Enum):
  class NumeralMode (line 1278) | class NumeralMode(Enum):
  class OnOff (line 1295) | class OnOff(Enum):
  class OtherAppearance (line 1304) | class OtherAppearance:
    class Meta (line 1311) | class Meta:
  class OtherListening (line 1330) | class OtherListening:
    class Meta (line 1339) | class Meta:
  class OtherPlay (line 1372) | class OtherPlay:
    class Meta (line 1378) | class Meta:
  class OtherText (line 1397) | class OtherText:
    class Meta (line 1405) | class Meta:
  class OverUnder (line 1422) | class OverUnder(Enum):
  class PedalType (line 1431) | class PedalType(Enum):
  class PitchedValue (line 1461) | class PitchedValue(Enum):
  class Player (line 1482) | class Player:
    class Meta (line 1494) | class Meta:
  class PositiveIntegerOrEmptyValue (line 1514) | class PositiveIntegerOrEmptyValue(Enum):
  class PrincipalVoiceSymbol (line 1518) | class PrincipalVoiceSymbol(Enum):
  class RightLeftMiddle (line 1532) | class RightLeftMiddle(Enum):
  class Scaling (line 1542) | class Scaling:
    class Meta (line 1552) | class Meta:
  class SemiPitched (line 1571) | class SemiPitched(Enum):
  class ShowFrets (line 1584) | class ShowFrets(Enum):
  class ShowTuplet (line 1594) | class ShowTuplet(Enum):
  class StaffDivideSymbol (line 1605) | class StaffDivideSymbol(Enum):
  class StaffLayout (line 1617) | class StaffLayout:
    class Meta (line 1629) | class Meta:
  class StaffSize (line 1648) | class StaffSize:
    class Meta (line 1667) | class Meta:
  class StaffType (line 1686) | class StaffType(Enum):
  class StartNote (line 1710) | class StartNote(Enum):
  class StartStop (line 1720) | class StartStop(Enum):
  class StartStopChangeContinue (line 1738) | class StartStopChangeContinue(Enum):
  class StartStopContinue (line 1749) | class StartStopContinue(Enum):
  class StartStopDiscontinue (line 1773) | class StartStopDiscontinue(Enum):
  class StartStopSingle (line 1789) | class StartStopSingle(Enum):
  class StemValue (line 1803) | class StemValue(Enum):
  class Step (line 1813) | class Step(Enum):
  class StickLocation (line 1827) | class StickLocation(Enum):
  class StickMaterial (line 1838) | class StickMaterial(Enum):
  class StickType (line 1850) | class StickType(Enum):
  class SwingTypeValue (line 1867) | class SwingTypeValue(Enum):
  class Syllabic (line 1876) | class Syllabic(Enum):
  class SymbolSize (line 1889) | class SymbolSize(Enum):
  class SyncType (line 1900) | class SyncType(Enum):
  class SystemMargins (line 1923) | class SystemMargins:
    class Meta (line 1928) | class Meta:
  class SystemRelation (line 1949) | class SystemRelation(Enum):
  class SystemRelationNumber (line 1966) | class SystemRelationNumber(Enum):
  class TapHand (line 1987) | class TapHand(Enum):
  class TextDirection (line 1997) | class TextDirection(Enum):
  class TiedType (line 2016) | class TiedType(Enum):
  class TimeRelation (line 2041) | class TimeRelation(Enum):
  class TimeSeparator (line 2054) | class TimeSeparator(Enum):
  class TimeSymbol (line 2073) | class TimeSymbol(Enum):
  class Timpani (line 2095) | class Timpani:
    class Meta (line 2101) | class Meta:
  class TipDirection (line 2113) | class TipDirection(Enum):
  class TopBottom (line 2128) | class TopBottom(Enum):
  class TremoloType (line 2137) | class TremoloType(Enum):
  class TrillStep (line 2148) | class TrillStep(Enum):
  class TwoNoteTurn (line 2158) | class TwoNoteTurn(Enum):
  class TypedText (line 2169) | class TypedText:
    class Meta (line 2173) | class Meta:
  class UpDown (line 2190) | class UpDown(Enum):
  class UpDownStopContinue (line 2199) | class UpDownStopContinue(Enum):
  class UprightInverted (line 2211) | class UprightInverted(Enum):
  class Valign (line 2220) | class Valign(Enum):
  class ValignImage (line 2234) | class ValignImage(Enum):
  class VirtualInstrument (line 2246) | class VirtualInstrument:
    class Meta (line 2256) | class Meta:
  class Wait (line 2276) | class Wait:
    class Meta (line 2287) | class Meta:
  class WedgeType (line 2306) | class WedgeType(Enum):
  class Winged (line 2321) | class Winged(Enum):
  class WoodValue (line 2336) | class WoodValue(Enum):
  class YesNo (line 2366) | class YesNo(Enum):
  class Accidental (line 2377) | class Accidental:
    class Meta (line 2385) | class Meta:
  class AccidentalMark (line 2498) | class AccidentalMark:
    class Meta (line 2505) | class Meta:
  class AccidentalText (line 2618) | class AccidentalText:
    class Meta (line 2623) | class Meta:
  class Accord (line 2797) | class Accord:
    class Meta (line 2815) | class Meta:
  class AccordionRegistration (line 2852) | class AccordionRegistration:
    class Meta (line 2886) | class Meta:
  class Arpeggiate (line 2997) | class Arpeggiate:
    class Meta (line 3012) | class Meta:
  class Arrow (line 3085) | class Arrow:
    class Meta (line 3096) | class Meta:
  class Assess (line 3205) | class Assess:
    class Meta (line 3217) | class Meta:
  class BarStyleColor (line 3244) | class BarStyleColor:
    class Meta (line 3248) | class Meta:
  class Barre (line 3267) | class Barre:
    class Meta (line 3275) | class Meta:
  class BassStep (line 3295) | class BassStep:
    class Meta (line 3302) | class Meta:
  class Beam (line 3384) | class Beam:
    class Meta (line 3402) | class Meta:
  class BeatRepeat (line 3447) | class BeatRepeat:
    class Meta (line 3477) | class Meta:
  class BeatUnitTied (line 3524) | class BeatUnitTied:
    class Meta (line 3537) | class Meta:
  class Beater (line 3558) | class Beater:
    class Meta (line 3563) | class Meta:
  class Bracket (line 3581) | class Bracket:
    class Meta (line 3590) | class Meta:
  class BreathMark (line 3688) | class BreathMark:
    class Meta (line 3692) | class Meta:
  class Caesura (line 3774) | class Caesura:
    class Meta (line 3780) | class Meta:
  class Cancel (line 3862) | class Cancel:
    class Meta (line 3873) | class Meta:
  class Clef (line 3891) | class Clef:
    class Meta (line 3937) | class Meta:
  class Coda (line 4065) | class Coda:
    class Meta (line 4071) | class Meta:
  class Dashes (line 4166) | class Dashes:
    class Meta (line 4171) | class Meta:
  class DegreeAlter (line 4247) | class DegreeAlter:
    class Meta (line 4259) | class Meta:
  class DegreeType (line 4342) | class DegreeType:
    class Meta (line 4350) | class Meta:
  class DegreeValue (line 4432) | class DegreeValue:
    class Meta (line 4441) | class Meta:
  class Double (line 4529) | class Double:
    class Meta (line 4538) | class Meta:
  class Dynamics (line 4550) | class Dynamics:
    class Meta (line 4571) | class Meta:
  class Effect (line 4859) | class Effect:
    class Meta (line 4866) | class Meta:
  class Elision (line 4885) | class Elision:
    class Meta (line 4897) | class Meta:
  class EmptyFont (line 4952) | class EmptyFont:
    class Meta (line 4956) | class Meta:
  class EmptyLine (line 4991) | class EmptyLine:
    class Meta (line 4996) | class Meta:
  class EmptyPlacement (line 5107) | class EmptyPlacement:
    class Meta (line 5112) | class Meta:
  class EmptyPlacementSmufl (line 5188) | class EmptyPlacementSmufl:
    class Meta (line 5193) | class Meta:
  class EmptyPrintObjectStyleAlign (line 5275) | class EmptyPrintObjectStyleAlign:
    class Meta (line 5280) | class Meta:
  class EmptyPrintStyle (line 5369) | class EmptyPrintStyle:
    class Meta (line 5374) | class Meta:
  class EmptyPrintStyleAlign (line 5444) | class EmptyPrintStyleAlign:
    class Meta (line 5449) | class Meta:
  class EmptyPrintStyleAlignId (line 5531) | class EmptyPrintStyleAlignId:
    class Meta (line 5536) | class Meta:
  class EmptyTrillSound (line 5624) | class EmptyTrillSound:
    class Meta (line 5629) | class Meta:
  class Ending (line 5757) | class Ending:
    class Meta (line 5781) | class Meta:
  class Extend (line 5906) | class Extend:
    class Meta (line 5913) | class Meta:
  class Fermata (line 5960) | class Fermata:
    class Meta (line 5966) | class Meta:
  class Fingering (line 6054) | class Fingering:
    class Meta (line 6063) | class Meta:
  class FirstFret (line 6157) | class FirstFret:
    class Meta (line 6165) | class Meta:
  class FormattedSymbol (line 6189) | class FormattedSymbol:
    class Meta (line 6194) | class Meta:
  class FormattedSymbolId (line 6347) | class FormattedSymbolId:
    class Meta (line 6352) | class Meta:
  class FormattedText (line 6511) | class FormattedText:
    class Meta (line 6516) | class Meta:
  class FormattedTextId (line 6683) | class FormattedTextId:
    class Meta (line 6688) | class Meta:
  class Fret (line 6861) | class Fret:
    class Meta (line 6867) | class Meta:
  class Glass (line 6915) | class Glass:
    class Meta (line 6922) | class Meta:
  class Glissando (line 6941) | class Glissando:
    class Meta (line 6949) | class Meta:
  class Grace (line 7067) | class Grace:
    class Meta (line 7078) | class Meta:
  class GroupBarline (line 7115) | class GroupBarline:
    class Meta (line 7119) | class Meta:
  class GroupName (line 7138) | class GroupName:
    class Meta (line 7146) | class Meta:
  class GroupSymbol (line 7228) | class GroupSymbol:
    class Meta (line 7234) | class Meta:
  class Grouping (line 7281) | class Grouping:
    class Meta (line 7295) | class Meta:
  class HammerOnPullOff (line 7333) | class HammerOnPullOff:
    class Meta (line 7343) | class Meta:
  class Handbell (line 7440) | class Handbell:
    class Meta (line 7445) | class Meta:
  class HarmonClosed (line 7527) | class HarmonClosed:
    class Meta (line 7534) | class Meta:
  class Harmonic (line 7552) | class Harmonic:
    class Meta (line 7586) | class Meta:
  class HarmonyAlter (line 7702) | class HarmonyAlter:
    class Meta (line 7713) | class Meta:
  class HoleClosed (line 7802) | class HoleClosed:
    class Meta (line 7809) | class Meta:
  class HorizontalTurn (line 7827) | class HorizontalTurn:
    class Meta (line 7835) | class Meta:
  class Image (line 7969) | class Image:
    class Meta (line 7973) | class Meta:
  class InstrumentChange (line 8051) | class InstrumentChange:
    class Meta (line 8073) | class Meta:
  class Interchangeable (line 8112) | class Interchangeable:
    class Meta (line 8128) | class Meta:
  class Inversion (line 8170) | class Inversion:
    class Meta (line 8177) | class Meta:
  class KeyAccidental (line 8259) | class KeyAccidental:
    class Meta (line 8265) | class Meta:
  class KeyOctave (line 8284) | class KeyOctave:
    class Meta (line 8297) | class Meta:
  class Kind (line 8324) | class Kind:
    class Meta (line 8339) | class Meta:
  class Level (line 8461) | class Level:
    class Meta (line 8476) | class Meta:
  class LineDetail (line 8518) | class LineDetail:
    class Meta (line 8531) | class Meta:
  class Link (line 8571) | class Link:
    class Meta (line 8578) | class Meta:
  class LyricFont (line 8674) | class LyricFont:
    class Meta (line 8679) | class Meta:
  class LyricLanguage (line 8726) | class LyricLanguage:
    class Meta (line 8731) | class Meta:
  class MeasureNumbering (line 8757) | class MeasureNumbering:
    class Meta (line 8778) | class Meta:
  class MeasureRepeat (line 8892) | class MeasureRepeat:
    class Meta (line 8908) | class Meta:
  class Membrane (line 8930) | class Membrane:
    class Meta (line 8937) | class Meta:
  class Metal (line 8956) | class Metal:
    class Meta (line 8962) | class Meta:
  class MetronomeBeam (line 8981) | class MetronomeBeam:
    class Meta (line 8987) | class Meta:
  class MetronomeTied (line 9007) | class MetronomeTied:
    class Meta (line 9014) | class Meta:
  class Miscellaneous (line 9027) | class Miscellaneous:
    class Meta (line 9034) | class Meta:
  class MultipleRest (line 9047) | class MultipleRest:
    class Meta (line 9055) | class Meta:
  class NonArpeggiate (line 9074) | class NonArpeggiate:
    class Meta (line 9081) | class Meta:
  class NoteSize (line 9149) | class NoteSize:
    class Meta (line 9160) | class Meta:
  class NoteType (line 9180) | class NoteType:
    class Meta (line 9189) | class Meta:
  class Notehead (line 9207) | class Notehead:
    class Meta (line 9224) | class Meta:
  class NumeralKey (line 9290) | class NumeralKey:
    class Meta (line 9298) | class Meta:
  class NumeralRoot (line 9327) | class NumeralRoot:
    class Meta (line 9337) | class Meta:
  class OctaveShift (line 9421) | class OctaveShift:
    class Meta (line 9429) | class Meta:
  class Offset (line 9540) | class Offset:
    class Meta (line 9555) | class Meta:
  class Opus (line 9573) | class Opus:
    class Meta (line 9578) | class Meta:
  class OtherDirection (line 9628) | class OtherDirection:
    class Meta (line 9638) | class Meta:
  class OtherNotation (line 9745) | class OtherNotation:
    class Meta (line 9757) | class Meta:
  class OtherPlacementText (line 9873) | class OtherPlacementText:
    class Meta (line 9881) | class Meta:
  class PageMargins (line 9969) | class PageMargins:
    class Meta (line 9977) | class Meta:
  class PartClef (line 10021) | class PartClef:
    class Meta (line 10040) | class Meta:
  class PartLink (line 10066) | class PartLink:
    class Meta (line 10089) | class Meta:
  class PartName (line 10153) | class PartName:
    class Meta (line 10161) | class Meta:
  class PartSymbol (line 10250) | class PartSymbol:
    class Meta (line 10263) | class Meta:
  class Pedal (line 10324) | class Pedal:
    class Meta (line 10330) | class Meta:
  class PedalTuning (line 10451) | class PedalTuning:
    class Meta (line 10460) | class Meta:
  class PerMinute (line 10482) | class PerMinute:
    class Meta (line 10491) | class Meta:
  class Pitch (line 10532) | class Pitch:
    class Meta (line 10537) | class Meta:
  class Pitched (line 10565) | class Pitched:
    class Meta (line 10573) | class Meta:
  class PlacementText (line 10592) | class PlacementText:
    class Meta (line 10597) | class Meta:
  class Play (line 10679) | class Play:
    class Meta (line 10696) | class Meta:
  class PrincipalVoice (line 10738) | class PrincipalVoice:
    class Meta (line 10749) | class Meta:
  class Release (line 10857) | class Release(Empty):
    class Meta (line 10866) | class Meta:
  class Repeat (line 10878) | class Repeat:
    class Meta (line 10888) | class Meta:
  class Rest (line 10920) | class Rest:
    class Meta (line 10928) | class Meta:
  class RootStep (line 10956) | class RootStep:
    class Meta (line 10963) | class Meta:
  class ScoreInstrument (line 11045) | class ScoreInstrument:
    class Meta (line 11081) | class Meta:
  class Segno (line 11135) | class Segno:
    class Meta (line 11141) | class Meta:
  class Slash (line 11236) | class Slash:
    class Meta (line 11259) | class Meta:
  class Slide (line 11307) | class Slide:
    class Meta (line 11314) | class Meta:
  class Slur (line 11463) | class Slur:
    class Meta (line 11471) | class Meta:
  class StaffDivide (line 11608) | class StaffDivide:
    class Meta (line 11613) | class Meta:
  class StaffTuning (line 11708) | class StaffTuning:
    class Meta (line 11724) | class Meta:
  class Stem (line 11762) | class Stem:
    class Meta (line 11772) | class Meta:
  class Stick (line 11819) | class Stick:
    class Meta (line 11827) | class Meta:
  class String (line 11868) | class String:
    class Meta (line 11875) | class Meta:
  class StringMute (line 11957) | class StringMute:
    class Meta (line 11961) | class Meta:
  class StyleText (line 12056) | class StyleText:
    class Meta (line 12061) | class Meta:
  class Supports (line 12137) | class Supports:
    class Meta (line 12149) | class Meta:
  class Swing (line 12181) | class Swing:
    class Meta (line 12204) | class Meta:
  class Sync (line 12242) | class Sync:
    class Meta (line 12253) | class Meta:
  class Tap (line 12286) | class Tap:
    class Meta (line 12296) | class Meta:
  class TextElementData (line 12384) | class TextElementData:
    class Meta (line 12392) | class Meta:
  class Tie (line 12493) | class Tie:
    class Meta (line 12500) | class Meta:
  class Tied (line 12521) | class Tied:
    class Meta (line 12542) | class Meta:
  class TimeModification (line 12679) | class TimeModification:
    class Meta (line 12703) | class Meta:
  class Tremolo (line 12739) | class Tremolo:
    class Meta (line 12761) | class Meta:
  class TupletDot (line 12857) | class TupletDot:
    class Meta (line 12861) | class Meta:
  class TupletNumber (line 12903) | class TupletNumber:
    class Meta (line 12908) | class Meta:
  class TupletType (line 12956) | class TupletType:
    class Meta (line 12961) | class Meta:
  class Unpitched (line 13009) | class Unpitched:
    class Meta (line 13019) | class Meta:
  class WavyLine (line 13041) | class WavyLine:
    class Meta (line 13048) | class Meta:
  class Wedge (line 13169) | class Wedge:
    class Meta (line 13183) | class Meta:
  class Wood (line 13278) | class Wood:
    class Meta (line 13284) | class Meta:
  class Appearance (line 13303) | class Appearance:
    class Meta (line 13311) | class Meta:
  class Backup (line 13350) | class Backup:
    class Meta (line 13370) | class Meta:
  class Barline (line 13396) | class Barline:
    class Meta (line 13403) | class Meta:
  class Bass (line 13498) | class Bass:
    class Meta (line 13522) | class Meta:
  class Bend (line 13556) | class Bend:
    class Meta (line 13597) | class Meta:
  class Credit (line 13732) | class Credit:
    class Meta (line 13757) | class Meta:
  class Degree (line 13819) | class Degree:
    class Meta (line 13830) | class Meta:
  class Encoding (line 13867) | class Encoding:
    class Meta (line 13875) | class Meta:
  class Figure (line 13914) | class Figure:
    class Meta (line 13937) | class Meta:
  class Forward (line 13980) | class Forward:
    class Meta (line 14003) | class Meta:
  class FrameNote (line 14041) | class FrameNote:
    class Meta (line 14047) | class Meta:
  class HarmonMute (line 14079) | class HarmonMute:
    class Meta (line 14084) | class Meta:
  class HarpPedals (line 14168) | class HarpPedals:
    class Meta (line 14176) | class Meta:
  class HeelToe (line 14272) | class HeelToe(EmptyPlacement):
    class Meta (line 14277) | class Meta:
  class Hole (line 14289) | class Hole:
    class Meta (line 14311) | class Meta:
  class Key (line 14409) | class Key:
    class Meta (line 14450) | class Meta:
  class Listen (line 14588) | class Listen:
    class Meta (line 14597) | class Meta:
  class Listening (line 14622) | class Listening:
    class Meta (line 14639) | class Meta:
  class Lyric (line 14666) | class Lyric:
    class Meta (line 14711) | class Meta:
  class MeasureStyle (line 14864) | class MeasureStyle:
    class Meta (line 14877) | class Meta:
  class MetronomeTuplet (line 14958) | class MetronomeTuplet(TimeModification):
    class Meta (line 14963) | class Meta:
  class Mordent (line 14989) | class Mordent(EmptyTrillSound):
    class Meta (line 14998) | class Meta:
  class NameDisplay (line 15022) | class NameDisplay:
    class Meta (line 15031) | class Meta:
  class NoteheadText (line 15060) | class NoteheadText:
    class Meta (line 15069) | class Meta:
  class Numeral (line 15091) | class Numeral:
    class Meta (line 15109) | class Meta:
  class PageLayout (line 15137) | class PageLayout:
    class Meta (line 15153) | class Meta:
  class PartTranspose (line 15181) | class PartTranspose:
    class Meta (line 15207) | class Meta:
  class Percussion (line 15239) | class Percussion:
    class Meta (line 15273) | class Meta:
  class Root (line 15435) | class Root:
    class Meta (line 15453) | class Meta:
  class Scordatura (line 15474) | class Scordatura:
    class Meta (line 15480) | class Meta:
  class Sound (line 15499) | class Sound:
    class Meta (line 15557) | class Meta:
  class StaffDetails (line 15726) | class StaffDetails:
    class Meta (line 15753) | class Meta:
  class StrongAccent (line 15827) | class StrongAccent(EmptyPlacement):
    class Meta (line 15833) | class Meta:
  class SystemDividers (line 15845) | class SystemDividers:
    class Meta (line 15859) | class Meta:
  class Time (line 15881) | class Time:
    class Meta (line 15923) | class Meta:
  class Transpose (line 16064) | class Transpose:
    class Meta (line 16094) | class Meta:
  class TupletPortion (line 16138) | class TupletPortion:
    class Meta (line 16147) | class Meta:
  class Work (line 16174) | class Work:
    class Meta (line 16186) | class Meta:
  class Articulations (line 16212) | class Articulations:
    class Meta (line 16261) | class Meta:
  class FiguredBass (line 16380) | class FiguredBass:
    class Meta (line 16419) | class Meta:
  class ForPart (line 16573) | class ForPart:
    class Meta (line 16594) | class Meta:
  class Frame (line 16627) | class Frame:
    class Meta (line 16655) | class Meta:
  class Identification (line 16763) | class Identification:
    class Meta (line 16795) | class Meta:
  class MetronomeNote (line 16837) | class MetronomeNote:
    class Meta (line 16850) | class Meta:
  class Ornaments (line 16892) | class Ornaments:
    class Meta (line 16943) | class Meta:
  class PartGroup (line 17077) | class PartGroup:
    class Meta (line 17112) | class Meta:
  class SystemLayout (line 17192) | class SystemLayout:
    class Meta (line 17219) | class Meta:
  class Technical (line 17253) | class Technical:
    class Meta (line 17334) | class Meta:
  class Tuplet (line 17545) | class Tuplet:
    class Meta (line 17590) | class Meta:
  class Attributes (line 17692) | class Attributes:
    class Meta (line 17754) | class Meta:
    class Directive (line 17848) | class Directive:
  class Defaults (line 17929) | class Defaults:
    class Meta (line 17955) | class Meta:
  class Harmony (line 18029) | class Harmony:
    class Meta (line 18083) | class Meta:
  class Metronome (line 18276) | class Metronome:
    class Meta (line 18323) | class Meta:
  class Notations (line 18480) | class Notations:
    class Meta (line 18488) | class Meta:
  class Print (line 18620) | class Print:
    class Meta (line 18632) | class Meta:
  class ScorePart (line 18728) | class ScorePart:
    class Meta (line 18755) | class Meta:
  class DirectionType (line 18845) | class DirectionType:
    class Meta (line 18893) | class Meta:
  class Note (line 19057) | class Note:
    class Meta (line 19148) | class Meta:
  class PartList (line 19467) | class PartList:
    class Meta (line 19486) | class Meta:
  class Direction (line 19508) | class Direction:
    class Meta (line 19538) | class Meta:
  class ScorePartwise (line 19618) | class ScorePartwise:
    class Meta (line 19638) | class Meta:
    class Part (line 19702) | class Part:
      class Measure (line 19719) | class Measure:
  class ScoreTimewise (line 19861) | class ScoreTimewise:
    class Meta (line 19881) | class Meta:
    class Measure (line 19945) | class Measure:
      class Part (line 19994) | class Part:

FILE: python/ScoreDraft/musicxml/xlink.py
  class ActuateValue (line 6) | class ActuateValue(Enum):
  class ShowValue (line 13) | class ShowValue(Enum):
  class TypeValue (line 21) | class TypeValue(Enum):

FILE: python/ScoreDraft/musicxml/xml.py
  class LangValue (line 6) | class LangValue(Enum):
  class SpaceValue (line 10) | class SpaceValue(Enum):

FILE: thirdparty/freetype/include/freetype2/freetype/config/integer-types.h
  type FT_Int16 (line 79) | typedef signed short  FT_Int16;
  type FT_UInt16 (line 90) | typedef unsigned short  FT_UInt16;
  type FT_Int32 (line 107) | typedef signed XXX  FT_Int32;
  type FT_UInt32 (line 118) | typedef unsigned XXX  FT_UInt32;
  type FT_Int64 (line 130) | typedef signed XXX  FT_Int64;
  type FT_UInt64 (line 142) | typedef unsigned XXX  FT_UInt64;
  type FT_Int32 (line 150) | typedef signed int      FT_Int32;
  type FT_UInt32 (line 151) | typedef unsigned int    FT_UInt32;
  type FT_Int32 (line 155) | typedef signed long     FT_Int32;
  type FT_UInt32 (line 156) | typedef unsigned long   FT_UInt32;
  type FT_Fast (line 166) | typedef int            FT_Fast;
  type FT_UFast (line 167) | typedef unsigned int   FT_UFast;
  type FT_Fast (line 171) | typedef long           FT_Fast;
  type FT_UFast (line 172) | typedef unsigned long  FT_UFast;
  type FT_INT64 (line 240) | typedef FT_INT64   FT_Int64;
  type FT_UINT64 (line 241) | typedef FT_UINT64  FT_UInt64;

FILE: thirdparty/freetype/include/freetype2/freetype/freetype.h
  type FT_Glyph_Metrics_ (line 329) | struct  FT_Glyph_Metrics_
  type FT_Bitmap_Size (line 384) | typedef struct  FT_Bitmap_Size_
  type FT_LibraryRec_ (line 428) | struct FT_LibraryRec_
  type FT_ModuleRec_ (line 448) | struct FT_ModuleRec_
  type FT_DriverRec_ (line 460) | struct FT_DriverRec_
  type FT_RendererRec_ (line 473) | struct FT_RendererRec_
  type FT_FaceRec_ (line 512) | struct FT_FaceRec_
  type FT_SizeRec_ (line 542) | struct FT_SizeRec_
  type FT_GlyphSlotRec_ (line 561) | struct FT_GlyphSlotRec_
  type FT_CharMapRec_ (line 595) | struct FT_CharMapRec_
  type FT_Encoding (line 769) | typedef enum  FT_Encoding_
  type FT_CharMapRec (line 846) | typedef struct  FT_CharMapRec_
  type FT_Face_InternalRec_ (line 877) | struct FT_Face_InternalRec_
  type FT_FaceRec (line 1057) | typedef struct  FT_FaceRec_
  type FT_Size_InternalRec_ (line 1517) | struct FT_Size_InternalRec_
  type FT_Size_Metrics (line 1624) | typedef struct  FT_Size_Metrics_
  type FT_SizeRec (line 1661) | typedef struct  FT_SizeRec_
  type FT_SubGlyphRec_ (line 1687) | struct FT_SubGlyphRec_
  type FT_Slot_InternalRec_ (line 1699) | struct FT_Slot_InternalRec_
  type FT_GlyphSlotRec (line 1900) | typedef struct  FT_GlyphSlotRec_
  type FT_Parameter (line 2068) | typedef struct  FT_Parameter_
  type FT_Open_Args (line 2142) | typedef struct  FT_Open_Args_
  type FT_Size_Request_Type (line 2586) | typedef enum  FT_Size_Request_Type_
  type FT_Size_RequestRec (line 2638) | typedef struct  FT_Size_RequestRec_
  type FT_Size_RequestRec_ (line 2657) | struct FT_Size_RequestRec_
  type FT_Render_Mode (line 3359) | typedef enum  FT_Render_Mode_
  type FT_Kerning_Mode (line 3518) | typedef enum  FT_Kerning_Mode_

FILE: thirdparty/freetype/include/freetype2/freetype/ftbdf.h
  type BDF_PropertyType_ (line 73) | enum  BDF_PropertyType_
  type BDF_PropertyRec_ (line 92) | struct BDF_PropertyRec_
  type BDF_PropertyRec (line 117) | typedef struct  BDF_PropertyRec_

FILE: thirdparty/freetype/include/freetype2/freetype/ftcache.h
  type FT_Error (line 209) | typedef FT_Error
  type FTC_ManagerRec_ (line 250) | struct FTC_ManagerRec_
  type FTC_NodeRec_ (line 270) | struct FTC_NodeRec_
  type FTC_ScalerRec (line 441) | typedef struct  FTC_ScalerRec_
  type FTC_ScalerRec_ (line 461) | struct FTC_ScalerRec_
  type FTC_CMapCacheRec_ (line 573) | struct FTC_CMapCacheRec_
  type FTC_ImageTypeRec (line 672) | typedef struct  FTC_ImageTypeRec_
  type FTC_ImageTypeRec_ (line 691) | struct FTC_ImageTypeRec_
  type FTC_ImageCacheRec_ (line 713) | struct FTC_ImageCacheRec_
  type FTC_SBitRec_ (line 861) | struct FTC_SBitRec_
  type FTC_SBitRec (line 906) | typedef struct  FTC_SBitRec_
  type FTC_SBitCacheRec_ (line 935) | struct FTC_SBitCacheRec_

FILE: thirdparty/freetype/include/freetype2/freetype/ftcolor.h
  type FT_Color_ (line 78) | struct  FT_Color_
  type FT_Palette_Data (line 171) | typedef struct  FT_Palette_Data_ {
  type FT_LayerIterator (line 343) | typedef struct  FT_LayerIterator_
  type FT_PaintFormat (line 496) | typedef enum  FT_PaintFormat_
  type FT_ColorStopIterator (line 545) | typedef struct  FT_ColorStopIterator_
  type FT_ColorIndex (line 576) | typedef struct  FT_ColorIndex_
  type FT_ColorStop (line 605) | typedef struct  FT_ColorStop_
  type FT_PaintExtend (line 628) | typedef enum  FT_PaintExtend_
  type FT_ColorLine (line 660) | typedef struct  FT_ColorLine_
  type FT_Affine23 (line 706) | typedef struct  FT_Affine_23_
  type FT_Composite_Mode (line 729) | typedef enum  FT_Composite_Mode_
  type FT_OpaquePaint (line 792) | typedef struct  FT_Opaque_Paint_
  type FT_PaintColrLayers (line 821) | typedef struct  FT_PaintColrLayers_
  type FT_PaintSolid (line 848) | typedef struct  FT_PaintSolid_
  type FT_PaintLinearGradient (line 886) | typedef struct  FT_PaintLinearGradient_
  type FT_PaintRadialGradient (line 935) | typedef struct  FT_PaintRadialGradient_
  type FT_PaintSweepGradient (line 982) | typedef struct  FT_PaintSweepGradient_
  type FT_PaintGlyph (line 1015) | typedef struct  FT_PaintGlyph_
  type FT_PaintColrGlyph (line 1041) | typedef struct  FT_PaintColrGlyph_
  type FT_PaintTransform (line 1068) | typedef struct  FT_PaintTransform_
  type FT_PaintTranslate (line 1101) | typedef struct  FT_PaintTranslate_
  type FT_PaintScale (line 1148) | typedef struct  FT_PaintScale_
  type FT_PaintRotate (line 1192) | typedef struct  FT_PaintRotate_
  type FT_PaintSkew (line 1236) | typedef struct  FT_PaintSkew_
  type FT_PaintComposite (line 1277) | typedef struct  FT_PaintComposite_
  type FT_COLR_Paint (line 1323) | typedef struct  FT_COLR_Paint_
  type FT_Color_Root_Transform (line 1370) | typedef enum  FT_Color_Root_Transform_

FILE: thirdparty/freetype/include/freetype2/freetype/ftdriver.h
  type FT_Prop_GlyphToScriptMap (line 1001) | typedef struct  FT_Prop_GlyphToScriptMap_
  type FT_Prop_IncreaseXHeight (line 1151) | typedef struct  FT_Prop_IncreaseXHeight_

FILE: thirdparty/freetype/include/freetype2/freetype/ftglyph.h
  type FT_Glyph_Class_ (line 69) | struct FT_Glyph_Class_
  type FT_GlyphRec_ (line 87) | struct FT_GlyphRec_
  type FT_GlyphRec (line 112) | typedef struct  FT_GlyphRec_
  type FT_BitmapGlyphRec_ (line 131) | struct FT_BitmapGlyphRec_
  type FT_BitmapGlyphRec (line 167) | typedef struct  FT_BitmapGlyphRec_
  type FT_OutlineGlyphRec_ (line 186) | struct FT_OutlineGlyphRec_
  type FT_OutlineGlyphRec (line 217) | typedef struct  FT_OutlineGlyphRec_
  type FT_Glyph_BBox_Mode (line 369) | typedef enum  FT_Glyph_BBox_Mode_

FILE: thirdparty/freetype/include/freetype2/freetype/ftimage.h
  type FT_Vector (line 75) | typedef struct  FT_Vector_
  type FT_BBox (line 118) | typedef struct  FT_BBox_
  type FT_Pixel_Mode (line 180) | typedef enum  FT_Pixel_Mode_
  type FT_Bitmap (line 265) | typedef struct  FT_Bitmap_
  type FT_Outline (line 341) | typedef struct  FT_Outline_
  type FT_Outline_Funcs (line 663) | typedef struct  FT_Outline_Funcs_
  type FT_Glyph_Format (line 748) | typedef enum  FT_Glyph_Format_
  type FT_Span (line 859) | typedef struct  FT_Span_
  type FT_Raster_Params (line 1043) | typedef struct  FT_Raster_Params_
  type FT_RasterRec_ (line 1072) | struct FT_RasterRec_
  type FT_Raster_Funcs (line 1251) | typedef struct  FT_Raster_Funcs_

FILE: thirdparty/freetype/include/freetype2/freetype/ftincrem.h
  type FT_IncrementalRec_ (line 85) | struct FT_IncrementalRec_
  type FT_Incremental_MetricsRec (line 116) | typedef struct  FT_Incremental_MetricsRec_
  type FT_Incremental_MetricsRec_ (line 135) | struct FT_Incremental_MetricsRec_
  type FT_Error (line 179) | typedef FT_Error
  type FT_Error (line 246) | typedef FT_Error
  type FT_Incremental_FuncsRec (line 275) | typedef struct  FT_Incremental_FuncsRec_
  type FT_Incremental_InterfaceRec (line 320) | typedef struct  FT_Incremental_InterfaceRec_
  type FT_Incremental_InterfaceRec (line 337) | typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;

FILE: thirdparty/freetype/include/freetype2/freetype/ftlcdfil.h
  type FT_LcdFilter_ (line 159) | enum  FT_LcdFilter_
  type FT_Byte (line 265) | typedef FT_Byte  FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS];

FILE: thirdparty/freetype/include/freetype2/freetype/ftmm.h
  type FT_MM_Axis_ (line 75) | struct  FT_MM_Axis_
  type FT_Multi_Master (line 107) | typedef struct  FT_Multi_Master_
  type FT_Var_Axis (line 155) | typedef struct  FT_Var_Axis_
  type FT_Var_Named_Style (line 192) | typedef struct  FT_Var_Named_Style_
  type FT_MM_Var (line 242) | typedef struct  FT_MM_Var_

FILE: thirdparty/freetype/include/freetype2/freetype/ftmodapi.h
  type FT_Pointer (line 139) | typedef FT_Pointer  FT_Module_Interface;
  type FT_Error (line 154) | typedef FT_Error
  type FT_Module_Interface (line 189) | typedef FT_Module_Interface
  type FT_Module_Class (line 235) | typedef struct  FT_Module_Class_
  type FT_Error (line 647) | typedef FT_Error
  type FT_TrueTypeEngineType (line 766) | typedef enum  FT_TrueTypeEngineType_

FILE: thirdparty/freetype/include/freetype2/freetype/ftoutln.h
  function FT_BEGIN_HEADER (line 33) | FT_BEGIN_HEADER

FILE: thirdparty/freetype/include/freetype2/freetype/ftrender.h
  type FT_Error (line 56) | typedef FT_Error
  type FT_Error (line 60) | typedef FT_Error
  type FT_Glyph_Class_ (line 73) | struct  FT_Glyph_Class_
  type FT_Error (line 87) | typedef FT_Error
  type FT_Error (line 93) | typedef FT_Error
  type FT_Error (line 106) | typedef FT_Error
  type FT_Renderer_Class (line 150) | typedef struct  FT_Renderer_Class_

FILE: thirdparty/freetype/include/freetype2/freetype/ftsnames.h
  type FT_SfntName_ (line 107) | struct  FT_SfntName_
  type FT_SfntLangTag (line 209) | typedef struct  FT_SfntLangTag_

FILE: thirdparty/freetype/include/freetype2/freetype/ftstroke.h
  type FT_StrokerRec_ (line 91) | struct FT_StrokerRec_
  type FT_Stroker_LineJoin (line 134) | typedef enum  FT_Stroker_LineJoin_
  type FT_Stroker_LineCap (line 165) | typedef enum  FT_Stroker_LineCap_
  type FT_StrokerBorder (line 199) | typedef enum  FT_StrokerBorder_

FILE: thirdparty/freetype/include/freetype2/freetype/ftsystem.h
  type FT_MemoryRec_ (line 64) | struct FT_MemoryRec_
  type FT_MemoryRec_ (line 169) | struct  FT_MemoryRec_
  type FT_StreamRec_ (line 198) | struct FT_StreamRec_
  type FT_StreamDesc (line 211) | typedef union  FT_StreamDesc_
  type FT_StreamRec (line 327) | typedef struct  FT_StreamRec_

FILE: thirdparty/freetype/include/freetype2/freetype/fttypes.h
  type FT_FWord (line 120) | typedef signed short  FT_FWord;
  type FT_UFWord (line 132) | typedef unsigned short  FT_UFWord;
  type FT_Char (line 143) | typedef signed char  FT_Char;
  type FT_Byte (line 154) | typedef unsigned char  FT_Byte;
  type FT_Byte (line 165) | typedef const FT_Byte*  FT_Bytes;
  type FT_UInt32 (line 176) | typedef FT_UInt32  FT_Tag;
  type FT_String (line 187) | typedef char  FT_String;
  type FT_Short (line 198) | typedef signed short  FT_Short;
  type FT_UShort (line 209) | typedef unsigned short  FT_UShort;
  type FT_Int (line 220) | typedef signed int  FT_Int;
  type FT_UInt (line 231) | typedef unsigned int  FT_UInt;
  type FT_Long (line 242) | typedef signed long  FT_Long;
  type FT_ULong (line 253) | typedef unsigned long  FT_ULong;
  type FT_F2Dot14 (line 264) | typedef signed short  FT_F2Dot14;
  type FT_F26Dot6 (line 275) | typedef signed long  FT_F26Dot6;
  type FT_Fixed (line 287) | typedef signed long  FT_Fixed;
  type FT_Error (line 299) | typedef int  FT_Error;
  type FT_Offset (line 323) | typedef size_t  FT_Offset;
  type ft_ptrdiff_t (line 336) | typedef ft_ptrdiff_t  FT_PtrDist;
  type FT_UnitVector (line 355) | typedef struct  FT_UnitVector_
  type FT_Matrix (line 390) | typedef struct  FT_Matrix_
  type FT_Data (line 413) | typedef struct  FT_Data_
  type FT_Generic (line 467) | typedef struct  FT_Generic_
  type FT_ListNodeRec_ (line 523) | struct FT_ListNodeRec_
  type FT_ListRec_ (line 534) | struct FT_ListRec_
  type FT_ListNodeRec (line 555) | typedef struct  FT_ListNodeRec_
  type FT_ListRec (line 580) | typedef struct  FT_ListRec_

FILE: thirdparty/freetype/include/freetype2/freetype/ftwinfnt.h
  type FT_WinFNT_HeaderRec (line 183) | typedef struct  FT_WinFNT_HeaderRec_
  type FT_WinFNT_HeaderRec_ (line 233) | struct FT_WinFNT_HeaderRec_

FILE: thirdparty/freetype/include/freetype2/freetype/t1tables.h
  type PS_FontInfoRec_ (line 88) | struct  PS_FontInfoRec_
  type PS_FontInfoRec_ (line 111) | struct PS_FontInfoRec_
  type PS_FontInfoRec (line 123) | typedef PS_FontInfoRec  T1_FontInfo;
  type PS_PrivateRec (line 136) | typedef struct  PS_PrivateRec_
  type PS_PrivateRec_ (line 185) | struct PS_PrivateRec_
  type PS_PrivateRec (line 197) | typedef PS_PrivateRec  T1_Private;
  type T1_Blend_Flags (line 226) | typedef enum  T1_Blend_Flags_
  type PS_DesignMapRec (line 283) | typedef struct  PS_DesignMap_
  type PS_DesignMapRec (line 292) | typedef PS_DesignMapRec  T1_DesignMap;
  type PS_BlendRec (line 295) | typedef struct  PS_BlendRec_
  type PS_BlendRec (line 327) | typedef PS_BlendRec  T1_Blend;
  type CID_FaceDictRec (line 347) | typedef struct  CID_FaceDictRec_
  type CID_FaceDictRec_ (line 376) | struct CID_FaceDictRec_
  type CID_FaceDictRec (line 389) | typedef CID_FaceDictRec  CID_FontDict;
  type CID_FaceInfoRec (line 400) | typedef struct  CID_FaceInfoRec_
  type CID_FaceInfoRec_ (line 438) | struct CID_FaceInfoRec_
  type CID_FaceInfoRec (line 450) | typedef CID_FaceInfoRec  CID_Info;
  type T1_EncodingType (line 563) | typedef enum  T1_EncodingType_
  type PS_Dict_Keys (line 634) | typedef enum  PS_Dict_Keys_

FILE: thirdparty/freetype/include/freetype2/freetype/tttables.h
  type TT_Header_ (line 84) | struct  TT_Header_
  type TT_HoriHeader (line 200) | typedef struct  TT_HoriHeader_
  type TT_VertHeader (line 318) | typedef struct  TT_VertHeader_
  type TT_OS2 (line 375) | typedef struct  TT_OS2_
  type TT_Postscript (line 450) | typedef struct  TT_Postscript_
  type TT_PCLT (line 477) | typedef struct  TT_PCLT_
  type TT_MaxProfile (line 567) | typedef struct  TT_MaxProfile_
  type FT_Sfnt_Tag (line 620) | typedef enum  FT_Sfnt_Tag_

FILE: thirdparty/glfw/deps/getopt.c
  function getopt (line 52) | int getopt(int argc, char* const argv[], const char* optstring) {
  function getopt_long (line 158) | int getopt_long(int argc, char* const argv[], const char* optstring,

FILE: thirdparty/glfw/deps/getopt.h
  type option (line 41) | struct option {
  type option (line 51) | struct option

FILE: thirdparty/glfw/deps/glad/gl.h
  type GLADapiproc (line 147) | typedef GLADapiproc (*GLADloadfunc)(const char *name);
  type GLADapiproc (line 148) | typedef GLADapiproc (*GLADuserptrloadfunc)(const char *name, void *userp...
  type GLenum (line 1462) | typedef unsigned int GLenum;
  type GLboolean (line 1463) | typedef unsigned char GLboolean;
  type GLbitfield (line 1464) | typedef unsigned int GLbitfield;
  type GLvoid (line 1465) | typedef void GLvoid;
  type khronos_int8_t (line 1466) | typedef khronos_int8_t GLbyte;
  type khronos_uint8_t (line 1467) | typedef khronos_uint8_t GLubyte;
  type khronos_int16_t (line 1468) | typedef khronos_int16_t GLshort;
  type khronos_uint16_t (line 1469) | typedef khronos_uint16_t GLushort;
  type GLint (line 1470) | typedef int GLint;
  type GLuint (line 1471) | typedef unsigned int GLuint;
  type khronos_int32_t (line 1472) | typedef khronos_int32_t GLclampx;
  type GLsizei (line 1473) | typedef int GLsizei;
  type khronos_float_t (line 1474) | typedef khronos_float_t GLfloat;
  type khronos_float_t (line 1475) | typedef khronos_float_t GLclampf;
  type GLdouble (line 1476) | typedef double GLdouble;
  type GLclampd (line 1477) | typedef double GLclampd;
  type GLchar (line 1480) | typedef char GLchar;
  type GLcharARB (line 1481) | typedef char GLcharARB;
  type GLhandleARB (line 1485) | typedef unsigned int GLhandleARB;
  type khronos_uint16_t (line 1487) | typedef khronos_uint16_t GLhalf;
  type khronos_uint16_t (line 1488) | typedef khronos_uint16_t GLhalfARB;
  type khronos_int32_t (line 1489) | typedef khronos_int32_t GLfixed;
  type khronos_intptr_t (line 1491) | typedef khronos_intptr_t GLintptr;
  type khronos_intptr_t (line 1493) | typedef khronos_intptr_t GLintptr;
  type khronos_intptr_t (line 1496) | typedef khronos_intptr_t GLintptrARB;
  type khronos_intptr_t (line 1498) | typedef khronos_intptr_t GLintptrARB;
  type khronos_ssize_t (line 1501) | typedef khronos_ssize_t GLsizeiptr;
  type khronos_ssize_t (line 1503) | typedef khronos_ssize_t GLsizeiptr;
  type khronos_ssize_t (line 1506) | typedef khronos_ssize_t GLsizeiptrARB;
  type khronos_ssize_t (line 1508) | typedef khronos_ssize_t GLsizeiptrARB;
  type khronos_int64_t (line 1510) | typedef khronos_int64_t GLint64;
  type khronos_int64_t (line 1511) | typedef khronos_int64_t GLint64EXT;
  type khronos_uint64_t (line 1512) | typedef khronos_uint64_t GLuint64;
  type khronos_uint64_t (line 1513) | typedef khronos_uint64_t GLuint64EXT;
  type __GLsync (line 1514) | struct __GLsync
  type _cl_context (line 1515) | struct _cl_context
  type _cl_event (line 1516) | struct _cl_event
  type GLhalfNV (line 1521) | typedef unsigned short GLhalfNV;
  type GLintptr (line 1522) | typedef GLintptr GLvdpauSurfaceNV;
  type GLuint (line 1561) | typedef GLboolean (GLAD_API_PTR *PFNGLARETEXTURESRESIDENTPROC)(GLsizei  ...
  type GLubyte (line 1808) | typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGPROC)(GLenum   name);
  type GLubyte (line 1809) | typedef const GLubyte * (GLAD_API_PTR *PFNGLGETSTRINGIPROC)(GLenum   nam...

FILE: thirdparty/glfw/deps/glad/khrplatform.h
  type khronos_int32_t (line 142) | typedef int32_t                 khronos_int32_t;
  type khronos_uint32_t (line 143) | typedef uint32_t                khronos_uint32_t;
  type khronos_int64_t (line 144) | typedef int64_t                 khronos_int64_t;
  type khronos_uint64_t (line 145) | typedef uint64_t                khronos_uint64_t;
  type khronos_int32_t (line 155) | typedef int32_t                 khronos_int32_t;
  type khronos_uint32_t (line 156) | typedef uint32_t                khronos_uint32_t;
  type khronos_int64_t (line 157) | typedef int64_t                 khronos_int64_t;
  type khronos_uint64_t (line 158) | typedef uint64_t                khronos_uint64_t;
  type __int32 (line 167) | typedef __int32                 khronos_int32_t;
  type khronos_uint32_t (line 168) | typedef unsigned __int32        khronos_uint32_t;
  type __int64 (line 169) | typedef __int64                 khronos_int64_t;
  type khronos_uint64_t (line 170) | typedef unsigned __int64        khronos_uint64_t;
  type khronos_int32_t (line 179) | typedef int                     khronos_int32_t;
  type khronos_uint32_t (line 180) | typedef unsigned int            khronos_uint32_t;
  type khronos_int64_t (line 182) | typedef long int                khronos_int64_t;
  type khronos_uint64_t (line 183) | typedef unsigned long int       khronos_uint64_t;
  type khronos_int64_t (line 185) | typedef long long int           khronos_int64_t;
  type khronos_uint64_t (line 186) | typedef unsigned long long int  khronos_uint64_t;
  type khronos_int32_t (line 196) | typedef int                     khronos_int32_t;
  type khronos_uint32_t (line 197) | typedef unsigned int            khronos_uint32_t;
  type khronos_int32_t (line 207) | typedef int32_t                 khronos_int32_t;
  type khronos_uint32_t (line 208) | typedef uint32_t                khronos_uint32_t;
  type khronos_int64_t (line 209) | typedef int64_t                 khronos_int64_t;
  type khronos_uint64_t (line 210) | typedef uint64_t                khronos_uint64_t;
  type khronos_int8_t (line 220) | typedef signed   char          khronos_int8_t;
  type khronos_uint8_t (line 221) | typedef unsigned char          khronos_uint8_t;
  type khronos_int16_t (line 222) | typedef signed   short int     khronos_int16_t;
  type khronos_uint16_t (line 223) | typedef unsigned short int     khronos_uint16_t;
  type khronos_intptr_t (line 231) | typedef signed   long long int khronos_intptr_t;
  type khronos_uintptr_t (line 232) | typedef unsigned long long int khronos_uintptr_t;
  type khronos_ssize_t (line 233) | typedef signed   long long int khronos_ssize_t;
  type khronos_usize_t (line 234) | typedef unsigned long long int khronos_usize_t;
  type khronos_intptr_t (line 236) | typedef signed   long  int     khronos_intptr_t;
  type khronos_uintptr_t (line 237) | typedef unsigned long  int     khronos_uintptr_t;
  type khronos_ssize_t (line 238) | typedef signed   long  int     khronos_ssize_t;
  type khronos_usize_t (line 239) | typedef unsigned long  int     khronos_usize_t;
  type khronos_float_t (line 246) | typedef          float         khronos_float_t;
  type khronos_uint64_t (line 259) | typedef khronos_uint64_t       khronos_utime_nanoseconds_t;
  type khronos_int64_t (line 260) | typedef khronos_int64_t        khronos_stime_nanoseconds_t;
  type khronos_boolean_enum_t (line 276) | typedef enum {

FILE: thirdparty/glfw/deps/glad/vulkan.h
  type GLADapiproc (line 152) | typedef GLADapiproc (*GLADloadfunc)(const char *name);
  type GLADapiproc (line 153) | typedef GLADapiproc (*GLADuserptrloadfunc)(const char *name, void *userp...
  function VK_DEFINE_HANDLE (line 217) | VK_DEFINE_HANDLE(VkInstance)
  type VkAttachmentStoreOp (line 252) | typedef enum VkAttachmentStoreOp {
  type VkBlendFactor (line 256) | typedef enum VkBlendFactor {
  type VkBlendOp (line 277) | typedef enum VkBlendOp {
  type VkBorderColor (line 284) | typedef enum VkBorderColor {
  type VkPipelineCacheHeaderVersion (line 293) | typedef enum VkPipelineCacheHeaderVersion {
  type VkDeviceQueueCreateFlagBits (line 297) | typedef enum VkDeviceQueueCreateFlagBits {
  type VkBufferCreateFlagBits (line 300) | typedef enum VkBufferCreateFlagBits {
  type VkBufferUsageFlagBits (line 306) | typedef enum VkBufferUsageFlagBits {
  type VkColorComponentFlagBits (line 317) | typedef enum VkColorComponentFlagBits {
  type VkComponentSwizzle (line 323) | typedef enum VkComponentSwizzle {
  type VkCommandPoolCreateFlagBits (line 332) | typedef enum VkCommandPoolCreateFlagBits {
  type VkCommandPoolResetFlagBits (line 337) | typedef enum VkCommandPoolResetFlagBits {
  type VkCommandBufferResetFlagBits (line 340) | typedef enum VkCommandBufferResetFlagBits {
  type VkCommandBufferLevel (line 343) | typedef enum VkCommandBufferLevel {
  type VkCommandBufferUsageFlagBits (line 347) | typedef enum VkCommandBufferUsageFlagBits {
  type VkCompareOp (line 352) | typedef enum VkCompareOp {
  type VkCullModeFlagBits (line 362) | typedef enum VkCullModeFlagBits {
  type VkDescriptorType (line 368) | typedef enum VkDescriptorType {
  type VkDynamicState (line 381) | typedef enum VkDynamicState {
  type VkFenceCreateFlagBits (line 393) | typedef enum VkFenceCreateFlagBits {
  type VkPolygonMode (line 396) | typedef enum VkPolygonMode {
  type VkFormat (line 401) | typedef enum VkFormat {
  type VkFormatFeatureFlagBits (line 622) | typedef enum VkFormatFeatureFlagBits {
  type VkFrontFace (line 646) | typedef enum VkFrontFace {
  type VkImageAspectFlagBits (line 650) | typedef enum VkImageAspectFlagBits {
  type VkImageCreateFlagBits (line 659) | typedef enum VkImageCreateFlagBits {
  type VkImageLayout (line 673) | typedef enum VkImageLayout {
  type VkImageTiling (line 687) | typedef enum VkImageTiling {
  type VkImageType (line 691) | typedef enum VkImageType {
  type VkImageUsageFlagBits (line 696) | typedef enum VkImageUsageFlagBits {
  type VkImageViewType (line 707) | typedef enum VkImageViewType {
  type VkSharingMode (line 716) | typedef enum VkSharingMode {
  type VkIndexType (line 720) | typedef enum VkIndexType {
  type VkLogicOp (line 724) | typedef enum VkLogicOp {
  type VkMemoryHeapFlagBits (line 742) | typedef enum VkMemoryHeapFlagBits {
  type VkAccessFlagBits (line 746) | typedef enum VkAccessFlagBits {
  type VkMemoryPropertyFlagBits (line 765) | typedef enum VkMemoryPropertyFlagBits {
  type VkPhysicalDeviceType (line 773) | typedef enum VkPhysicalDeviceType {
  type VkPipelineBindPoint (line 780) | typedef enum VkPipelineBindPoint {
  type VkPipelineCreateFlagBits (line 784) | typedef enum VkPipelineCreateFlagBits {
  type VkPrimitiveTopology (line 791) | typedef enum VkPrimitiveTopology {
  type VkQueryControlFlagBits (line 804) | typedef enum VkQueryControlFlagBits {
  type VkQueryPipelineStatisticFlagBits (line 807) | typedef enum VkQueryPipelineStatisticFlagBits {
  type VkQueryResultFlagBits (line 820) | typedef enum VkQueryResultFlagBits {
  type VkQueryType (line 826) | typedef enum VkQueryType {
  type VkQueueFlagBits (line 831) | typedef enum VkQueueFlagBits {
  type VkSubpassContents (line 838) | typedef enum VkSubpassContents {
  type VkResult (line 842) | typedef enum VkResult {
  type VkShaderStageFlagBits (line 869) | typedef enum VkShaderStageFlagBits {
  type VkSparseMemoryBindFlagBits (line 879) | typedef enum VkSparseMemoryBindFlagBits {
  type VkStencilFaceFlagBits (line 882) | typedef enum VkStencilFaceFlagBits {
  type VkStencilOp (line 887) | typedef enum VkStencilOp {
  type VkStructureType (line 897) | typedef enum VkStructureType {
  type VkSystemAllocationScope (line 1025) | typedef enum VkSystemAllocationScope {
  type VkInternalAllocationType (line 1032) | typedef enum VkInternalAllocationType {
  type VkSamplerAddressMode (line 1035) | typedef enum VkSamplerAddressMode {
  type VkFilter (line 1041) | typedef enum VkFilter {
  type VkSamplerMipmapMode (line 1045) | typedef enum VkSamplerMipmapMode {
  type VkVertexInputRate (line 1049) | typedef enum VkVertexInputRate {
  type VkPipelineStageFlagBits (line 1053) | typedef enum VkPipelineStageFlagBits {
  type VkSparseImageFormatFlagBits (line 1072) | typedef enum VkSparseImageFormatFlagBits {
  type VkSampleCountFlagBits (line 1077) | typedef enum VkSampleCountFlagBits {
  type VkAttachmentDescriptionFlagBits (line 1086) | typedef enum VkAttachmentDescriptionFlagBits {
  type VkDescriptorPoolCreateFlagBits (line 1089) | typedef enum VkDescriptorPoolCreateFlagBits {
  type VkDependencyFlagBits (line 1092) | typedef enum VkDependencyFlagBits {
  type VkObjectType (line 1097) | typedef enum VkObjectType {
  type VkDescriptorUpdateTemplateType (line 1130) | typedef enum VkDescriptorUpdateTemplateType {
  type VkPointClippingBehavior (line 1134) | typedef enum VkPointClippingBehavior {
  type VkColorSpaceKHR (line 1138) | typedef enum VkColorSpaceKHR {
  type VkCompositeAlphaFlagBitsKHR (line 1142) | typedef enum VkCompositeAlphaFlagBitsKHR {
  type VkPresentModeKHR (line 1148) | typedef enum VkPresentModeKHR {
  type VkSurfaceTransformFlagBitsKHR (line 1154) | typedef enum VkSurfaceTransformFlagBitsKHR {
  type VkDebugReportFlagBitsEXT (line 1165) | typedef enum VkDebugReportFlagBitsEXT {
  type VkDebugReportObjectTypeEXT (line 1172) | typedef enum VkDebugReportObjectTypeEXT {
  type VkExternalMemoryHandleTypeFlagBits (line 1212) | typedef enum VkExternalMemoryHandleTypeFlagBits {
  type VkExternalMemoryFeatureFlagBits (line 1221) | typedef enum VkExternalMemoryFeatureFlagBits {
  type VkExternalSemaphoreHandleTypeFlagBits (line 1226) | typedef enum VkExternalSemaphoreHandleTypeFlagBits {
  type VkExternalSemaphoreFeatureFlagBits (line 1233) | typedef enum VkExternalSemaphoreFeatureFlagBits {
  type VkSemaphoreImportFlagBits (line 1237) | typedef enum VkSemaphoreImportFlagBits {
  type VkExternalFenceHandleTypeFlagBits (line 1240) | typedef enum VkExternalFenceHandleTypeFlagBits {
  type VkExternalFenceFeatureFlagBits (line 1246) | typedef enum VkExternalFenceFeatureFlagBits {
  type VkFenceImportFlagBits (line 1250) | typedef enum VkFenceImportFlagBits {
  type VkPeerMemoryFeatureFlagBits (line 1253) | typedef enum VkPeerMemoryFeatureFlagBits {
  type VkMemoryAllocateFlagBits (line 1259) | typedef enum VkMemoryAllocateFlagBits {
  type VkDeviceGroupPresentModeFlagBitsKHR (line 1262) | typedef enum VkDeviceGroupPresentModeFlagBitsKHR {
  type VkSwapchainCreateFlagBitsKHR (line 1268) | typedef enum VkSwapchainCreateFlagBitsKHR {
  type VkSubgroupFeatureFlagBits (line 1272) | typedef enum VkSubgroupFeatureFlagBits {
  type VkTessellationDomainOrigin (line 1282) | typedef enum VkTessellationDomainOrigin {
  type VkSamplerYcbcrModelConversion (line 1286) | typedef enum VkSamplerYcbcrModelConversion {
  type VkSamplerYcbcrRange (line 1293) | typedef enum VkSamplerYcbcrRange {
  type VkChromaLocation (line 1297) | typedef enum VkChromaLocation {
  type VkVendorId (line 1301) | typedef enum VkVendorId {
  type VkBaseOutStructure (line 1331) | typedef struct VkBaseOutStructure {
  type VkBaseInStructure (line 1335) | typedef struct VkBaseInStructure {
  type VkOffset2D (line 1339) | typedef struct VkOffset2D {
  type VkOffset3D (line 1343) | typedef struct VkOffset3D {
  type VkExtent2D (line 1348) | typedef struct VkExtent2D {
  type VkExtent3D (line 1352) | typedef struct VkExtent3D {
  type VkViewport (line 1357) | typedef struct VkViewport {
  type VkRect2D (line 1365) | typedef struct VkRect2D {
  type VkClearRect (line 1369) | typedef struct VkClearRect {
  type VkComponentMapping (line 1374) | typedef struct VkComponentMapping {
  type VkExtensionProperties (line 1380) | typedef struct VkExtensionProperties {
  type VkLayerProperties (line 1384) | typedef struct VkLayerProperties {
  type VkApplicationInfo (line 1390) | typedef struct VkApplicationInfo {
  type VkAllocationCallbacks (line 1399) | typedef struct VkAllocationCallbacks {
  type VkDescriptorImageInfo (line 1407) | typedef struct VkDescriptorImageInfo {
  type VkCopyDescriptorSet (line 1412) | typedef struct VkCopyDescriptorSet {
  type VkDescriptorPoolSize (line 1423) | typedef struct VkDescriptorPoolSize {
  type VkDescriptorSetAllocateInfo (line 1427) | typedef struct VkDescriptorSetAllocateInfo {
  type VkSpecializationMapEntry (line 1434) | typedef struct VkSpecializationMapEntry {
  type VkSpecializationInfo (line 1439) | typedef struct VkSpecializationInfo {
  type VkVertexInputBindingDescription (line 1445) | typedef struct VkVertexInputBindingDescription {
  type VkVertexInputAttributeDescription (line 1450) | typedef struct VkVertexInputAttributeDescription {
  type VkStencilOpState (line 1456) | typedef struct VkStencilOpState {
  type VkCommandBufferAllocateInfo (line 1465) | typedef struct VkCommandBufferAllocateInfo {
  type VkClearColorValue (line 1472) | typedef union VkClearColorValue {
  type VkClearDepthStencilValue (line 1477) | typedef struct VkClearDepthStencilValue {
  type VkClearValue (line 1481) | typedef union VkClearValue {
  type VkAttachmentReference (line 1485) | typedef struct VkAttachmentReference {
  type VkDrawIndirectCommand (line 1489) | typedef struct VkDrawIndirectCommand {
  type VkDrawIndexedIndirectCommand (line 1495) | typedef struct VkDrawIndexedIndirectCommand {
  type VkDispatchIndirectCommand (line 1502) | typedef struct VkDispatchIndirectCommand {
  type VkSurfaceFormatKHR (line 1507) | typedef struct VkSurfaceFormatKHR {
  type VkPresentInfoKHR (line 1511) | typedef struct VkPresentInfoKHR {
  type VkPhysicalDeviceExternalImageFormatInfo (line 1521) | typedef struct VkPhysicalDeviceExternalImageFormatInfo {
  type VkPhysicalDeviceExternalSemaphoreInfo (line 1526) | typedef struct VkPhysicalDeviceExternalSemaphoreInfo {
  type VkPhysicalDeviceExternalFenceInfo (line 1531) | typedef struct VkPhysicalDeviceExternalFenceInfo {
  type VkPhysicalDeviceMultiviewProperties (line 1536) | typedef struct VkPhysicalDeviceMultiviewProperties {
  type VkRenderPassMultiviewCreateInfo (line 1542) | typedef struct VkRenderPassMultiviewCreateInfo {
  type VkBindBufferMemoryDeviceGroupInfo (line 1552) | typedef struct VkBindBufferMemoryDeviceGroupInfo {
  type VkBindImageMemoryDeviceGroupInfo (line 1558) | typedef struct VkBindImageMemoryDeviceGroupInfo {
  type VkDeviceGroupRenderPassBeginInfo (line 1566) | typedef struct VkDeviceGroupRenderPassBeginInfo {
  type VkDeviceGroupCommandBufferBeginInfo (line 1573) | typedef struct VkDeviceGroupCommandBufferBeginInfo {
  type VkDeviceGroupSubmitInfo (line 1578) | typedef struct VkDeviceGroupSubmitInfo {
  type VkDeviceGroupBindSparseInfo (line 1588) | typedef struct VkDeviceGroupBindSparseInfo {
  type VkImageSwapchainCreateInfoKHR (line 1594) | typedef struct VkImageSwapchainCreateInfoKHR {
  type VkBindImageMemorySwapchainInfoKHR (line 1599) | typedef struct VkBindImageMemorySwapchainInfoKHR {
  type VkAcquireNextImageInfoKHR (line 1605) | typedef struct VkAcquireNextImageInfoKHR {
  type VkDeviceGroupPresentInfoKHR (line 1614) | typedef struct VkDeviceGroupPresentInfoKHR {
  type VkDeviceGroupDeviceCreateInfo (line 1621) | typedef struct VkDeviceGroupDeviceCreateInfo {
  type VkDescriptorUpdateTemplateEntry (line 1627) | typedef struct VkDescriptorUpdateTemplateEntry {
  type VkBufferMemoryRequirementsInfo2 (line 1635) | typedef struct VkBufferMemoryRequirementsInfo2 {
  type VkImageMemoryRequirementsInfo2 (line 1640) | typedef struct VkImageMemoryRequirementsInfo2 {
  type VkImageSparseMemoryRequirementsInfo2 (line 1645) | typedef struct VkImageSparseMemoryRequirementsInfo2 {
  type VkPhysicalDevicePointClippingProperties (line 1650) | typedef struct VkPhysicalDevicePointClippingProperties {
  type VkMemoryDedicatedAllocateInfo (line 1655) | typedef struct VkMemoryDedicatedAllocateInfo {
  type VkPipelineTessellationDomainOriginStateCreateInfo (line 1661) | typedef struct VkPipelineTessellationDomainOriginStateCreateInfo {
  type VkSamplerYcbcrConversionInfo (line 1666) | typedef struct VkSamplerYcbcrConversionInfo {
  type VkBindImagePlaneMemoryInfo (line 1671) | typedef struct VkBindImagePlaneMemoryInfo {
  type VkImagePlaneMemoryRequirementsInfo (line 1676) | typedef struct VkImagePlaneMemoryRequirementsInfo {
  type VkSamplerYcbcrConversionImageFormatProperties (line 1681) | typedef struct VkSamplerYcbcrConversionImageFormatProperties {
  type VkSampleMask (line 1686) | typedef uint32_t VkSampleMask;
  type VkBool32 (line 1687) | typedef uint32_t VkBool32;
  type VkFlags (line 1688) | typedef uint32_t VkFlags;
  type VkDeviceSize (line 1689) | typedef uint64_t VkDeviceSize;
  type VkFlags (line 1690) | typedef VkFlags VkFramebufferCreateFlags;
  type VkFlags (line 1691) | typedef VkFlags VkQueryPoolCreateFlags;
  type VkFlags (line 1692) | typedef VkFlags VkRenderPassCreateFlags;
  type VkFlags (line 1693) | typedef VkFlags VkSamplerCreateFlags;
  type VkFlags (line 1694) | typedef VkFlags VkPipelineLayoutCreateFlags;
  type VkFlags (line 1695) | typedef VkFlags VkPipelineCacheCreateFlags;
  type VkFlags (line 1696) | typedef VkFlags VkPipelineDepthStencilStateCreateFlags;
  type VkFlags (line 1697) | typedef VkFlags VkPipelineDynamicStateCreateFlags;
  type VkFlags (line 1698) | typedef VkFlags VkPipelineColorBlendStateCreateFlags;
  type VkFlags (line 1699) | typedef VkFlags VkPipelineMultisampleStateCreateFlags;
  type VkFlags (line 1700) | typedef VkFlags VkPipelineRasterizationStateCreateFlags;
  type VkFlags (line 1701) | typedef VkFlags VkPipelineViewportStateCreateFlags;
  type VkFlags (line 1702) | typedef VkFlags VkPipelineTessellationStateCreateFlags;
  type VkFlags (line 1703) | typedef VkFlags VkPipelineInputAssemblyStateCreateFlags;
  type VkFlags (line 1704) | typedef VkFlags VkPipelineVertexInputStateCreateFlags;
  type VkFlags (line 1705) | typedef VkFlags VkPipelineShaderStageCreateFlags;
  type VkFlags (line 1706) | typedef VkFlags VkDescriptorSetLayoutCreateFlags;
  type VkFlags (line 1707) | typedef VkFlags VkBufferViewCreateFlags;
  type VkFlags (line 1708) | typedef VkFlags VkInstanceCreateFlags;
  type VkFlags (line 1709) | typedef VkFlags VkDeviceCreateFlags;
  type VkFlags (line 1710) | typedef VkFlags VkDeviceQueueCreateFlags;
  type VkFlags (line 1711) | typedef VkFlags VkQueueFlags;
  type VkFlags (line 1712) | typedef VkFlags VkMemoryPropertyFlags;
  type VkFlags (line 1713) | typedef VkFlags VkMemoryHeapFlags;
  type VkFlags (line 1714) | typedef VkFlags VkAccessFlags;
  type VkFlags (line 1715) | typedef VkFlags VkBufferUsageFlags;
  type VkFlags (line 1716) | typedef VkFlags VkBufferCreateFlags;
  type VkFlags (line 1717) | typedef VkFlags VkShaderStageFlags;
  type VkFlags (line 1718) | typedef VkFlags VkImageUsageFlags;
  type VkFlags (line 1719) | typedef VkFlags VkImageCreateFlags;
  type VkFlags (line 1720) | typedef VkFlags VkImageViewCreateFlags;
  type VkFlags (line 1721) | typedef VkFlags VkPipelineCreateFlags;
  type VkFlags (line 1722) | typedef VkFlags VkColorComponentFlags;
  type VkFlags (line 1723) | typedef VkFlags VkFenceCreateFlags;
  type VkFlags (line 1724) | typedef VkFlags VkSemaphoreCreateFlags;
  type VkFlags (line 1725) | typedef VkFlags VkFormatFeatureFlags;
  type VkFlags (line 1726) | typedef VkFlags VkQueryControlFlags;
  type VkFlags (line 1727) | typedef VkFlags VkQueryResultFlags;
  type VkFlags (line 1728) | typedef VkFlags VkShaderModuleCreateFlags;
  type VkFlags (line 1729) | typedef VkFlags VkEventCreateFlags;
  type VkFlags (line 1730) | typedef VkFlags VkCommandPoolCreateFlags;
  type VkFlags (line 1731) | typedef VkFlags VkCommandPoolResetFlags;
  type VkFlags (line 1732) | typedef VkFlags VkCommandBufferResetFlags;
  type VkFlags (line 1733) | typedef VkFlags VkCommandBufferUsageFlags;
  type VkFlags (line 1734) | typedef VkFlags VkQueryPipelineStatisticFlags;
  type VkFlags (line 1735) | typedef VkFlags VkMemoryMapFlags;
  type VkFlags (line 1736) | typedef VkFlags VkImageAspectFlags;
  type VkFlags (line 1737) | typedef VkFlags VkSparseMemoryBindFlags;
  type VkFlags (line 1738) | typedef VkFlags VkSparseImageFormatFlags;
  type VkFlags (line 1739) | typedef VkFlags VkSubpassDescriptionFlags;
  type VkFlags (line 1740) | typedef VkFlags VkPipelineStageFlags;
  type VkFlags (line 1741) | typedef VkFlags VkSampleCountFlags;
  type VkFlags (line 1742) | typedef VkFlags VkAttachmentDescriptionFlags;
  type VkFlags (line 1743) | typedef VkFlags VkStencilFaceFlags;
  type VkFlags (line 1744) | typedef VkFlags VkCullModeFlags;
  type VkFlags (line 1745) | typedef VkFlags VkDescriptorPoolCreateFlags;
  type VkFlags (line 1746) | typedef VkFlags VkDescriptorPoolResetFlags;
  type VkFlags (line 1747) | typedef VkFlags VkDependencyFlags;
  type VkFlags (line 1748) | typedef VkFlags VkSubgroupFeatureFlags;
  type VkFlags (line 1749) | typedef VkFlags VkDescriptorUpdateTemplateCreateFlags;
  type VkFlags (line 1750) | typedef VkFlags VkCompositeAlphaFlagsKHR;
  type VkFlags (line 1751) | typedef VkFlags VkSurfaceTransformFlagsKHR;
  type VkFlags (line 1752) | typedef VkFlags VkSwapchainCreateFlagsKHR;
  type VkFlags (line 1753) | typedef VkFlags VkPeerMemoryFeatureFlags;
  type VkFlags (line 1754) | typedef VkFlags VkMemoryAllocateFlags;
  type VkFlags (line 1755) | typedef VkFlags VkDeviceGroupPresentModeFlagsKHR;
  type VkFlags (line 1756) | typedef VkFlags VkDebugReportFlagsEXT;
  type VkFlags (line 1757) | typedef VkFlags VkCommandPoolTrimFlags;
  type VkFlags (line 1758) | typedef VkFlags VkExternalMemoryHandleTypeFlags;
  type VkFlags (line 1759) | typedef VkFlags VkExternalMemoryFeatureFlags;
  type VkFlags (line 1760) | typedef VkFlags VkExternalSemaphoreHandleTypeFlags;
  type VkFlags (line 1761) | typedef VkFlags VkExternalSemaphoreFeatureFlags;
  type VkFlags (line 1762) | typedef VkFlags VkSemaphoreImportFlags;
  type VkFlags (line 1763) | typedef VkFlags VkExternalFenceHandleTypeFlags;
  type VkFlags (line 1764) | typedef VkFlags VkExternalFenceFeatureFlags;
  type VkFlags (line 1765) | typedef VkFlags VkFenceImportFlags;
  type const (line 1766) | typedef VkBool32 (VKAPI_PTR *PFN_vkDebugReportCallbackEXT)(
  type VkDeviceQueueCreateInfo (line 1775) | typedef struct VkDeviceQueueCreateInfo {
  type VkInstanceCreateInfo (line 1783) | typedef struct VkInstanceCreateInfo {
  type VkQueueFamilyProperties (line 1793) | typedef struct VkQueueFamilyProperties {
  type VkMemoryAllocateInfo (line 1799) | typedef struct VkMemoryAllocateInfo {
  type VkMemoryRequirements (line 1805) | typedef struct VkMemoryRequirements {
  type VkSparseImageFormatProperties (line 1810) | typedef struct VkSparseImageFormatProperties {
  type VkSparseImageMemoryRequirements (line 1815) | typedef struct VkSparseImageMemoryRequirements {
  type VkMemoryType (line 1822) | typedef struct VkMemoryType {
  type VkMemoryHeap (line 1826) | typedef struct VkMemoryHeap {
  type VkMappedMemoryRange (line 1830) | typedef struct VkMappedMemoryRange {
  type VkFormatProperties (line 1837) | typedef struct VkFormatProperties {
  type VkImageFormatProperties (line 1842) | typedef struct VkImageFormatProperties {
  type VkDescriptorBufferInfo (line 1849) | typedef struct VkDescriptorBufferInfo {
  type VkWriteDescriptorSet (line 1854) | typedef struct VkWriteDescriptorSet {
  type VkBufferCreateInfo (line 1866) | typedef struct VkBufferCreateInfo {
  type VkBufferViewCreateInfo (line 1876) | typedef struct VkBufferViewCreateInfo {
  type VkImageSubresource (line 1885) | typedef struct VkImageSubresource {
  type VkImageSubresourceLayers (line 1890) | typedef struct VkImageSubresourceLayers {
  type VkImageSubresourceRange (line 1896) | typedef struct VkImageSubresourceRange {
  type VkMemoryBarrier (line 1903) | typedef struct VkMemoryBarrier {
  type VkBufferMemoryBarrier (line 1909) | typedef struct VkBufferMemoryBarrier {
  type VkImageMemoryBarrier (line 1920) | typedef struct VkImageMemoryBarrier {
  type VkImageCreateInfo (line 1932) | typedef struct VkImageCreateInfo {
  type VkSubresourceLayout (line 1949) | typedef struct VkSubresourceLayout {
  type VkImageViewCreateInfo (line 1956) | typedef struct VkImageViewCreateInfo {
  type VkBufferCopy (line 1966) | typedef struct VkBufferCopy {
  type VkSparseMemoryBind (line 1971) | typedef struct VkSparseMemoryBind {
  type VkSparseImageMemoryBind (line 1978) | typedef struct VkSparseImageMemoryBind {
  type VkSparseBufferMemoryBindInfo (line 1986) | typedef struct VkSparseBufferMemoryBindInfo {
  type VkSparseImageOpaqueMemoryBindInfo (line 1991) | typedef struct VkSparseImageOpaqueMemoryBindInfo {
  type VkSparseImageMemoryBindInfo (line 1996) | typedef struct VkSparseImageMemoryBindInfo {
  type VkBindSparseInfo (line 2001) | typedef struct VkBindSparseInfo {
  type VkImageCopy (line 2015) | typedef struct VkImageCopy {
  type VkImageBlit (line 2022) | typedef struct VkImageBlit {
  type VkBufferImageCopy (line 2028) | typedef struct VkBufferImageCopy {
  type VkImageResolve (line 2036) | typedef struct VkImageResolve {
  type VkShaderModuleCreateInfo (line 2043) | typedef struct VkShaderModuleCreateInfo {
  type VkDescriptorSetLayoutBinding (line 2050) | typedef struct VkDescriptorSetLayoutBinding {
  type VkDescriptorSetLayoutCreateInfo (line 2057) | typedef struct VkDescriptorSetLayoutCreateInfo {
  type VkDescriptorPoolCreateInfo (line 2064) | typedef struct VkDescriptorPoolCreateInfo {
  type VkPipelineShaderStageCreateInfo (line 2072) | typedef struct VkPipelineShaderStageCreateInfo {
  type VkComputePipelineCreateInfo (line 2081) | typedef struct VkComputePipelineCreateInfo {
  type VkPipelineVertexInputStateCreateInfo (line 2090) | typedef struct VkPipelineVertexInputStateCreateInfo {
  type VkPipelineInputAssemblyStateCreateInfo (line 2099) | typedef struct VkPipelineInputAssemblyStateCreateInfo {
  type VkPipelineTessellationStateCreateInfo (line 2106) | typedef struct VkPipelineTessellationStateCreateInfo {
  type VkPipelineViewportStateCreateInfo (line 2112) | typedef struct VkPipelineViewportStateCreateInfo {
  type VkPipelineRasterizationStateCreateInfo (line 2121) | typedef struct VkPipelineRasterizationStateCreateInfo {
  type VkPipelineMultisampleStateCreateInfo (line 2136) | typedef struct VkPipelineMultisampleStateCreateInfo {
  type VkPipelineColorBlendAttachmentState (line 2147) | typedef struct VkPipelineColorBlendAttachmentState {
  type VkPipelineColorBlendStateCreateInfo (line 2157) | typedef struct VkPipelineColorBlendStateCreateInfo {
  type VkPipelineDynamicStateCreateInfo (line 2167) | typedef struct VkPipelineDynamicStateCreateInfo {
  type VkPipelineDepthStencilStateCreateInfo (line 2174) | typedef struct VkPipelineDepthStencilStateCreateInfo {
  type VkGraphicsPipelineCreateInfo (line 2188) | typedef struct VkGraphicsPipelineCreateInfo {
  type VkPipelineCacheCreateInfo (line 2209) | typedef struct VkPipelineCacheCreateInfo {
  type VkPushConstantRange (line 2216) | typedef struct VkPushConstantRange {
  type VkPipelineLayoutCreateInfo (line 2221) | typedef struct VkPipelineLayoutCreateInfo {
  type VkSamplerCreateInfo (line 2230) | typedef struct VkSamplerCreateInfo {
  type VkCommandPoolCreateInfo (line 2250) | typedef struct VkCommandPoolCreateInfo {
  type VkCommandBufferInheritanceInfo (line 2256) | typedef struct VkCommandBufferInheritanceInfo {
  type VkCommandBufferBeginInfo (line 2266) | typedef struct VkCommandBufferBeginInfo {
  type VkRenderPassBeginInfo (line 2272) | typedef struct VkRenderPassBeginInfo {
  type VkClearAttachment (line 2281) | typedef struct VkClearAttachment {
  type VkAttachmentDescription (line 2286) | typedef struct VkAttachmentDescription {
  type VkSubpassDescription (line 2297) | typedef struct VkSubpassDescription {
  type VkSubpassDependency (line 2309) | typedef struct VkSubpassDependency {
  type VkRenderPassCreateInfo (line 2318) | typedef struct VkRenderPassCreateInfo {
  type VkEventCreateInfo (line 2329) | typedef struct VkEventCreateInfo {
  type VkFenceCreateInfo (line 2334) | typedef struct VkFenceCreateInfo {
  type VkPhysicalDeviceFeatures (line 2339) | typedef struct VkPhysicalDeviceFeatures {
  type VkPhysicalDeviceSparseProperties (line 2396) | typedef struct VkPhysicalDeviceSparseProperties {
  type VkPhysicalDeviceLimits (line 2403) | typedef struct VkPhysicalDeviceLimits {
  type VkSemaphoreCreateInfo (line 2511) | typedef struct VkSemaphoreCreateInfo {
  type VkQueryPoolCreateInfo (line 2516) | typedef struct VkQueryPoolCreateInfo {
  type VkFramebufferCreateInfo (line 2524) | typedef struct VkFramebufferCreateInfo {
  type VkSubmitInfo (line 2535) | typedef struct VkSubmitInfo {
  type VkSurfaceCapabilitiesKHR (line 2546) | typedef struct VkSurfaceCapabilitiesKHR {
  type VkSwapchainCreateInfoKHR (line 2558) | typedef struct VkSwapchainCreateInfoKHR {
  type VkDebugReportCallbackCreateInfoEXT (line 2578) | typedef struct VkDebugReportCallbackCreateInfoEXT {
  type VkPhysicalDeviceFeatures2 (line 2585) | typedef struct VkPhysicalDeviceFeatures2 {
  type VkFormatProperties2 (line 2590) | typedef struct VkFormatProperties2 {
  type VkImageFormatProperties2 (line 2595) | typedef struct VkImageFormatProperties2 {
  type VkPhysicalDeviceImageFormatInfo2 (line 2600) | typedef struct VkPhysicalDeviceImageFormatInfo2 {
  type VkQueueFamilyProperties2 (line 2609) | typedef struct VkQueueFamilyProperties2 {
  type VkSparseImageFormatProperties2 (line 2614) | typedef struct VkSparseImageFormatProperties2 {
  type VkPhysicalDeviceSparseImageFormatInfo2 (line 2619) | typedef struct VkPhysicalDeviceSparseImageFormatInfo2 {
  type VkPhysicalDeviceVariablePointersFeatures (line 2628) | typedef struct VkPhysicalDeviceVariablePointersFeatures {
  type VkPhysicalDeviceVariablePointerFeatures (line 2634) | typedef struct VkPhysicalDeviceVariablePointerFeatures  VkPhysicalDevice...
  type VkExternalMemoryProperties (line 2635) | typedef struct VkExternalMemoryProperties {
  type VkExternalImageFormatProperties (line 2640) | typedef struct VkExternalImageFormatProperties {
  type VkPhysicalDeviceExternalBufferInfo (line 2645) | typedef struct VkPhysicalDeviceExternalBufferInfo {
  type VkExternalBufferProperties (line 2652) | typedef struct VkExternalBufferProperties {
  type VkPhysicalDeviceIDProperties (line 2657) | typedef struct VkPhysicalDeviceIDProperties {
  type VkExternalMemoryImageCreateInfo (line 2666) | typedef struct VkExternalMemoryImageCreateInfo {
  type VkExternalMemoryBufferCreateInfo (line 2671) | typedef struct VkExternalMemoryBufferCreateInfo {
  type VkExportMemoryAllocateInfo (line 2676) | typedef struct VkExportMemoryAllocateInfo {
  type VkExternalSemaphoreProperties (line 2681) | typedef struct VkExternalSemaphoreProperties {
  type VkExportSemaphoreCreateInfo (line 2688) | typedef struct VkExportSemaphoreCreateInfo {
  type VkExternalFenceProperties (line 2693) | typedef struct VkExternalFenceProperties {
  type VkExportFenceCreateInfo (line 2700) | typedef struct VkExportFenceCreateInfo {
  type VkPhysicalDeviceMultiviewFeatures (line 2705) | typedef struct VkPhysicalDeviceMultiviewFeatures {
  type VkPhysicalDeviceGroupProperties (line 2712) | typedef struct VkPhysicalDeviceGroupProperties {
  type VkMemoryAllocateFlagsInfo (line 2719) | typedef struct VkMemoryAllocateFlagsInfo {
  type VkBindBufferMemoryInfo (line 2725) | typedef struct VkBindBufferMemoryInfo {
  type VkBindImageMemoryInfo (line 2732) | typedef struct VkBindImageMemoryInfo {
  type VkDeviceGroupPresentCapabilitiesKHR (line 2739) | typedef struct VkDeviceGroupPresentCapabilitiesKHR {
  type VkDeviceGroupSwapchainCreateInfoKHR (line 2745) | typedef struct VkDeviceGroupSwapchainCreateInfoKHR {
  type VkDescriptorUpdateTemplateCreateInfo (line 2750) | typedef struct VkDescriptorUpdateTemplateCreateInfo {
  type VkInputAttachmentAspectReference (line 2762) | typedef struct VkInputAttachmentAspectReference {
  type VkRenderPassInputAttachmentAspectCreateInfo (line 2767) | typedef struct VkRenderPassInputAttachmentAspectCreateInfo {
  type VkPhysicalDevice16BitStorageFeatures (line 2773) | typedef struct VkPhysicalDevice16BitStorageFeatures {
  type VkPhysicalDeviceSubgroupProperties (line 2781) | typedef struct VkPhysicalDeviceSubgroupProperties {
  type VkMemoryRequirements2 (line 2789) | typedef struct VkMemoryRequirements2 {
  type VkMemoryRequirements2KHR (line 2794) | typedef struct VkMemoryRequirements2KHR  VkMemoryRequirements2KHR;
  type VkSparseImageMemoryRequirements2 (line 2795) | typedef struct VkSparseImageMemoryRequirements2 {
  type VkMemoryDedicatedRequirements (line 2800) | typedef struct VkMemoryDedicatedRequirements {
  type VkImageViewUsageCreateInfo (line 2806) | typedef struct VkImageViewUsageCreateInfo {
  type VkSamplerYcbcrConversionCreateInfo (line 2811) | typedef struct VkSamplerYcbcrConversionCreateInfo {
  type VkPhysicalDeviceSamplerYcbcrConversionFeatures (line 2823) | typedef struct VkPhysicalDeviceSamplerYcbcrConversionFeatures {
  type VkProtectedSubmitInfo (line 2828) | typedef struct VkProtectedSubmitInfo {
  type VkPhysicalDeviceProtectedMemoryFeatures (line 2833) | typedef struct VkPhysicalDeviceProtectedMemoryFeatures {
  type VkPhysicalDeviceProtectedMemoryProperties (line 2838) | typedef struct VkPhysicalDeviceProtectedMemoryProperties {
  type VkDeviceQueueInfo2 (line 2843) | typedef struct VkDeviceQueueInfo2 {
  type VkPhysicalDeviceMaintenance3Properties (line 2850) | typedef struct VkPhysicalDeviceMaintenance3Properties {
  type VkDescriptorSetLayoutSupport (line 2856) | typedef struct VkDescriptorSetLayoutSupport {
  type VkPhysicalDeviceShaderDrawParametersFeatures (line 2861) | typedef struct VkPhysicalDeviceShaderDrawParametersFeatures {
  type VkPhysicalDeviceShaderDrawParameterFeatures (line 2866) | typedef struct VkPhysicalDeviceShaderDrawParameterFeatures  VkPhysicalDe...
  type VkPhysicalDeviceProperties (line 2867) | typedef struct VkPhysicalDeviceProperties {
  type VkDeviceCreateInfo (line 2878) | typedef struct VkDeviceCreateInfo {
  type VkPhysicalDeviceMemoryProperties (line 2890) | typedef struct VkPhysicalDeviceMemoryProperties {
  type VkPhysicalDeviceProperties2 (line 2896) | typedef struct VkPhysicalDeviceProperties2 {
  type VkPhysicalDeviceMemoryProperties2 (line 2901) | typedef struct VkPhysicalDeviceMemoryProperties2 {
  type VkAcquireNextImageInfoKHR (line 2920) | typedef VkResult (GLAD_API_PTR *PFN_vkAcquireNextImage2KHR)(VkDevice   d...
  type VkCommandBufferAllocateInfo (line 2922) | typedef VkResult (GLAD_API_PTR *PFN_vkAllocateCommandBuffers)(VkDevice  ...
  type VkDescriptorSetAllocateInfo (line 2923) | typedef VkResult (GLAD_API_PTR *PFN_vkAllocateDescriptorSets)(VkDevice  ...
  type VkMemoryAllocateInfo (line 2924) | typedef VkResult (GLAD_API_PTR *PFN_vkAllocateMemory)(VkDevice   device,...
  type VkCommandBufferBeginInfo (line 2925) | typedef VkResult (GLAD_API_PTR *PFN_vkBeginCommandBuffer)(VkCommandBuffe...
  type const (line 2927) | typedef VkResult (GLAD_API_PTR *PFN_vkBindBufferMemory2)(VkDevice   devi...
  type const (line 2929) | typedef VkResult (GLAD_API_PTR *PFN_vkBindImageMemory2)(VkDevice   devic...
  type VkBufferCreateInfo (line 2976) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateBuffer)(VkDevice   device, c...
  type VkBufferViewCreateInfo (line 2977) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateBufferView)(VkDevice   devic...
  type VkCommandPoolCreateInfo (line 2978) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateCommandPool)(VkDevice   devi...
  type const (line 2979) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateComputePipelines)(VkDevice  ...
  type VkDebugReportCallbackCreateInfoEXT (line 2980) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateDebugReportCallbackEXT)(VkIn...
  type VkDescriptorPoolCreateInfo (line 2981) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorPool)(VkDevice   d...
  type VkDescriptorSetLayoutCreateInfo (line 2982) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorSetLayout)(VkDevic...
  type VkDescriptorUpdateTemplateCreateInfo (line 2983) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateDescriptorUpdateTemplate)(Vk...
  type VkDeviceCreateInfo (line 2984) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateDevice)(VkPhysicalDevice   p...
  type VkEventCreateInfo (line 2985) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateEvent)(VkDevice   device, co...
  type VkFenceCreateInfo (line 2986) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateFence)(VkDevice   device, co...
  type VkFramebufferCreateInfo (line 2987) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateFramebuffer)(VkDevice   devi...
  type const (line 2988) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateGraphicsPipelines)(VkDevice ...
  type VkImageCreateInfo (line 2989) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateImage)(VkDevice   device, co...
  type VkImageViewCreateInfo (line 2990) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateImageView)(VkDevice   device...
  type const (line 2991) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateInstance)(const  VkInstanceC...
  type VkPipelineCacheCreateInfo (line 2992) | typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineCache)(VkDevice   de...
  type VkPipelineLayoutCreateInfo (line 2993) | typedef VkResult (GLAD_API_PTR *PFN_vkCreatePipelineLayout)(VkDevice   d...
  type VkQueryPoolCreateInfo (line 2994) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateQueryPool)(VkDevice   device...
  type VkRenderPassCreateInfo (line 2995) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateRenderPass)(VkDevice   devic...
  type VkSamplerCreateInfo (line 2996) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateSampler)(VkDevice   device, ...
  type VkSamplerYcbcrConversionCreateInfo (line 2997) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateSamplerYcbcrConversion)(VkDe...
  type VkSemaphoreCreateInfo (line 2998) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateSemaphore)(VkDevice   device...
  type VkShaderModuleCreateInfo (line 2999) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateShaderModule)(VkDevice   dev...
  type VkSwapchainCreateInfoKHR (line 3000) | typedef VkResult (GLAD_API_PTR *PFN_vkCreateSwapchainKHR)(VkDevice   dev...
  type const (line 3036) | typedef VkResult (GLAD_API_PTR *PFN_vkFlushMappedMemoryRanges)(VkDevice ...
  type const (line 3038) | typedef VkResult (GLAD_API_PTR *PFN_vkFreeDescriptorSets)(VkDevice   dev...
  type VkPhysicalDeviceImageFormatInfo2 (line 3066) | typedef VkResult (GLAD_API_PTR *PFN_vkGetPhysicalDeviceImageFormatProper...
  type const (line 3084) | typedef VkResult (GLAD_API_PTR *PFN_vkInvalidateMappedMemoryRanges)(VkDe...
  type const (line 3086) | typedef VkResult (GLAD_API_PTR *PFN_vkMergePipelineCaches)(VkDevice   de...
  type const (line 3087) | typedef VkResult (GLAD_API_PTR *PFN_vkQueueBindSparse)(VkQueue   queue, ...
  type VkPresentInfoKHR (line 3088) | typedef VkResult (GLAD_API_PTR *PFN_vkQueuePresentKHR)(VkQueue   queue, ...
  type const (line 3089) | typedef VkResult (GLAD_API_PTR *PFN_vkQueueSubmit)(VkQueue   queue, uint...
  type const (line 3095) | typedef VkResult (GLAD_API_PTR *PFN_vkResetFences)(VkDevice   device, ui...
  type const (line 3101) | typedef VkResult (GLAD_API_PTR *PFN_vkWaitForFences)(VkDevice   device, ...

FILE: thirdparty/glfw/deps/glad_gl.c
  function glad_gl_load_GL_VERSION_1_0 (line 794) | static void glad_gl_load_GL_VERSION_1_0( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_1_1 (line 1103) | static void glad_gl_load_GL_VERSION_1_1( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_1_2 (line 1136) | static void glad_gl_load_GL_VERSION_1_2( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_1_3 (line 1143) | static void glad_gl_load_GL_VERSION_1_3( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_1_4 (line 1192) | static void glad_gl_load_GL_VERSION_1_4( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_1_5 (line 1242) | static void glad_gl_load_GL_VERSION_1_5( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_2_0 (line 1264) | static void glad_gl_load_GL_VERSION_2_0( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_2_1 (line 1360) | static void glad_gl_load_GL_VERSION_2_1( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_3_0 (line 1369) | static void glad_gl_load_GL_VERSION_3_0( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_3_1 (line 1456) | static void glad_gl_load_GL_VERSION_3_1( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_3_2 (line 1474) | static void glad_gl_load_GL_VERSION_3_2( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_VERSION_3_3 (line 1496) | static void glad_gl_load_GL_VERSION_3_3( GLADuserptrloadfunc load, void*...
  function glad_gl_load_GL_ARB_multisample (line 1557) | static void glad_gl_load_GL_ARB_multisample( GLADuserptrloadfunc load, v...
  function glad_gl_load_GL_ARB_robustness (line 1562) | static void glad_gl_load_GL_ARB_robustness( GLADuserptrloadfunc load, vo...
  function glad_gl_load_GL_KHR_debug (line 1586) | static void glad_gl_load_GL_KHR_debug( GLADuserptrloadfunc load, void* u...
  function glad_gl_get_extensions (line 1609) | static int glad_gl_get_extensions( int version, const char **out_exts, u...
  function glad_gl_free_extensions (line 1654) | static void glad_gl_free_extensions(char **exts_i, unsigned int num_exts...
  function glad_gl_has_extension (line 1664) | static int glad_gl_has_extension(int version, const char *exts, unsigned...
  function GLADapiproc (line 1697) | static GLADapiproc glad_gl_get_proc_from_userptr(const char* name, void ...
  function glad_gl_find_extensions_gl (line 1701) | static int glad_gl_find_extensions_gl( int version) {
  function glad_gl_find_core_gl (line 1716) | static int glad_gl_find_core_gl(void) {
  function gladLoadGLUserPtr (line 1753) | int gladLoadGLUserPtr( GLADuserptrloadfunc load, void *userptr) {
  function gladLoadGL (line 1785) | int gladLoadGL( GLADloadfunc load) {

FILE: thirdparty/glfw/deps/glad_vulkan.c
  function glad_vk_load_VK_VERSION_1_0 (line 210) | static void glad_vk_load_VK_VERSION_1_0( GLADuserptrloadfunc load, void*...
  function glad_vk_load_VK_VERSION_1_1 (line 350) | static void glad_vk_load_VK_VERSION_1_1( GLADuserptrloadfunc load, void*...
  function glad_vk_load_VK_EXT_debug_report (line 381) | static void glad_vk_load_VK_EXT_debug_report( GLADuserptrloadfunc load, ...
  function glad_vk_load_VK_KHR_surface (line 387) | static void glad_vk_load_VK_KHR_surface( GLADuserptrloadfunc load, void*...
  function glad_vk_load_VK_KHR_swapchain (line 395) | static void glad_vk_load_VK_KHR_swapchain( GLADuserptrloadfunc load, voi...
  function glad_vk_get_extensions (line 410) | static int glad_vk_get_extensions( VkPhysicalDevice physical_device, uin...
  function glad_vk_free_extensions (line 492) | static void glad_vk_free_extensions(uint32_t extension_count, char **ext...
  function glad_vk_has_extension (line 502) | static int glad_vk_has_extension(const char *name, uint32_t extension_co...
  function GLADapiproc (line 514) | static GLADapiproc glad_vk_get_proc_from_userptr(const char* name, void ...
  function glad_vk_find_extensions_vulkan (line 518) | static int glad_vk_find_extensions_vulkan( VkPhysicalDevice physical_dev...
  function glad_vk_find_core_vulkan (line 532) | static int glad_vk_find_core_vulkan( VkPhysicalDevice physical_device) {
  function gladLoadVulkanUserPtr (line 563) | int gladLoadVulkanUserPtr( VkPhysicalDevice physical_device, GLADuserptr...
  function gladLoadVulkan (line 587) | int gladLoadVulkan( VkPhysicalDevice physical_device, GLADloadfunc load) {

FILE: thirdparty/glfw/deps/linmath.h
  function vec3_mul_cross (line 52) | static inline void vec3_mul_cross(vec3 r, vec3 const a, vec3 const b)
  function vec3_reflect (line 59) | static inline void vec3_reflect(vec3 r, vec3 const v, vec3 const n)
  function vec4_mul_cross (line 67) | static inline void vec4_mul_cross(vec4 r, vec4 a, vec4 b)
  function vec4_reflect (line 75) | static inline void vec4_reflect(vec4 r, vec4 v, vec4 n)
  type vec4 (line 83) | typedef vec4 mat4x4[4];
  function mat4x4_identity (line 84) | static inline void mat4x4_identity(mat4x4 M)
  function mat4x4_dup (line 91) | static inline void mat4x4_dup(mat4x4 M, mat4x4 N)
  function mat4x4_row (line 98) | static inline void mat4x4_row(vec4 r, mat4x4 M, int i)
  function mat4x4_col (line 104) | static inline void mat4x4_col(vec4 r, mat4x4 M, int i)
  function mat4x4_transpose (line 110) | static inline void mat4x4_transpose(mat4x4 M, mat4x4 N)
  function mat4x4_add (line 117) | static inline void mat4x4_add(mat4x4 M, mat4x4 a, mat4x4 b)
  function mat4x4_sub (line 123) | static inline void mat4x4_sub(mat4x4 M, mat4x4 a, mat4x4 b)
  function mat4x4_scale (line 129) | static inline void mat4x4_scale(mat4x4 M, mat4x4 a, float k)
  function mat4x4_scale_aniso (line 135) | static inline void mat4x4_scale_aniso(mat4x4 M, mat4x4 a, float x, float...
  function mat4x4_mul (line 145) | static inline void mat4x4_mul(mat4x4 M, mat4x4 a, mat4x4 b)
  function mat4x4_mul_vec4 (line 156) | static inline void mat4x4_mul_vec4(vec4 r, mat4x4 M, vec4 v)
  function mat4x4_translate (line 165) | static inline void mat4x4_translate(mat4x4 T, float x, float y, float z)
  function mat4x4_translate_in_place (line 172) | static inline void mat4x4_translate_in_place(mat4x4 M, float x, float y,...
  function mat4x4_from_vec3_mul_outer (line 182) | static inline void mat4x4_from_vec3_mul_outer(mat4x4 M, vec3 a, vec3 b)
  function mat4x4_rotate (line 188) | static inline void mat4x4_rotate(mat4x4 R, mat4x4 M, float x, float y, f...
  function mat4x4_rotate_X (line 223) | static inline void mat4x4_rotate_X(mat4x4 Q, mat4x4 M, float angle)
  function mat4x4_rotate_Y (line 235) | static inline void mat4x4_rotate_Y(mat4x4 Q, mat4x4 M, float angle)
  function mat4x4_rotate_Z (line 247) | static inline void mat4x4_rotate_Z(mat4x4 Q, mat4x4 M, float angle)
  function mat4x4_invert (line 259) | static inline void mat4x4_invert(mat4x4 T, mat4x4 M)
  function mat4x4_orthonormalize (line 301) | static inline void mat4x4_orthonormalize(mat4x4 R, mat4x4 M)
  function mat4x4_frustum (line 325) | static inline void mat4x4_frustum(mat4x4 M, float l, float r, float b, f...
  function mat4x4_ortho (line 341) | static inline void mat4x4_ortho(mat4x4 M, float l, float r, float b, flo...
  function mat4x4_perspective (line 357) | static inline void mat4x4_perspective(mat4x4 m, float y_fov, float aspec...
  function mat4x4_look_at (line 383) | static inline void mat4x4_look_at(mat4x4 m, vec3 eye, vec3 center, vec3 up)
  function quat_identity (line 427) | static inline void quat_identity(quat q)
  function quat_add (line 432) | static inline void quat_add(quat r, quat a, quat b)
  function quat_sub (line 438) | static inline void quat_sub(quat r, quat a, quat b)
  function quat_mul (line 444) | static inline void quat_mul(quat r, quat p, quat q)
  function quat_scale (line 454) | static inline void quat_scale(quat r, quat v, float s)
  function quat_inner_product (line 460) | static inline float quat_inner_product(quat a, quat b)
  function quat_conj (line 468) | static inline void quat_conj(quat r, quat q)
  function quat_rotate (line 475) | static inline void quat_rotate(quat r, float angle, vec3 axis) {
  function quat_mul_vec3 (line 484) | static inline void quat_mul_vec3(vec3 r, quat q, vec3 v)
  function mat4x4_from_quat (line 503) | static inline void mat4x4_from_quat(mat4x4 M, quat q)
  function mat4x4o_mul_quat (line 533) | static inline void mat4x4o_mul_quat(mat4x4 R, mat4x4 M, quat q)
  function quat_from_mat4x4 (line 544) | static inline void quat_from_mat4x4(quat q, mat4x4 M)

FILE: thirdparty/glfw/deps/mingw/dinput.h
  type IDirectInputA (line 92) | struct IDirectInputA
  type IDirectInputW (line 93) | struct IDirectInputW
  type IDirectInput2A (line 94) | struct IDirectInput2A
  type IDirectInput2W (line 95) | struct IDirectInput2W
  type IDirectInput7A (line 96) | struct IDirectInput7A
  type IDirectInput7W (line 97) | struct IDirectInput7W
  type IDirectInput8A (line 99) | struct IDirectInput8A
  type IDirectInput8W (line 100) | struct IDirectInput8W
  type IDirectInputDeviceA (line 102) | struct IDirectInputDeviceA
  type IDirectInputDeviceW (line 103) | struct IDirectInputDeviceW
  type IDirectInputDevice2A (line 105) | struct IDirectInputDevice2A
  type IDirectInputDevice2W (line 106) | struct IDirectInputDevice2W
  type IDirectInputDevice7A (line 109) | struct IDirectInputDevice7A
  type IDirectInputDevice7W (line 110) | struct IDirectInputDevice7W
  type IDirectInputDevice8A (line 113) | struct IDirectInputDevice8A
  type IDirectInputDevice8W (line 114) | struct IDirectInputDevice8W
  type IDirectInputEffect (line 117) | struct IDirectInputEffect
  type SysKeyboardA (line 119) | struct SysKeyboardA
  type SysMouseA (line 120) | struct SysMouseA
  type DIDEVICEOBJECTINSTANCE_DX3A (line 350) | typedef struct DIDEVICEOBJECTINSTANCE_DX3A {
  type DIDEVICEOBJECTINSTANCE_DX3A (line 358) | typedef const DIDEVICEOBJECTINSTANCE_DX3A *LPCDIDEVICEOBJECTINSTANCE_DX3A;
  type DIDEVICEOBJECTINSTANCE_DX3W (line 359) | typedef struct DIDEVICEOBJECTINSTANCE_DX3W {
  type DIDEVICEOBJECTINSTANCE_DX3W (line 367) | typedef const DIDEVICEOBJECTINSTANCE_DX3W *LPCDIDEVICEOBJECTINSTANCE_DX3W;
  function DECL_WINELIB_TYPE_AW (line 369) | DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE_DX3)
  type DIDEVICEOBJECTINSTANCEA (line 392) | typedef const DIDEVICEOBJECTINSTANCEA *LPCDIDEVICEOBJECTINSTANCEA;
  type DIDEVICEOBJECTINSTANCEW (line 394) | typedef struct DIDEVICEOBJECTINSTANCEW {
  type DIDEVICEOBJECTINSTANCEW (line 413) | typedef const DIDEVICEOBJECTINSTANCEW *LPCDIDEVICEOBJECTINSTANCEW;
  function DECL_WINELIB_TYPE_AW (line 415) | DECL_WINELIB_TYPE_AW(DIDEVICEOBJECTINSTANCE)
  type DIDEVICEINSTANCE_DX3A (line 427) | typedef const DIDEVICEINSTANCE_DX3A *LPCDIDEVICEINSTANCE_DX3A;
  type DIDEVICEINSTANCE_DX3W (line 428) | typedef struct DIDEVICEINSTANCE_DX3W {
  type DIDEVICEINSTANCE_DX3W (line 436) | typedef const DIDEVICEINSTANCE_DX3W *LPCDIDEVICEINSTANCE_DX3W;
  function DECL_WINELIB_TYPE_AW (line 438) | DECL_WINELIB_TYPE_AW(DIDEVICEINSTANCE_DX3)
  type DIDEVICEINSTANCEA (line 455) | typedef const DIDEVICEINSTANCEA *LPCDIDEVICEINSTANCEA;
  type DIDEVICEINSTANCEW (line 457) | typedef struct DIDEVICEINSTANCEW {
  type DIDEVICEINSTANCEW (line 470) | typedef const DIDEVICEINSTANCEW *LPCDIDEVICEINSTANCEW;
  type LPDIRECTINPUTDEVICE8A (line 494) | typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBA)(LPCDIDEVICEINSTAN...
  type LPDIRECTINPUTDEVICE8W (line 495) | typedef BOOL (CALLBACK *LPDIENUMDEVICESBYSEMANTICSCBW)(LPCDIDEVICEINSTAN...
  type DIDEVICEOBJECTDATA_DX3 (line 705) | typedef struct DIDEVICEOBJECTDATA_DX3 {
  type DIDEVICEOBJECTDATA_DX3 (line 711) | typedef const DIDEVICEOBJECTDATA_DX3 *LPCDIDEVICEOBJECTDATA_DX3;
  type DIDEVICEOBJECTDATA (line 713) | typedef struct DIDEVICEOBJECTDATA {
  type DIDEVICEOBJECTDATA (line 722) | typedef const DIDEVICEOBJECTDATA *LPCDIDEVICEOBJECTDATA;
  type DIOBJECTDATAFORMAT (line 724) | typedef struct _DIOBJECTDATAFORMAT {
  type DIOBJECTDATAFORMAT (line 730) | typedef const DIOBJECTDATAFORMAT *LPCDIOBJECTDATAFORMAT;
  type DIDATAFORMAT (line 732) | typedef struct _DIDATAFORMAT {
  type DIDATAFORMAT (line 740) | typedef const DIDATAFORMAT *LPCDIDATAFORMAT;
  type DIPROPHEADER (line 756) | typedef struct DIPROPHEADER {
  type DIPROPHEADER (line 762) | typedef const DIPROPHEADER *LPCDIPROPHEADER;
  type DIPROPDWORD (line 773) | typedef struct DIPROPDWORD {
  type DIPROPDWORD (line 777) | typedef const DIPROPDWORD *LPCDIPROPDWORD;
  type DIPROPRANGE (line 779) | typedef struct DIPROPRANGE {
  type DIPROPRANGE (line 784) | typedef const DIPROPRANGE *LPCDIPROPRANGE;
  type DIPROPCAL (line 790) | typedef struct DIPROPCAL {
  type DIPROPCAL (line 796) | typedef const DIPROPCAL *LPCDIPROPCAL;
  type DIPROPCALPOV (line 798) | typedef struct DIPROPCALPOV {
  type DIPROPCALPOV (line 803) | typedef const DIPROPCALPOV *LPCDIPROPCALPOV;
  type DIPROPGUIDANDPATH (line 805) | typedef struct DIPROPGUIDANDPATH {
  type DIPROPGUIDANDPATH (line 810) | typedef const DIPROPGUIDANDPATH *LPCDIPROPGUIDANDPATH;
  type DIPROPSTRING (line 812) | typedef struct DIPROPSTRING {
  type DIPROPSTRING (line 816) | typedef const DIPROPSTRING *LPCDIPROPSTRING;
  type DIPROPPOINTER (line 820) | typedef struct DIPROPPOINTER {
  type DIPROPPOINTER (line 824) | typedef const DIPROPPOINTER *LPCDIPROPPOINTER;
  type CPOINT (line 883) | typedef struct _CPOINT {
  type DIPROPCPOINTS (line 888) | typedef struct DIPROPCPOINTS {
  type DIPROPCPOINTS (line 893) | typedef const DIPROPCPOINTS *LPCDIPROPCPOINTS;
  type DIDEVCAPS_DX3 (line 897) | typedef struct DIDEVCAPS_DX3 {
  type DIDEVCAPS (line 906) | typedef struct DIDEVCAPS {
  type DICONSTANTFORCE (line 1023) | typedef struct DICONSTANTFORCE {
  type DICONSTANTFORCE (line 1026) | typedef const DICONSTANTFORCE *LPCDICONSTANTFORCE;
  type DIRAMPFORCE (line 1028) | typedef struct DIRAMPFORCE {
  type DIRAMPFORCE (line 1032) | typedef const DIRAMPFORCE *LPCDIRAMPFORCE;
  type DIPERIODIC (line 1034) | typedef struct DIPERIODIC {
  type DIPERIODIC (line 1040) | typedef const DIPERIODIC *LPCDIPERIODIC;
  type DICONDITION (line 1042) | typedef struct DICONDITION {
  type DICONDITION (line 1050) | typedef const DICONDITION *LPCDICONDITION;
  type DICUSTOMFORCE (line 1052) | typedef struct DICUSTOMFORCE {
  type DICUSTOMFORCE (line 1058) | typedef const DICUSTOMFORCE *LPCDICUSTOMFORCE;
  type DIENVELOPE (line 1060) | typedef struct DIENVELOPE {
  type DIENVELOPE (line 1067) | typedef const DIENVELOPE *LPCDIENVELOPE;
  type DIEFFECT_DX5 (line 1069) | typedef struct DIEFFECT_DX5 {
  type DIEFFECT_DX5 (line 1084) | typedef const DIEFFECT_DX5 *LPCDIEFFECT_DX5;
  type DIEFFECT (line 1086) | typedef struct DIEFFECT {
  type DIEFFECT (line 1104) | typedef const DIEFFECT *LPCDIEFFECT;
  type DIEFFECT (line 1105) | typedef DIEFFECT DIEFFECT_DX6;
  type LPDIEFFECT (line 1106) | typedef LPDIEFFECT LPDIEFFECT_DX6;
  type DIEFFECTINFOA (line 1108) | typedef struct DIEFFECTINFOA {
  type DIEFFECTINFOA (line 1116) | typedef const DIEFFECTINFOA *LPCDIEFFECTINFOA;
  type DIEFFECTINFOW (line 1118) | typedef struct DIEFFECTINFOW {
  type DIEFFECTINFOW (line 1126) | typedef const DIEFFECTINFOW *LPCDIEFFECTINFOW;
  type DIEFFESCAPE (line 1135) | typedef struct DIEFFESCAPE {
  type DIJOYSTATE (line 1144) | typedef struct DIJOYSTATE {
  type DIJOYSTATE2 (line 1156) | typedef struct DIJOYSTATE2 {
  type DIFILEEFFECT (line 1236) | typedef struct DIFILEEFFECT {
  type DIFILEEFFECT (line 1243) | typedef const DIFILEEFFECT *LPCDIFILEEFFECT;
  type DUMMYUNIONNAME (line 1249) | typedef struct _DIACTIONA {
  type DIACTIONA (line 1261) | typedef const DIACTIONA *LPCDIACTIONA;
  type DUMMYUNIONNAME (line 1263) | typedef struct _DIACTIONW {
  type DIACTIONW (line 1275) | typedef const DIACTIONW *LPCDIACTIONW;
  type DIACTIONFORMATA (line 1295) | typedef struct _DIACTIONFORMATA {
  type DIACTIONFORMATA (line 1311) | typedef const DIACTIONFORMATA *LPCDIACTIONFORMATA;
  type DIACTIONFORMATW (line 1313) | typedef struct _DIACTIONFORMATW {
  type DIACTIONFORMATW (line 1329) | typedef const DIACTIONFORMATW *LPCDIACTIONFORMATW;
  type DWORD (line 1353) | typedef DWORD D3DCOLOR;
  type DICOLORSET (line 1357) | typedef struct _DICOLORSET {
  type DICOLORSET (line 1368) | typedef const DICOLORSET *LPCDICOLORSET;
  type DICONFIGUREDEVICESPARAMSA (line 1370) | typedef struct _DICONFIGUREDEVICESPARAMSA {
  type DICONFIGUREDEVICESPARAMSA (line 1380) | typedef const DICONFIGUREDEVICESPARAMSA *LPCDICONFIGUREDEVICESPARAMSA;
  type DICONFIGUREDEVICESPARAMSW (line 1382) | typedef struct _DICONFIGUREDEVICESPARAMSW {
  type DICONFIGUREDEVICESPARAMSW (line 1392) | typedef const DICONFIGUREDEVICESPARAMSW *LPCDICONFIGUREDEVICESPARAMSW;
  type DIDEVICEIMAGEINFOA (line 1408) | typedef struct _DIDEVICEIMAGEINFOA {
  type DIDEVICEIMAGEINFOA (line 1419) | typedef const DIDEVICEIMAGEINFOA *LPCDIDEVICEIMAGEINFOA;
  type DIDEVICEIMAGEINFOW (line 1421) | typedef struct _DIDEVICEIMAGEINFOW {
  type DIDEVICEIMAGEINFOW (line 1432) | typedef const DIDEVICEIMAGEINFOW *LPCDIDEVICEIMAGEINFOW;
  function DECL_WINELIB_TYPE_AW (line 1434) | DECL_WINELIB_TYPE_AW(DIDEVICEIMAGEINFO)
  type DIDEVICEIMAGEINFOHEADERA (line 1449) | typedef const DIDEVICEIMAGEINFOHEADERA *LPCDIDEVICEIMAGEINFOHEADERA;
  type DIDEVICEIMAGEINFOHEADERW (line 1451) | typedef struct _DIDEVICEIMAGEINFOHEADERW {
  type DIDEVICEIMAGEINFOHEADERW (line 1462) | typedef const DIDEVICEIMAGEINFOHEADERW *LPCDIDEVICEIMAGEINFOHEADERW;
  type DIMOUSESTATE2 (line 2120) | struct DIMOUSESTATE2 {

FILE: thirdparty/glfw/deps/mingw/xinput.h
  type XINPUT_GAMEPAD (line 163) | typedef struct _XINPUT_GAMEPAD {
  type XINPUT_STATE (line 173) | typedef struct _XINPUT_STATE {
  type XINPUT_VIBRATION (line 184) | typedef struct _XINPUT_VIBRATION {
  type XINPUT_CAPABILITIES (line 197) | typedef struct _XINPUT_CAPABILITIES {
  type XINPUT_KEYSTROKE (line 209) | typedef struct _XINPUT_KEYSTROKE {
  type XINPUT_BATTERY_INFORMATION (line 217) | typedef struct _XINPUT_BATTERY_INFORMATION

FILE: thirdparty/glfw/deps/nuklear.h
  type NK_INT8 (line 396) | typedef NK_INT8 nk_char;
  type NK_UINT8 (line 397) | typedef NK_UINT8 nk_uchar;
  type NK_UINT8 (line 398) | typedef NK_UINT8 nk_byte;
  type NK_INT16 (line 399) | typedef NK_INT16 nk_short;
  type NK_UINT16 (line 400) | typedef NK_UINT16 nk_ushort;
  type NK_INT32 (line 401) | typedef NK_INT32 nk_int;
  type NK_UINT32 (line 402) | typedef NK_UINT32 nk_uint;
  type NK_SIZE_TYPE (line 403) | typedef NK_SIZE_TYPE nk_size;
  type NK_POINTER_TYPE (line 404) | typedef NK_POINTER_TYPE nk_ptr;
  type nk_uint (line 406) | typedef nk_uint nk_hash;
  type nk_uint (line 407) | typedef nk_uint nk_flags;
  type nk_uint (line 408) | typedef nk_uint nk_rune;
  type nk_buffer (line 428) | struct nk_buffer
  type nk_allocator (line 429) | struct nk_allocator
  type nk_command_buffer (line 430) | struct nk_command_buffer
  type nk_draw_command (line 431) | struct nk_draw_command
  type nk_convert_config (line 432) | struct nk_convert_config
  type nk_style_item (line 433) | struct nk_style_item
  type nk_text_edit (line 434) | struct nk_text_edit
  type nk_draw_list (line 435) | struct nk_draw_list
  type nk_user_font (line 436) | struct nk_user_font
  type nk_panel (line 437) | struct nk_panel
  type nk_context (line 438) | struct nk_context
  type nk_draw_vertex_layout_element (line 439) | struct nk_draw_vertex_layout_element
  type nk_style_button (line 440) | struct nk_style_button
  type nk_style_toggle (line 441) | struct nk_style_toggle
  type nk_style_selectable (line 442) | struct nk_style_selectable
  type nk_style_slide (line 443) | struct nk_style_slide
  type nk_style_progress (line 444) | struct nk_style_progress
  type nk_style_scrollbar (line 445) | struct nk_style_scrollbar
  type nk_style_edit (line 446) | struct nk_style_edit
  type nk_style_property (line 447) | struct nk_style_property
  type nk_style_chart (line 448) | struct nk_style_chart
  type nk_style_combo (line 449) | struct nk_style_combo
  type nk_style_tab (line 450) | struct nk_style_tab
  type nk_style_window_header (line 451) | struct nk_style_window_header
  type nk_style_window (line 452) | struct nk_style_window
  type nk_color (line 455) | struct nk_color {nk_byte r,g,b,a;}
  type nk_colorf (line 456) | struct nk_colorf {float r,g,b,a;}
  type nk_vec2 (line 457) | struct nk_vec2 {float x,y;}
  type nk_vec2i (line 458) | struct nk_vec2i {short x, y;}
  type nk_rect (line 459) | struct nk_rect {float x,y,w,h;}
  type nk_recti (line 460) | struct nk_recti {short x,y,w,h;}
  type nk_handle (line 462) | typedef union {void *ptr; int id;} nk_handle;
  type nk_image (line 463) | struct nk_image {nk_handle handle;unsigned short w,h;unsigned short regi...
  type nk_cursor (line 464) | struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;}
  type nk_scroll (line 465) | struct nk_scroll {nk_uint x, y;}
  type nk_heading (line 467) | enum nk_heading         {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT}
  type nk_button_behavior (line 468) | enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER}
  type nk_modify (line 469) | enum nk_modify          {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true}
  type nk_orientation (line 470) | enum nk_orientation     {NK_VERTICAL, NK_HORIZONTAL}
  type nk_collapse_states (line 471) | enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true}
  type nk_show_states (line 472) | enum nk_show_states     {NK_HIDDEN = nk_false, NK_SHOWN = nk_true}
  type nk_chart_type (line 473) | enum nk_chart_type      {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX}
  type nk_chart_event (line 474) | enum nk_chart_event     {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02}
  type nk_color_format (line 475) | enum nk_color_format    {NK_RGB, NK_RGBA}
  type nk_popup_type (line 476) | enum nk_popup_type      {NK_POPUP_STATIC, NK_POPUP_DYNAMIC}
  type nk_layout_format (line 477) | enum nk_layout_format   {NK_DYNAMIC, NK_STATIC}
  type nk_tree_type (line 478) | enum nk_tree_type       {NK_TREE_NODE, NK_TREE_TAB}
  type nk_text_edit (line 482) | struct nk_text_edit
  type nk_text_edit (line 483) | struct nk_text_edit
  type nk_allocator (line 486) | struct nk_allocator {
  type nk_symbol_type (line 491) | enum nk_symbol_type {
  type nk_context (line 562) | struct nk_context
  type nk_user_font (line 562) | struct nk_user_font
  type nk_context (line 587) | struct nk_context
  type nk_user_font (line 587) | struct nk_user_font
  type nk_context (line 605) | struct nk_context
  type nk_allocator (line 605) | struct nk_allocator
  type nk_user_font (line 605) | struct nk_user_font
  type nk_context (line 624) | struct nk_context
  type nk_buffer (line 624) | struct nk_buffer
  type nk_buffer (line 624) | struct nk_buffer
  type nk_user_font (line 624) | struct nk_user_font
  type nk_context (line 638) | struct nk_context
  type nk_context (line 651) | struct nk_context
  type nk_context (line 665) | struct nk_context
  type nk_keys (line 733) | enum nk_keys {
  type nk_buttons (line 768) | enum nk_buttons {
  type nk_context (line 787) | struct nk_context
  type nk_context (line 801) | struct nk_context
  type nk_context (line 815) | struct nk_context
  type nk_keys (line 815) | enum nk_keys
  type nk_context (line 831) | struct nk_context
  type nk_buttons (line 831) | enum nk_buttons
  type nk_context (line 846) | struct nk_context
  type nk_vec2 (line 846) | struct nk_vec2
  type nk_context (line 864) | struct nk_context
  type nk_context (line 881) | struct nk_context
  type nk_context (line 897) | struct nk_context
  type nk_context (line 910) | struct nk_context
  type nk_anti_aliasing (line 1134) | enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON}
  type nk_convert_result (line 1135) | enum nk_convert_result {
  type nk_draw_null_texture (line 1142) | struct nk_draw_null_texture {
  type nk_convert_config (line 1146) | struct nk_convert_config {
  type nk_context (line 1172) | struct nk_context
  type nk_context (line 1187) | struct nk_context
  type nk_command (line 1187) | struct nk_command
  type nk_context (line 1233) | struct nk_context
  type nk_buffer (line 1233) | struct nk_buffer
  type nk_buffer (line 1233) | struct nk_buffer
  type nk_buffer (line 1233) | struct nk_buffer
  type nk_convert_config (line 1233) | struct nk_convert_config
  type nk_context (line 1248) | struct nk_context
  type nk_buffer (line 1248) | struct nk_buffer
  type nk_context (line 1263) | struct nk_context
  type nk_buffer (line 1263) | struct nk_buffer
  type nk_draw_command (line 1279) | struct nk_draw_command
  type nk_buffer (line 1279) | struct nk_buffer
  type nk_context (line 1279) | struct nk_context
  type nk_panel_flags (line 1440) | enum nk_panel_flags {
  type nk_context (line 1471) | struct nk_context
  type nk_rect (line 1471) | struct nk_rect
  type nk_context (line 1491) | struct nk_context
  type nk_rect (line 1491) | struct nk_rect
  type nk_context (line 1504) | struct nk_context
  type nk_context (line 1520) | struct nk_context
  type nk_context (line 1536) | struct nk_context
  type nk_context (line 1552) | struct nk_context
  type nk_context (line 1568) | struct nk_context
  type nk_context (line 1584) | struct nk_context
  type nk_context (line 1600) | struct nk_context
  type nk_context (line 1618) | struct nk_context
  type nk_context (line 1637) | struct nk_context
  type nk_context (line 1656) | struct nk_context
  type nk_context (line 1675) | struct nk_context
  type nk_context (line 1693) | struct nk_context
  type nk_context (line 1712) | struct nk_context
  type nk_context (line 1727) | struct nk_context
  type nk_context (line 1742) | struct nk_context
  type nk_context (line 1757) | struct nk_context
  type nk_context (line 1771) | struct nk_context
  type nk_context (line 1785) | struct nk_context
  type nk_context (line 1799) | struct nk_context
  type nk_context (line 1812) | struct nk_context
  type nk_context (line 1827) | struct nk_context
  type nk_context (line 1840) | struct nk_context
  type nk_rect (line 1840) | struct nk_rect
  type nk_context (line 1853) | struct nk_context
  type nk_vec2 (line 1853) | struct nk_vec2
  type nk_context (line 1866) | struct nk_context
  type nk_vec2 (line 1866) | struct nk_vec2
  type nk_context (line 1878) | struct nk_context
  type nk_context (line 1890) | struct nk_context
  type nk_context (line 1903) | struct nk_context
  type nk_collapse_states (line 1903) | enum nk_collapse_states
  type nk_context (line 1917) | struct nk_context
  type nk_collapse_states (line 1917) | enum nk_collapse_states
  type nk_context (line 1930) | struct nk_context
  type nk_show_states (line 1930) | enum nk_show_states
  type nk_context (line 1944) | struct nk_context
  type nk_show_states (line 1944) | enum nk_show_states
  type nk_context (line 2233) | struct nk_context
  type nk_context (line 2244) | struct nk_context
  type nk_context (line 2257) | struct nk_context
  type nk_context (line 2271) | struct nk_context
  type nk_context (line 2286) | struct nk_context
  type nk_context (line 2302) | struct nk_context
  type nk_context (line 2316) | struct nk_context
  type nk_layout_format (line 2316) | enum nk_layout_format
  type nk_context (line 2328) | struct nk_context
  type nk_context (line 2339) | struct nk_context
  type nk_context (line 2353) | struct nk_context
  type nk_layout_format (line 2353) | enum nk_layout_format
  type nk_context (line 2365) | struct nk_context
  type nk_context (line 2377) | struct nk_context
  type nk_context (line 2389) | struct nk_context
  type nk_context (line 2401) | struct nk_context
  type nk_context (line 2412) | struct nk_context
  type nk_context (line 2426) | struct nk_context
  type nk_layout_format (line 2426) | enum nk_layout_format
  type nk_context (line 2438) | struct nk_context
  type nk_rect (line 2438) | struct nk_rect
  type nk_context (line 2449) | struct nk_context
  type nk_context (line 2462) | struct nk_context
  type nk_context (line 2476) | struct nk_context
  type nk_vec2 (line 2476) | struct nk_vec2
  type nk_context (line 2490) | struct nk_context
  type nk_vec2 (line 2490) | struct nk_vec2
  type nk_context (line 2504) | struct nk_context
  type nk_rect (line 2504) | struct nk_rect
  type nk_context (line 2518) | struct nk_context
  type nk_rect (line 2518) | struct nk_rect
  type nk_context (line 2619) | struct nk_context
  type nk_context (line 2635) | struct nk_context
  type nk_context (line 2646) | struct nk_context
  type nk_context (line 2664) | struct nk_context
  type nk_context (line 2681) | struct nk_context
  type nk_scroll (line 2681) | struct nk_scroll
  type nk_context (line 2692) | struct nk_context
  type nk_context (line 2821) | struct nk_context
  type nk_tree_type (line 2821) | enum nk_tree_type
  type nk_collapse_states (line 2821) | enum nk_collapse_states
  type nk_context (line 2885) | struct nk_context
  type nk_tree_type (line 2885) | enum nk_tree_type
  type nk_image (line 2885) | struct nk_image
  type nk_collapse_states (line 2885) | enum nk_collapse_states
  type nk_context (line 2896) | struct nk_context
  type nk_context (line 2912) | struct nk_context
  type nk_tree_type (line 2912) | enum nk_tree_type
  type nk_collapse_states (line 2912) | enum nk_collapse_states
  type nk_context (line 2929) | struct nk_context
  type nk_tree_type (line 2929) | enum nk_tree_type
  type nk_image (line 2929) | struct nk_image
  type nk_collapse_states (line 2929) | enum nk_collapse_states
  type nk_context (line 2940) | struct nk_context
  type nk_context (line 2944) | struct nk_context
  type nk_tree_type (line 2944) | enum nk_tree_type
  type nk_collapse_states (line 2944) | enum nk_collapse_states
  type nk_context (line 2945) | struct nk_context
  type nk_tree_type (line 2945) | enum nk_tree_type
  type nk_image (line 2945) | struct nk_image
  type nk_collapse_states (line 2945) | enum nk_collapse_states
  type nk_context (line 2946) | struct nk_context
  type nk_list_view (line 2953) | struct nk_list_view {
  type nk_context (line 2962) | struct nk_context
  type nk_list_view (line 2962) | struct nk_list_view
  type nk_list_view (line 2963) | struct nk_list_view
  type nk_widget_layout_states (line 2969) | enum nk_widget_layout_states {
  type nk_widget_states (line 2974) | enum nk_widget_states {
  type nk_rect (line 2984) | struct nk_rect
  type nk_context (line 2984) | struct nk_context
  type nk_rect (line 2985) | struct nk_rect
  type nk_context (line 2985) | struct nk_context
  type nk_vec2 (line 2985) | struct nk_vec2
  type nk_context (line 2986) | struct nk_context
  type nk_context (line 2987) | struct nk_context
  type nk_context (line 2988) | struct nk_context
  type nk_context (line 2989) | struct nk_context
  type nk_context (line 2990) | struct nk_context
  type nk_context (line 2991) | struct nk_context
  type nk_context (line 2992) | struct nk_context
  type nk_buttons (line 2992) | enum nk_buttons
  type nk_context (line 2993) | struct nk_context
  type nk_buttons (line 2993) | enum nk_buttons
  type nk_context (line 2994) | struct nk_context
  type nk_text_align (line 3000) | enum nk_text_align {
  type nk_text_alignment (line 3008) | enum nk_text_alignment {
  type nk_context (line 3013) | struct nk_context
  type nk_context (line 3014) | struct nk_context
  type nk_color (line 3014) | struct nk_color
  type nk_context (line 3015) | struct nk_context
  type nk_context (line 3016) | struct nk_context
  type nk_color (line 3016) | struct nk_color
  type nk_context (line 3017) | struct nk_context
  type nk_context (line 3018) | struct nk_context
  type nk_color (line 3018) | struct nk_color
  type nk_context (line 3019) | struct nk_context
  type nk_context (line 3020) | struct nk_context
  type nk_color (line 3020) | struct nk_color
  type nk_context (line 3021) | struct nk_context
  type nk_image (line 3021) | struct nk_image
  type nk_context (line 3022) | struct nk_context
  type nk_image (line 3022) | struct nk_image
  type nk_color (line 3022) | struct nk_color
  type nk_context (line 3024) | struct nk_context
  type nk_context (line 3025) | struct nk_context
  type nk_color (line 3025) | struct nk_color
  type nk_context (line 3026) | struct nk_context
  type nk_context (line 3027) | struct nk_context
  type nk_color (line 3027) | struct nk_color
  type nk_context (line 3028) | struct nk_context
  type nk_context (line 3029) | struct nk_context
  type nk_color (line 3029) | struct nk_color
  type nk_context (line 3030) | struct nk_context
  type nk_context (line 3031) | struct nk_context
  type nk_color (line 3031) | struct nk_color
  type nk_context (line 3032) | struct nk_context
  type nk_context (line 3033) | struct nk_context
  type nk_context (line 3034) | struct nk_context
  type nk_context (line 3035) | struct nk_context
  type nk_context (line 3036) | struct nk_context
  type nk_color (line 3036) | struct nk_color
  type nk_context (line 3037) | struct nk_context
  type nk_color (line 3037) | struct nk_color
  type nk_context (line 3038) | struct nk_context
  type nk_color (line 3038) | struct nk_color
  type nk_context (line 3045) | struct nk_context
  type nk_context (line 3046) | struct nk_context
  type nk_context (line 3047) | struct nk_context
  type nk_color (line 3047) | struct nk_color
  type nk_context (line 3048) | struct nk_context
  type nk_symbol_type (line 3048) | enum nk_symbol_type
  type nk_context (line 3049) | struct nk_context
  type nk_image (line 3049) | struct nk_image
  type nk_context (line 3050) | struct nk_context
  type nk_symbol_type (line 3050) | enum nk_symbol_type
  type nk_context (line 3051) | struct nk_context
  type nk_symbol_type (line 3051) | enum nk_symbol_type
  type nk_context (line 3052) | struct nk_context
  type nk_image (line 3052) | struct nk_image
  type nk_context (line 3053) | struct nk_context
  type nk_image (line 3053) | struct nk_image
  type nk_context (line 3054) | struct nk_context
  type nk_style_button (line 3054) | struct nk_style_button
  type nk_context (line 3055) | struct nk_context
  type nk_style_button (line 3055) | struct nk_style_button
  type nk_context (line 3056) | struct nk_context
  type nk_style_button (line 3056) | struct nk_style_button
  type nk_symbol_type (line 3056) | enum nk_symbol_type
  type nk_context (line 3057) | struct nk_context
  type nk_style_button (line 3057) | struct nk_style_button
  type nk_image (line 3057) | struct nk_image
  type nk_context (line 3058) | struct nk_context
  type nk_style_button (line 3058) | struct nk_style_button
  type nk_symbol_type (line 3058) | enum nk_symbol_type
  type nk_context (line 3059) | struct nk_context
  type nk_style_button (line 3059) | struct nk_style_button
  type nk_symbol_type (line 3059) | enum nk_symbol_type
  type nk_context (line 3060) | struct nk_context
  type nk_style_button (line 3060) | struct nk_style_button
  type nk_image (line 3060) | struct nk_image
  type nk_context (line 3061) | struct nk_context
  type nk_style_button (line 3061) | struct nk_style_button
  type nk_image (line 3061) | struct nk_image
  type nk_context (line 3062) | struct nk_context
  type nk_button_behavior (line 3062) | enum nk_button_behavior
  type nk_context (line 3063) | struct nk_context
  type nk_button_behavior (line 3063) | enum nk_button_behavior
  type nk_context (line 3064) | struct nk_context
  type nk_context (line 3070) | struct nk_context
  type nk_context (line 3071) | struct nk_context
  type nk_context (line 3072) | struct nk_context
  type nk_context (line 3073) | struct nk_context
  type nk_context (line 3074) | struct nk_context
  type nk_context (line 3075) | struct nk_context
  type nk_context (line 3076) | struct nk_context
  type nk_context (line 3077) | struct nk_context
  type nk_context (line 3083) | struct nk_context
  type nk_context (line 3084) | struct nk_context
  type nk_context (line 3085) | struct nk_context
  type nk_context (line 3086) | struct nk_context
  type nk_context (line 3092) | struct nk_context
  type nk_context (line 3093) | struct nk_context
  type nk_context (line 3094) | struct nk_context
  type nk_image (line 3094) | struct nk_image
  type nk_context (line 3095) | struct nk_context
  type nk_image (line 3095) | struct nk_image
  type nk_context (line 3096) | struct nk_context
  type nk_symbol_type (line 3096) | enum nk_symbol_type
  type nk_context (line 3097) | struct nk_context
  type nk_symbol_type (line 3097) | enum nk_symbol_type
  type nk_context (line 3099) | struct nk_context
  type nk_context (line 3100) | struct nk_context
  type nk_context (line 3101) | struct nk_context
  type nk_image (line 3101) | struct nk_image
  type nk_context (line 3102) | struct nk_context
  type nk_image (line 3102) | struct nk_image
  type nk_context (line 3103) | struct nk_context
  type nk_symbol_type (line 3103) | enum nk_symbol_type
  type nk_context (line 3104) | struct nk_context
  type nk_symbol_type (line 3104) | enum nk_symbol_type
  type nk_context (line 3111) | struct nk_context
  type nk_context (line 3112) | struct nk_context
  type nk_context (line 3113) | struct nk_context
  type nk_context (line 3114) | struct nk_context
  type nk_context (line 3120) | struct nk_context
  type nk_context (line 3121) | struct nk_context
  type nk_context (line 3128) | struct nk_context
  type nk_colorf (line 3128) | struct nk_colorf
  type nk_color_format (line 3128) | enum nk_color_format
  type nk_context (line 3129) | struct nk_context
  type nk_colorf (line 3129) | struct nk_colorf
  type nk_color_format (line 3129) | enum nk_color_format
  type nk_context (line 3226) | struct nk_context
  type nk_context (line 3247) | struct nk_context
  type nk_context (line 3268) | struct nk_context
  type nk_context (line 3291) | struct nk_context
  type nk_context (line 3314) | struct nk_context
  type nk_context (line 3337) | struct nk_context
  type nk_edit_flags (line 3343) | enum nk_edit_flags {
  type nk_edit_types (line 3358) | enum nk_edit_types {
  type nk_edit_events (line 3364) | enum nk_edit_events {
  type nk_context (line 3371) | struct nk_context
  type nk_context (line 3372) | struct nk_context
  type nk_context (line 3373) | struct nk_context
  type nk_text_edit (line 3373) | struct nk_text_edit
  type nk_context (line 3374) | struct nk_context
  type nk_context (line 3375) | struct nk_context
  type nk_context (line 3381) | struct nk_context
  type nk_chart_type (line 3381) | enum nk_chart_type
  type nk_context (line 3382) | struct nk_context
  type nk_chart_type (line 3382) | enum nk_chart_type
  type nk_color (line 3382) | struct nk_color
  type nk_color (line 3382) | struct nk_color
  type nk_context (line 3383) | struct nk_context
  type nk_chart_type (line 3383) | enum nk_chart_type
  type nk_context (line 3384) | struct nk_context
  type nk_chart_type (line 3384) | enum nk_chart_type
  type nk_color (line 3384) | struct nk_color
  type nk_color (line 3384) | struct nk_color
  type nk_context (line 3385) | struct nk_context
  type nk_context (line 3386) | struct nk_context
  type nk_context (line 3387) | struct nk_context
  type nk_context (line 3388) | struct nk_context
  type nk_chart_type (line 3388) | enum nk_chart_type
  type nk_context (line 3389) | struct nk_context
  type nk_chart_type (line 3389) | enum nk_chart_type
  type nk_context (line 3395) | struct nk_context
  type nk_popup_type (line 3395) | enum nk_popup_type
  type nk_rect (line 3395) | struct nk_rect
  type nk_context (line 3396) | struct nk_context
  type nk_context (line 3397) | struct nk_context
  type nk_context (line 3403) | struct nk_context
  type nk_vec2 (line 3403) | struct nk_vec2
  type nk_context (line 3404) | struct nk_context
  type nk_vec2 (line 3404) | struct nk_vec2
  type nk_context (line 3405) | struct nk_context
  type nk_vec2 (line 3405) | struct nk_vec2
  type nk_context (line 3406) | struct nk_context
  type nk_vec2 (line 3406) | struct nk_vec2
  type nk_context (line 3407) | struct nk_context
  type nk_vec2 (line 3407) | struct nk_vec2
  type nk_context (line 3408) | struct nk_context
  type nk_vec2 (line 3408) | struct nk_vec2
  type nk_context (line 3409) | struct nk_context
  type nk_vec2 (line 3409) | struct nk_vec2
  type nk_context (line 3410) | struct nk_context
  type nk_vec2 (line 3410) | struct nk_vec2
  type nk_context (line 3416) | struct nk_context
  type nk_vec2 (line 3416) | struct nk_vec2
  type nk_context (line 3417) | struct nk_context
  type nk_vec2 (line 3417) | struct nk_vec2
  type nk_context (line 3418) | struct nk_context
  type nk_color (line 3418) | struct nk_color
  type nk_vec2 (line 3418) | struct nk_vec2
  type nk_context (line 3419) | struct nk_context
  type nk_symbol_type (line 3419) | enum nk_symbol_type
  type nk_vec2 (line 3419) | struct nk_vec2
  type nk_context (line 3420) | struct nk_context
  type nk_symbol_type (line 3420) | enum nk_symbol_type
  type nk_vec2 (line 3420) | struct nk_vec2
  type nk_context (line 3421) | struct nk_context
  type nk_symbol_type (line 3421) | enum nk_symbol_type
  type nk_vec2 (line 3421) | struct nk_vec2
  type nk_context (line 3422) | struct nk_context
  type nk_image (line 3422) | struct nk_image
  type nk_vec2 (line 3422) | struct nk_vec2
  type nk_context (line 3423) | struct nk_context
  type nk_image (line 3423) | struct nk_image
  type nk_vec2 (line 3423) | struct nk_vec2
  type nk_context (line 3424) | struct nk_context
  type nk_image (line 3424) | struct nk_image
  type nk_vec2 (line 3424) | struct nk_vec2
  type nk_context (line 3425) | struct nk_context
  type nk_context (line 3426) | struct nk_context
  type nk_context (line 3427) | struct nk_context
  type nk_image (line 3427) | struct nk_image
  type nk_context (line 3428) | struct nk_context
  type nk_image (line 3428) | struct nk_image
  type nk_context (line 3429) | struct nk_context
  type nk_symbol_type (line 3429) | enum nk_symbol_type
  type nk_context (line 3430) | struct nk_context
  type nk_symbol_type (line 3430) | enum nk_symbol_type
  type nk_context (line 3431) | struct nk_context
  type nk_context (line 3432) | struct nk_context
  type nk_context (line 3438) | struct nk_context
  type nk_vec2 (line 3438) | struct nk_vec2
  type nk_rect (line 3438) | struct nk_rect
  type nk_context (line 3439) | struct nk_context
  type nk_context (line 3440) | struct nk_context
  type nk_context (line 3441) | struct nk_context
  type nk_image (line 3441) | struct nk_image
  type nk_context (line 3442) | struct nk_context
  type nk_image (line 3442) | struct nk_image
  type nk_context (line 3443) | struct nk_context
  type nk_symbol_type (line 3443) | enum nk_symbol_type
  type nk_context (line 3444) | struct nk_context
  type nk_symbol_type (line 3444) | enum nk_symbol_type
  type nk_context (line 3445) | struct nk_context
  type nk_context (line 3446) | struct nk_context
  type nk_context (line 3452) | struct nk_context
  type nk_context (line 3454) | struct nk_context
  type nk_context (line 3455) | struct nk_context
  type nk_context (line 3457) | struct nk_context
  type nk_context (line 3458) | struct nk_context
  type nk_context (line 3464) | struct nk_context
  type nk_context (line 3465) | struct nk_context
  type nk_context (line 3466) | struct nk_context
  type nk_vec2 (line 3466) | struct nk_vec2
  type nk_context (line 3467) | struct nk_context
  type nk_vec2 (line 3467) | struct nk_vec2
  type nk_context (line 3468) | struct nk_context
  type nk_image (line 3468) | struct nk_image
  type nk_vec2 (line 3468) | struct nk_vec2
  type nk_context (line 3469) | struct nk_context
  type nk_image (line 3469) | struct nk_image
  type nk_vec2 (line 3469) | struct nk_vec2
  type nk_context (line 3470) | struct nk_context
  type nk_image (line 3470) | struct nk_image
  type nk_vec2 (line 3470) | struct nk_vec2
  type nk_context (line 3471) | struct nk_context
  type nk_symbol_type (line 3471) | enum nk_symbol_type
  type nk_vec2 (line 3471) | struct nk_vec2
  type nk_context (line 3472) | struct nk_context
  type nk_symbol_type (line 3472) | enum nk_symbol_type
  type nk_vec2 (line 3472) | struct nk_vec2
  type nk_context (line 3473) | struct nk_context
  type nk_symbol_type (line 3473) | enum nk_symbol_type
  type nk_vec2 (line 3473) | struct nk_vec2
  type nk_context (line 3474) | struct nk_context
  type nk_context (line 3475) | struct nk_context
  type nk_context (line 3476) | struct nk_context
  type nk_image (line 3476) | struct nk_image
  type nk_context (line 3477) | struct nk_context
  type nk_image (line 3477) | struct nk_image
  type nk_context (line 3478) | struct nk_context
  type nk_symbol_type (line 3478) | enum nk_symbol_type
  type nk_context (line 3479) | struct nk_context
  type nk_symbol_type (line 3479) | enum nk_symbol_type
  type nk_context (line 3480) | struct nk_context
  type nk_context (line 3481) | struct nk_context
  type nk_style_colors (line 3487) | enum nk_style_colors {
  type nk_style_cursor (line 3518) | enum nk_style_cursor {
  type nk_context (line 3528) | struct nk_context
  type nk_context (line 3529) | struct nk_context
  type nk_color (line 3529) | struct nk_color
  type nk_context (line 3530) | struct nk_context
  type nk_style_cursor (line 3530) | enum nk_style_cursor
  type nk_cursor (line 3530) | struct nk_cursor
  type nk_context (line 3531) | struct nk_context
  type nk_cursor (line 3531) | struct nk_cursor
  type nk_style_colors (line 3532) | enum nk_style_colors
  type nk_context (line 3533) | struct nk_context
  type nk_user_font (line 3533) | struct nk_user_font
  type nk_context (line 3534) | struct nk_context
  type nk_style_cursor (line 3534) | enum nk_style_cursor
  type nk_context (line 3535) | struct nk_context
  type nk_context (line 3536) | struct nk_context
  type nk_context (line 3538) | struct nk_context
  type nk_user_font (line 3538) | struct nk_user_font
  type nk_context (line 3539) | struct nk_context
  type nk_context (line 3540) | struct nk_context
  type nk_vec2 (line 3540) | struct nk_vec2
  type nk_vec2 (line 3540) | struct nk_vec2
  type nk_context (line 3541) | struct nk_context
  type nk_style_item (line 3541) | struct nk_style_item
  type nk_style_item (line 3541) | struct nk_style_item
  type nk_context (line 3542) | struct nk_context
  type nk_context (line 3543) | struct nk_context
  type nk_color (line 3543) | struct nk_color
  type nk_color (line 3543) | struct nk_color
  type nk_context (line 3545) | struct nk_context
  type nk_context (line 3546) | struct nk_context
  type nk_context (line 3547) | struct nk_context
  type nk_context (line 3548) | struct nk_context
  type nk_context (line 3549) | struct nk_context
  type nk_context (line 3550) | struct nk_context
  type nk_colorf (line 3561) | struct nk_colorf
  type nk_colorf (line 3570) | struct nk_colorf
  type nk_colorf (line 3575) | struct nk_colorf
  type nk_colorf (line 3576) | struct nk_colorf
  type nk_color (line 3591) | struct nk_color
  type nk_color (line 3592) | struct nk_color
  type nk_color (line 3593) | struct nk_color
  type nk_color (line 3594) | struct nk_color
  type nk_color (line 3595) | struct nk_color
  type nk_color (line 3597) | struct nk_color
  type nk_color (line 3598) | struct nk_color
  type nk_color (line 3599) | struct nk_color
  type nk_color (line 3601) | struct nk_color
  type nk_color (line 3602) | struct nk_color
  type nk_color (line 3603) | struct nk_color
  type nk_color (line 3604) | struct nk_color
  type nk_color (line 3605) | struct nk_color
  type nk_color (line 3606) | struct nk_color
  type nk_color (line 3608) | struct nk_color
  type nk_color (line 3609) | struct nk_color
  type nk_color (line 3610) | struct nk_color
  type nk_color (line 3611) | struct nk_color
  type nk_color (line 3612) | struct nk_color
  type nk_color (line 3613) | struct nk_color
  type nk_image (line 3624) | struct nk_image
  type nk_rect (line 3625) | struct nk_rect
  type nk_rect (line 3626) | struct nk_rect
  type nk_rect (line 3627) | struct nk_rect
  type nk_vec2 (line 3634) | struct nk_vec2
  type nk_rect (line 3634) | struct nk_rect
  type nk_heading (line 3634) | enum nk_heading
  type nk_vec2 (line 3644) | struct nk_vec2
  type nk_vec2 (line 3644) | struct nk_vec2
  type nk_rect (line 3647) | struct nk_rect
  type nk_rect (line 3648) | struct nk_rect
  type nk_user_font_glyph (line 3821) | struct nk_user_font_glyph
  type nk_user_font_glyph (line 3824) | struct nk_user_font_glyph
  type nk_user_font_glyph (line 3828) | struct nk_user_font_glyph {
  type nk_user_font (line 3840) | struct nk_user_font {
  type nk_font_coord_type (line 3856) | enum nk_font_coord_type {
  type nk_font (line 3861) | struct nk_font
  type nk_baked_font (line 3862) | struct nk_baked_font {
  type nk_font_config (line 3875) | struct nk_font_config {
  type nk_font_glyph (line 3911) | struct nk_font_glyph {
  type nk_font (line 3918) | struct nk_font {
  type nk_font_atlas_format (line 3930) | enum nk_font_atlas_format {
  type nk_font_atlas (line 3935) | struct nk_font_atlas {
  type nk_font_atlas (line 3961) | struct nk_font_atlas
  type nk_font_atlas (line 3963) | struct nk_font_atlas
  type nk_allocator (line 3963) | struct nk_allocator
  type nk_font_atlas (line 3964) | struct nk_font_atlas
  type nk_allocator (line 3964) | struct nk_allocator
  type nk_allocator (line 3964) | struct nk_allocator
  type nk_font_atlas (line 3965) | struct nk_font_atlas
  type nk_font_atlas (line 3967) | struct nk_font_atlas
  type nk_font_config (line 3967) | struct nk_font_config
  type nk_font_atlas (line 3969) | struct nk_font_atlas
  type nk_font_config (line 3969) | struct nk_font_config
  type nk_font_atlas (line 3971) | struct nk_font_atlas
  type nk_font_config (line 3971) | struct nk_font_config
  type nk_font_atlas (line 3973) | struct nk_font_atlas
  type nk_font_config (line 3973) | struct nk_font_config
  type nk_font_atlas (line 3975) | struct nk_font_atlas
  type nk_font_config (line 3975) | struct nk_font_config
  type nk_font_atlas (line 3976) | struct nk_font_atlas
  type nk_font_config (line 3976) | struct nk_font_config
  type nk_font_atlas (line 3977) | struct nk_font_atlas
  type nk_font_atlas_format (line 3977) | enum nk_font_atlas_format
  type nk_font_atlas (line 3978) | struct nk_font_atlas
  type nk_draw_null_texture (line 3978) | struct nk_draw_null_texture
  type nk_font (line 3979) | struct nk_font
  type nk_font_atlas (line 3980) | struct nk_font_atlas
  type nk_font_atlas (line 3981) | struct nk_font_atlas
  type nk_memory_status (line 4018) | struct nk_memory_status {
  type nk_allocation_type (line 4027) | enum nk_allocation_type {
  type nk_buffer_allocation_type (line 4032) | enum nk_buffer_allocation_type {
  type nk_buffer_marker (line 4038) | struct nk_buffer_marker {
  type nk_memory (line 4043) | struct nk_memory {void *ptr;nk_size size;}
  type nk_buffer (line 4044) | struct nk_buffer {
  type nk_buffer (line 4066) | struct nk_buffer
  type nk_buffer (line 4068) | struct nk_buffer
  type nk_allocator (line 4068) | struct nk_allocator
  type nk_buffer (line 4069) | struct nk_buffer
  type nk_memory_status (line 4070) | struct nk_memory_status
  type nk_buffer (line 4070) | struct nk_buffer
  type nk_buffer (line 4071) | struct nk_buffer
  type nk_buffer_allocation_type (line 4071) | enum nk_buffer_allocation_type
  type nk_buffer (line 4072) | struct nk_buffer
  type nk_buffer_allocation_type (line 4072) | enum nk_buffer_allocation_type
  type nk_buffer (line 4073) | struct nk_buffer
  type nk_buffer_allocation_type (line 4073) | enum nk_buffer_allocation_type
  type nk_buffer (line 4074) | struct nk_buffer
  type nk_buffer (line 4075) | struct nk_buffer
  type nk_buffer (line 4076) | struct nk_buffer
  type nk_buffer (line 4077) | struct nk_buffer
  type nk_buffer (line 4078) | struct nk_buffer
  type nk_str (line 4090) | struct nk_str {
  type nk_str (line 4096) | struct nk_str
  type nk_str (line 4098) | struct nk_str
  type nk_allocator (line 4098) | struct nk_allocator
  type nk_str (line 4099) | struct nk_str
  type nk_str (line 4100) | struct nk_str
  type nk_str (line 4101) | struct nk_str
  type nk_str (line 4103) | struct nk_str
  type nk_str (line 4104) | struct nk_str
  type nk_str (line 4105) | struct nk_str
  type nk_str (line 4106) | struct nk_str
  type nk_str (line 4107) | struct nk_str
  type nk_str (line 4108) | struct nk_str
  type nk_str (line 4110) | struct nk_str
  type nk_str (line 4111) | struct nk_str
  type nk_str (line 4113) | struct nk_str
  type nk_str (line 4114) | struct nk_str
  type nk_str (line 4115) | struct nk_str
  type nk_str (line 4116) | struct nk_str
  type nk_str (line 4117) | struct nk_str
  type nk_str (line 4118) | struct nk_str
  type nk_str (line 4120) | struct nk_str
  type nk_str (line 4121) | struct nk_str
  type nk_str (line 4122) | struct nk_str
  type nk_str (line 4123) | struct nk_str
  type nk_str (line 4125) | struct nk_str
  type
Copy disabled (too large) Download .json
Condensed preview — 912 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (16,043K chars).
[
  {
    "path": "BasicSamplers/CMakeLists.txt",
    "chars": 1021,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(BasicSamplers)\n\n\nset(SOURCES\n../DSPUtil/complex.cpp \n../DSPUtil/fft.cpp\nap"
  },
  {
    "path": "BasicSamplers/FrequencyDetection.cpp",
    "chars": 3726,
    "preview": "#include \"FrequencyDetection.h\"\n#include \"fft.h\"\n\n#ifndef max\n#define max(a,b)            (((a) > (b)) ? (a) : (b))\n#end"
  },
  {
    "path": "BasicSamplers/FrequencyDetection.h",
    "chars": 912,
    "preview": "#ifndef _FrequencyDetection_h\n#define _FrequencyDetection_h\n\n#include <memory.h>\n#include <math.h>\n#include <vector>\n\ncl"
  },
  {
    "path": "BasicSamplers/InstrumentMultiSampler.cpp",
    "chars": 4387,
    "preview": "#include <math.h>\n#include <memory.h>\n#include \"Sample.h\"\n#include \"InstrumentMultiSampler.h\"\n\n#ifndef max\n#define max(a"
  },
  {
    "path": "BasicSamplers/InstrumentMultiSampler.h",
    "chars": 248,
    "preview": "#ifndef _InstrumentMultiSampler_h\n#define _InstrumentMultiSampler_h\n\n#include <vector>\n\nstruct InstrumentSample;\nvoid In"
  },
  {
    "path": "BasicSamplers/InstrumentSingleSampler.cpp",
    "chars": 2494,
    "preview": "#include <math.h>\n#include <memory.h>\n#include \"Sample.h\"\n#include \"InstrumentSingleSampler.h\"\n\n#ifndef max\n#define max("
  },
  {
    "path": "BasicSamplers/InstrumentSingleSampler.h",
    "chars": 218,
    "preview": "#ifndef _InstrumentSingleSampler_h\n#define _InstrumentSingleSampler_h\n\nstruct InstrumentSample;\nvoid InstrumentSingleSam"
  },
  {
    "path": "BasicSamplers/PercussionSampler.cpp",
    "chars": 2631,
    "preview": "#include <math.h>\n#include <memory.h>\n#include \"Sample.h\"\n#include \"PercussionSampler.h\"\n\n#ifndef max\n#define max(a,b)  "
  },
  {
    "path": "BasicSamplers/PercussionSampler.h",
    "chars": 181,
    "preview": "#ifndef _PercussionSampler_h\n#define _PercussionSampler_h\n\nstruct Sample;\nvoid PercussionSample(const Sample& sample, fl"
  },
  {
    "path": "BasicSamplers/Sample.h",
    "chars": 251,
    "preview": "#pragma once\n\nstruct Sample\n{\n\tSample() {}\n\tvirtual ~Sample() {}\n\n\tunsigned m_wav_length;\n\tunsigned m_chn;\n\tfloat *m_wav"
  },
  {
    "path": "BasicSamplers/api.cpp",
    "chars": 5087,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "CMakeLists.txt",
    "chars": 680,
    "preview": "cmake_minimum_required (VERSION 3.0)\nproject(ScoreDraft)\n\nIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)\n  SET(CMAKE_IN"
  },
  {
    "path": "DSPUtil/complex.cpp",
    "chars": 1254,
    "preview": "#include <math.h>\n#include \"stdio.h\"\n#include \"complex.h\"\n\ndouble DCEnergy(const DComp* c)\n{\n\treturn c->Im*c->Im + c->Re"
  },
  {
    "path": "DSPUtil/complex.h",
    "chars": 504,
    "preview": "#ifndef YF_COMPLEX\n#define YF_COMPLEX\ntypedef struct\n{\n\tdouble Re;\n\tdouble Im;\n}DComp;\ndouble DCEnergy(const DComp* c);\n"
  },
  {
    "path": "DSPUtil/fft.cpp",
    "chars": 1196,
    "preview": "#include \"fft.h\"\n#include \"math.h\"\nvoid fft(DComp *a,unsigned l)\n{\n\tDComp u,w,t;\t\n\tunsigned n=1,nv2,i,j,k;\n\tunsigned le,"
  },
  {
    "path": "DSPUtil/fft.h",
    "chars": 165,
    "preview": "#ifndef YF_FFT\n#define YF_FFT\n#include \"complex.h\"\n#define PI 3.1415926535897932384626433832795\nvoid fft(DComp *a,unsign"
  },
  {
    "path": "KarplusStrong/CMakeLists.txt",
    "chars": 735,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(KarplusStrong)\n\nset (INCLUDE_DIR\n../ScoreDraftCore\n../DSPUtil\n)\n\n\nif (WIN3"
  },
  {
    "path": "KarplusStrong/KarplusStrong.cpp",
    "chars": 3126,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "LICENSE",
    "chars": 1683,
    "preview": "Copyright (C) 2018 - 2021 Fei Yang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis"
  },
  {
    "path": "MIDIWriter/CMakeLists.txt",
    "chars": 480,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(MIDIWriter)\n\nif (WIN32) \nset (DEFINES  ${DEFINES}\n-D\"_CRT_SECURE_NO_DEPREC"
  },
  {
    "path": "MIDIWriter/MIDIWriter.cpp",
    "chars": 4942,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "Meteor/CMakeLists.txt",
    "chars": 1214,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(Meteor)\n\nset(SOURCES\napi.cpp\nMeteor.cpp\nMeteorPlayer.cpp\nDrawText.cpp\n)\n\ns"
  },
  {
    "path": "Meteor/DrawText.cpp",
    "chars": 4857,
    "preview": "#include \"DrawText.h\"\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#include <cmath>\n#include <cstdlib>\n#include <cstdi"
  },
  {
    "path": "Meteor/DrawText.h",
    "chars": 223,
    "preview": "#pragma once\n\n#include <vector>\n\nclass Text\n{\npublic:\n\tText(const char* text, int size = 32);\n\t~Text();\n\n\tint m_width = "
  },
  {
    "path": "Meteor/Meteor.cpp",
    "chars": 7057,
    "preview": "#include \"Meteor.h\"\n#include \"blob.hpp\"\n#include \"base64.hpp\"\n\nvoid Meteor::_updateSublists()\n{\n\tm_notes_sublists.SetDat"
  },
  {
    "path": "Meteor/Meteor.h",
    "chars": 2546,
    "preview": "#pragma once\n\n#include <string>\n#include <vector>\n#include <cstdint>\n\nclass Event\n{\npublic:\n\tunsigned type;\n\tunsigned in"
  },
  {
    "path": "Meteor/MeteorPlayer.cpp",
    "chars": 20501,
    "preview": "#include <thread>\n#include <mutex>\n#include <vector>\n#include <list>\n#include <queue>\n#include <unordered_set>\n#include "
  },
  {
    "path": "Meteor/MeteorPlayer.h",
    "chars": 2548,
    "preview": "#pragma once\n\n#include <memory>\n#include <mutex>\n#include <string>\n#include <unordered_map>\n\ntypedef std::unordered_map<"
  },
  {
    "path": "Meteor/SubListLookUp.h",
    "chars": 2705,
    "preview": "#ifndef _SubListLookUp_h\n#define _SubListLookUp_h\n\n#include <vector>\n#include <float.h>\n#include <stdio.h>\n#include <cma"
  },
  {
    "path": "Meteor/api.cpp",
    "chars": 3646,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "Meteor/base64.hpp",
    "chars": 1352,
    "preview": "#pragma once\n\n#include <string>\n#include <vector>\n#include <stdexcept>\n#include <cstdint>\n\ninline void base64_encode(con"
  },
  {
    "path": "Meteor/blob.hpp",
    "chars": 267,
    "preview": "#pragma once\n\n#include <vector>\n#include <cstdint>\n#include <cstddef>\n#include <memory.h>\n\ninline void blob_write(std::v"
  },
  {
    "path": "PCMPlayer/CMakeLists.txt",
    "chars": 1007,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(PCMPlayer)\n\nset(SOURCES\n../DSPUtil/complex.cpp\n../DSPUtil/fft.cpp\napi.cpp\n"
  },
  {
    "path": "PCMPlayer/PCMPlayer.cpp",
    "chars": 11562,
    "preview": "#include <thread>\n#include <mutex>\n#include <vector>\n#include <list>\n#include <queue>\n#include <memory.h>\n#include <cmat"
  },
  {
    "path": "PCMPlayer/PCMPlayer.h",
    "chars": 1541,
    "preview": "#pragma once\n\n#include <memory>\n#include <mutex>\n#include \"fft.h\"\n\nnamespace std\n{\n\tclass thread;\n}\n\n#define AUDIO_BUF_L"
  },
  {
    "path": "PCMPlayer/api.cpp",
    "chars": 1036,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "README.md",
    "chars": 5560,
    "preview": "[-> 中文Readme](README_cn.md)\n\n# ScoreDraft\n\nScoreDraft is a music/singing synthesizer that provides a Python based \nscore"
  },
  {
    "path": "README_cn.md",
    "chars": 3546,
    "preview": "# ScoreDraft\n\nScoreDraft 是一个音乐和歌唱合成系统,它提供了基于Python的乐谱创作(或录入)界面。\n\n目前,它集成了下列几种合成引擎:\n\n* 乐器合成\n  - SimpleInstruments: 基于简单数学函"
  },
  {
    "path": "ScoreDraftCore/CMakeLists.txt",
    "chars": 706,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(ScoreDraftCore)\n\nset(SOURCES\napi.cpp\nTrackBuffer.cpp\nReadWav.cpp\nWriteWav."
  },
  {
    "path": "ScoreDraftCore/ReadWav.cpp",
    "chars": 3060,
    "preview": "#include \"ReadWav.h\"\n#include <cmath>\n\n#ifndef max\n#define max(a,b)            (((a) > (b)) ? (a) : (b))\n#endif\n\n#ifndef"
  },
  {
    "path": "ScoreDraftCore/ReadWav.h",
    "chars": 418,
    "preview": "#ifndef _ReadWav_h\n#define _ReadWav_h\n\n#include <stdio.h>\nclass ReadWav\n{\npublic:\n\tReadWav();\n\t~ReadWav();\n\n\tbool OpenFi"
  },
  {
    "path": "ScoreDraftCore/TrackBuffer.cpp",
    "chars": 7993,
    "preview": "#include <memory.h>\n#include <cmath>\n#include <cassert>\n#include \"TrackBuffer.h\"\n#include \"utils.h\"\n\nstatic const unsign"
  },
  {
    "path": "ScoreDraftCore/TrackBuffer.h",
    "chars": 1490,
    "preview": "#pragma once \n\n#include <cstdio>\n#include <vector>\n#include \"WavBuffer.h\"\n\n\nclass SCOREDRAFTCORE_API TrackBuffer\n{\npubli"
  },
  {
    "path": "ScoreDraftCore/WavBuffer.h",
    "chars": 564,
    "preview": "#pragma once\n\n#include \"api.h\"\n#include <vector>\n\nclass SCOREDRAFTCORE_API WavBuffer\n{\n\tstd::vector<float> _data;\npublic"
  },
  {
    "path": "ScoreDraftCore/WriteWav.cpp",
    "chars": 2587,
    "preview": "#include \"WriteWav.h\"\n\n#ifndef max\n#define max(a,b)            (((a) > (b)) ? (a) : (b))\n#endif\n\n#ifndef min\n#define min"
  },
  {
    "path": "ScoreDraftCore/WriteWav.h",
    "chars": 454,
    "preview": "#ifndef _WriteWav_h\n#define _WriteWav_h\n\n#include <stdio.h>\nclass WriteWav\n{\npublic:\n\tWriteWav();\n\t~WriteWav();\n\n\tbool O"
  },
  {
    "path": "ScoreDraftCore/api.cpp",
    "chars": 7961,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "ScoreDraftCore/api.h",
    "chars": 378,
    "preview": "#pragma once\n\n#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#pragma warning( disable: 4"
  },
  {
    "path": "ScoreDraftCore/utils.h",
    "chars": 3013,
    "preview": "#pragma once\n#include <cstdint>\n#include <chrono>\n#include <mutex>\n#include <condition_variable>\n#include <vector>\n\n\ninl"
  },
  {
    "path": "SimpleInstruments/CMakeLists.txt",
    "chars": 710,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(SimpleInstruments)\n\nset (INCLUDE_DIR\n../ScoreDraftCore\n)\n\n\nif (WIN32) \nset"
  },
  {
    "path": "SimpleInstruments/SimpleInstruments.cpp",
    "chars": 4854,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "SoundFont2/CMakeLists.txt",
    "chars": 788,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nproject(SoundFont2)\n\n\nset(SOURCES\napi.cpp\nSF2.cpp\nPresets.cpp\nSynth.cpp\nSF2Synth.c"
  },
  {
    "path": "SoundFont2/Presets.cpp",
    "chars": 17392,
    "preview": "#include \"Presets.h\"\n\n\n#if !defined(TSF_POW) || !defined(TSF_POWF) || !defined(TSF_EXPF) || !defined(TSF_LOG) || !define"
  },
  {
    "path": "SoundFont2/Presets.h",
    "chars": 2712,
    "preview": "#ifndef _Presets_h\n#define _Presets_h\n\n#include \"SF2.h\"\n\n#include <stdio.h>\n\nenum { TSF_LOOPMODE_NONE, TSF_LOOPMODE_CONT"
  },
  {
    "path": "SoundFont2/SF2.cpp",
    "chars": 5454,
    "preview": "#include \"SF2.h\"\n\nstruct tsf_riffchunk { tsf_fourcc id; tsf_u32 size; };\n#define TSF_FourCCEquals(value1, value2) (value"
  },
  {
    "path": "SoundFont2/SF2.h",
    "chars": 4251,
    "preview": "#ifndef __SF2_h\n#define __SF2_h\n\n#include <vector>\n#include <memory>\n\n#if !defined(TSF_MALLOC) || !defined(TSF_FREE) || "
  },
  {
    "path": "SoundFont2/SF2Synth.cpp",
    "chars": 15520,
    "preview": "#include \"SF2Synth.h\"\n#include <memory>\n\nstruct LowPass\n{\n\tchar active;\n\tdouble QInv;\n\tdouble a0, a1, b1, b2;\n};\n\nstruct"
  },
  {
    "path": "SoundFont2/SF2Synth.h",
    "chars": 350,
    "preview": "#ifndef _SF2Synth_h\n#define _SF2Synth_h\n\n#include \"SF2.h\"\n#include \"Presets.h\"\n#include \"Synth.h\"\n\n#include <memory>\n\nvo"
  },
  {
    "path": "SoundFont2/Synth.cpp",
    "chars": 3584,
    "preview": "#include \"Synth.h\"\n#include <cmath>\n\nvoid Synth(const float* input, float* outputBuffer, unsigned numSamples, NoteState&"
  },
  {
    "path": "SoundFont2/Synth.h",
    "chars": 944,
    "preview": "#ifndef _Synth_h\n#define _Synth_h\n\n#include <vector>\n\nstruct LowPassState\n{\n\tdouble z1, z2;\n};\n\nstruct NoteState\n{\n\tdoub"
  },
  {
    "path": "SoundFont2/api.cpp",
    "chars": 2729,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "Test/FlyMeToTheMoon.py",
    "chars": 4506,
    "preview": "#!/usr/bin/python3\n\nimport os \nimport ScoreDraft\nfrom ScoreDraft.Notes import *\n\ndef soS(octave=5, duration=48):\n\treturn"
  },
  {
    "path": "Test/FlyMeToTheMoon_eq.py",
    "chars": 3767,
    "preview": "#!/usr/bin/python3\r\rimport ScoreDraft\rfrom ScoreDraft.Notes import *\r\rdef soS(octave=5, duration=48):\r\treturn note(octav"
  },
  {
    "path": "Test/Hello.py",
    "chars": 323,
    "preview": "#!/usr/bin/python3\n\nimport ScoreDraft\nfrom ScoreDraft.Notes import *\n\ndoc=ScoreDraft.Document()\n\nseq=[do(),do(),so(),so("
  },
  {
    "path": "Test/HelloMeteor.py",
    "chars": 239,
    "preview": "#!/usr/bin/python3\n\nimport ScoreDraft\nfrom ScoreDraft.Notes import *\n\ndoc=ScoreDraft.MeteorDocument()\n\nseq=[do(),do(),so"
  },
  {
    "path": "Test/InstrumentSamples/Ah.freq",
    "chars": 11,
    "preview": "261.055817\n"
  },
  {
    "path": "Test/InstrumentSamples/Cello.freq",
    "chars": 10,
    "preview": "65.430267\n"
  },
  {
    "path": "Test/InstrumentSamples/CleanGuitar.freq",
    "chars": 11,
    "preview": "263.026093\n"
  },
  {
    "path": "Test/InstrumentSamples/Lah.freq",
    "chars": 11,
    "preview": "260.946747\n"
  },
  {
    "path": "Test/InstrumentSamples/Piano/Alesis-Fusion-Bright-Acoustic-Piano-C2.freq",
    "chars": 10,
    "preview": "66.116943\n"
  },
  {
    "path": "Test/InstrumentSamples/Piano/Alesis-Fusion-Bright-Acoustic-Piano-C4.freq",
    "chars": 11,
    "preview": "264.071869\n"
  },
  {
    "path": "Test/InstrumentSamples/Piano/Alesis-Fusion-Bright-Acoustic-Piano-C6.freq",
    "chars": 12,
    "preview": "1050.000000\n"
  },
  {
    "path": "Test/InstrumentSamples/String.freq",
    "chars": 11,
    "preview": "262.500000\n"
  },
  {
    "path": "Test/InstrumentSamples/Violin.freq",
    "chars": 11,
    "preview": "525.000000\n"
  },
  {
    "path": "Test/PrintCatalog.py",
    "chars": 64,
    "preview": "#!/usr/bin/python3\n\nimport ScoreDraft\nScoreDraft.PrintCatalog()\n"
  },
  {
    "path": "Test/ZhenDeAiNi.ly",
    "chars": 2422,
    "preview": "\\version \"2.18.2\"\n\\header\n{\n\ttitle = \"真的爱你\"\n\tcomposer = \"黄家驹\"\n}\n\\score\n{\n\t<<\n\t\t\\new Staff \\relative c''\n\t\t{\n\t\t\t\\time 2/4"
  },
  {
    "path": "Test/ZhenDeAiNi.xml",
    "chars": 74712,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE score-partwise PUBLIC \"-//Recordare//DTD MusicXML 2.0 Partwise//EN\"\n   "
  },
  {
    "path": "Test/ZhenDeAiNi.yaml",
    "chars": 4078,
    "preview": "score:\n    title: 真的爱你\n    composer: 黄家驹\n    tempo: 72    \n    staffs:\n        -\n            is_drum: false\n            "
  },
  {
    "path": "Test/percussion_test.py",
    "chars": 500,
    "preview": "#!/usr/bin/python3\n\nimport ScoreDraft\n\nBassDrum=ScoreDraft.BassDrum()\nSnare=ScoreDraft.Snare()\n\nperc_list= [BassDrum, Sn"
  },
  {
    "path": "Test/piano_test.py",
    "chars": 975,
    "preview": "#!/usr/bin/python3\nimport ScoreDraft\nfrom ScoreDraft.Notes import *\n\nPiano = ScoreDraft.Piano()\n\ndoc=ScoreDraft.Document"
  },
  {
    "path": "Test/sunshine.yaml",
    "chars": 2002,
    "preview": "score:\n    tempo: 150\n    title: You Are My Sunshine\n    composer: Jimmie Davis\n    staffs:\n        -\n            relati"
  },
  {
    "path": "Test/test.yaml",
    "chars": 225,
    "preview": "score:\n    title: My song\n    composer: Me\n    tempo: 120\n    staffs:\n        - relative: c'\n          instrument: Karpl"
  },
  {
    "path": "Test/test_xml.py",
    "chars": 269,
    "preview": "import ScoreDraft as sd\n\n# doc = sd.from_music_xml(\"ZhenDeAiNi.xml\")\ndoc = sd.from_lilypond(\"ZhenDeAiNi.ly\")\n\ninstrument"
  },
  {
    "path": "Test/test_yaml.py",
    "chars": 37,
    "preview": "import ScoreDraft as sd\nsd.run_yaml()"
  },
  {
    "path": "VoiceSampler/CMakeLists.txt",
    "chars": 1422,
    "preview": "cmake_minimum_required (VERSION 3.0)\nproject(VoiceSampler)\n\nset(USE_CUDA true CACHE BOOL \"Voice Sampler Use CUDA\")\n\nif ("
  },
  {
    "path": "VoiceSampler/DVVector.hpp",
    "chars": 2950,
    "preview": "#include <vector>\n\ntemplate <class T>\nstruct VectorView\n{\n\tunsigned count;\n\tT* d_data;\n};\n\ntemplate <class T>\nclass DVVe"
  },
  {
    "path": "VoiceSampler/FrequencyDetection.cpp",
    "chars": 1515,
    "preview": "#include \"FrequencyDetection.h\"\n#include \"fft.h\"\n#include <memory.h>\n#include <stdio.h>\n#include <math.h>\n\n#ifndef max\n#"
  },
  {
    "path": "VoiceSampler/FrequencyDetection.h",
    "chars": 169,
    "preview": "#ifndef _FrequencyDetection_h\n#define _FrequencyDetection_h\n\nvoid fetchFrequency(unsigned length, float *samples, unsign"
  },
  {
    "path": "VoiceSampler/HNM.cu",
    "chars": 12453,
    "preview": "#include <cuda_runtime.h>\n#include <cmath>\n#include <VoiceUtil.cuh>\n\n#include <stdio.h>\n\nunsigned calcGroupSize(unsigned"
  },
  {
    "path": "VoiceSampler/SentenceDescriptor.h",
    "chars": 735,
    "preview": "#ifndef __SentenceDescriptor_h\n#define __SentenceDescriptor_h\n\n#include <vector>\n\nstruct Wav\n{\n\tfloat *buf;\n\tunsigned le"
  },
  {
    "path": "VoiceSampler/SentenceGeneratorCPU.cpp",
    "chars": 11748,
    "preview": "#include \"SentenceDescriptor.h\"\n#include \"SentenceGeneratorGeneral.h\"\n#include \"SentenceGeneratorCPU.h\"\n\n#include \"fft.h"
  },
  {
    "path": "VoiceSampler/SentenceGeneratorCPU.h",
    "chars": 197,
    "preview": "#ifndef __SentenceGeneratorCPU_h\n#define __SentenceGeneratorCPU_h\n\nstruct SentenceDescriptor;\nvoid GenerateSentenceCPU(c"
  },
  {
    "path": "VoiceSampler/SentenceGeneratorCUDA.cpp",
    "chars": 17237,
    "preview": "#include <cuda_runtime.h>\n#include <cstdio>\n#include \"SentenceDescriptor.h\"\n#include \"SentenceGeneratorGeneral.h\"\n#inclu"
  },
  {
    "path": "VoiceSampler/SentenceGeneratorCUDA.h",
    "chars": 200,
    "preview": "#ifndef __SentenceGeneratorCUDA_h\n#define __SentenceGeneratorCUDA_h\n\nstruct SentenceDescriptor;\nvoid GenerateSentenceCUD"
  },
  {
    "path": "VoiceSampler/SentenceGeneratorGeneral.cpp",
    "chars": 3113,
    "preview": "#include \"SentenceDescriptor.h\"\n#include \"SentenceGeneratorGeneral.h\"\n\nstatic float rate = 44100.0f;\n\ninline void Clamp0"
  },
  {
    "path": "VoiceSampler/SentenceGeneratorGeneral.h",
    "chars": 357,
    "preview": "#ifndef __SentenceGeneratorGeneral_h\n#define __SentenceGeneratorGeneral_h\n\n#include \"VoiceUtil.h\"\nusing namespace VoiceU"
  },
  {
    "path": "VoiceSampler/VoiceUtil.cuh",
    "chars": 11876,
    "preview": "#include \"fft.cuh\"\n#ifndef max\n#define max(a,b)            (((a) > (b)) ? (a) : (b))\n#endif\n\n#ifndef min\n#define min(a,b"
  },
  {
    "path": "VoiceSampler/VoiceUtil.h",
    "chars": 23471,
    "preview": "#ifndef _VoiceUtil_h\n#define _VoiceUtil_h\n\n#define Symmetric_Type_Axis 0\n#define Symmetric_Type_Center 1\n#define Symmetr"
  },
  {
    "path": "VoiceSampler/api.cpp",
    "chars": 8134,
    "preview": "#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)\n#define SCOREDRAFT_API __declspec(dllexpo"
  },
  {
    "path": "VoiceSampler/fft.cuh",
    "chars": 3951,
    "preview": "#include \"helper_math.h\"\n#define PI ((float)3.1415926535897932384626433832795)\n\n__device__\nunsigned short reverseBits(un"
  },
  {
    "path": "VoiceSampler/helper_math.h",
    "chars": 37310,
    "preview": "/**\n * Copyright 1993-2013 NVIDIA Corporation.  All rights reserved.\n *\n * Please refer to the NVIDIA end user license a"
  },
  {
    "path": "docs/README.md",
    "chars": 314,
    "preview": "# ScoreDraft\n\n## Introduction\n\n[Introduction in English](intro_eng.md)\n\n[中文使用说明](intro_cn.md)\n\n\n## Meteor Demos\n\n### Eng"
  },
  {
    "path": "docs/_config.yml",
    "chars": 26,
    "preview": "theme: jekyll-theme-hacker"
  },
  {
    "path": "docs/intro_cn.html_files/github-markdown.css",
    "chars": 12899,
    "preview": "@font-face {\n  font-family: octicons-link;\n  src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAA"
  },
  {
    "path": "docs/intro_cn.md",
    "chars": 21184,
    "preview": "# ScoreDraft 使用说明\n\nScoreDraft 源代码位于 [GitHub](https://github.com/fynv/ScoreDraft),那里你总是可以找到我最新提交的修改。\n\n可通过以下命令下载 PyPi 包,支持"
  },
  {
    "path": "docs/intro_eng.md",
    "chars": 35006,
    "preview": "# Introduction to ScoreDraft\n\nThe source-code of ScoreDraft is hosted on [GitHub](https://github.com/fynv/ScoreDraft), w"
  },
  {
    "path": "docs/meteor/MyLove.html_files/github-markdown.css",
    "chars": 12899,
    "preview": "@font-face {\n  font-family: octicons-link;\n  src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAA"
  },
  {
    "path": "docs/meteor/MyLove.md",
    "chars": 19282,
    "preview": "<script type=\"text/javascript\" src=\"meteor.js\"></script>\n\n<script type=\"text/javascript\">\n    window.onload = function()"
  },
  {
    "path": "docs/meteor/SoreFeetSong.md",
    "chars": 13983,
    "preview": "<script type=\"text/javascript\" src=\"meteor.js\"></script>\n\n<script type=\"text/javascript\">\n    window.onload = function()"
  },
  {
    "path": "docs/meteor/TaLang.md",
    "chars": 17965,
    "preview": "<script type=\"text/javascript\" src=\"meteor.js\"></script>\n\n<script type=\"text/javascript\">\n    window.onload = function()"
  },
  {
    "path": "docs/meteor/WuYa.md",
    "chars": 17679,
    "preview": "<script type=\"text/javascript\" src=\"meteor.js\"></script>\n\n<script type=\"text/javascript\">\n    window.onload = function()"
  },
  {
    "path": "docs/meteor/meteor.js",
    "chars": 16959,
    "preview": "\nvar blackPos=[1, 2, 4, 5, 6];\nvar whitePitchs=[0, 2, 4, 5, 7, 9, 11];\nvar blackPitchs=[1, 3, 6, 8, 10];\nvar keyPos = [0"
  },
  {
    "path": "docs/meteor/ouchi.md",
    "chars": 24001,
    "preview": "<script type=\"text/javascript\" src=\"meteor.js\"></script>\n\n<script type=\"text/javascript\">\n    window.onload = function()"
  },
  {
    "path": "docs/meteor/tiktok.md",
    "chars": 18195,
    "preview": "<script type=\"text/javascript\" src=\"meteor.js\"></script>\n\n<script type=\"text/javascript\">\n    window.onload = function()"
  },
  {
    "path": "python/CMakeLists.txt",
    "chars": 1155,
    "preview": "cmake_minimum_required (VERSION 3.0)\n\nset(PYTHON\nScoreDraft/__init__.py\nScoreDraft/ScoreDraftCore.py\nScoreDraft/Catalog."
  },
  {
    "path": "python/README.md",
    "chars": 170,
    "preview": "ScoreDraft\n================\n\n[ScoreDraft](https://github.com/fynv/ScoreDraft) is a music/singing \nsynthesizer that provi"
  },
  {
    "path": "python/ScoreDraft/BasicSamplers.py",
    "chars": 5177,
    "preview": "import os\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\nvoid* SampleCreate(unsigned origin_sample_rate, unsigned chn, v"
  },
  {
    "path": "python/ScoreDraft/CVVCChineseConverter.py",
    "chars": 2121,
    "preview": "def getCV(CVLyric):\n    vowels= [\"a\",\"e\",\"i\",\"o\",\"u\",\"v\"]\n    min_i=len(CVLyric)\n    for c in vowels:\n        i=CVLyric."
  },
  {
    "path": "python/ScoreDraft/Catalog.py",
    "chars": 156,
    "preview": "import json\n\nCatalog= {\n'Engines' : [],\n'Instruments': [],\n'Percussions': [],\n'Singers': [] \t\n}\n\ndef PrintCatalog():\n\tpr"
  },
  {
    "path": "python/ScoreDraft/Document.py",
    "chars": 3224,
    "preview": "from .ScoreDraftCore import TrackBuffer\nfrom .ScoreDraftCore import MixTrackBufferList\nfrom .ScoreDraftCore import Write"
  },
  {
    "path": "python/ScoreDraft/Initializers.py",
    "chars": 4021,
    "preview": "import os\nfrom .Catalog import Catalog\n\nfrom .Instrument import Instrument\nfrom .Percussion import Percussion\nfrom .Sing"
  },
  {
    "path": "python/ScoreDraft/Instrument.py",
    "chars": 4968,
    "preview": "import numbers\n\ndef isNumber(x):\n    return isinstance(x, numbers.Number)\n\ndef GetTempoMap(tMap, beat48):\n    for i in r"
  },
  {
    "path": "python/ScoreDraft/JPVCVConverter.py",
    "chars": 1569,
    "preview": "dict = {\n'あ':'a', 'い':'i', 'う':'u', 'え':'e', 'お':'o',\n'か':'a', 'き':'i', 'く':'u', 'け':'e', 'こ':'o',\n'が':'a', 'ぎ':'i', 'ぐ'"
  },
  {
    "path": "python/ScoreDraft/KarplusStrong.py",
    "chars": 1550,
    "preview": "import os\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\nvoid KarplusStrongGenerate(void* ptr_wavbuf, float freq, float "
  },
  {
    "path": "python/ScoreDraft/MIDIWriter.py",
    "chars": 1260,
    "preview": "import os\nfrom cffi import FFI\nfrom .ScoreDraftCore import ObjArray\n\nffi = FFI()\nffi.cdef(\"\"\"\nvoid* NoteCreate(float fre"
  },
  {
    "path": "python/ScoreDraft/Meteor.py",
    "chars": 9778,
    "preview": "import os\nfrom cffi import FFI\nfrom .ScoreDraftCore import ObjArray\n\nffi = FFI()\nffi.cdef(\"\"\"\nvoid* CtrlPntCreate(double"
  },
  {
    "path": "python/ScoreDraft/MusicXMLDocument.py",
    "chars": 2529,
    "preview": "from .musicxml import ScorePartwise\nfrom xsdata.formats.dataclass.parsers import XmlParser\ntry:\n    from .Meteor import "
  },
  {
    "path": "python/ScoreDraft/Notes.py",
    "chars": 1167,
    "preview": "Freqs=[2.0**(v/12.0) for v in range(12)]\n\nfC=1.0\nfCS=Freqs[1]\nfDb=Freqs[1]\nfD=Freqs[2]\nfDS=Freqs[3]\nfEb=Freqs[3]\nfE=Freq"
  },
  {
    "path": "python/ScoreDraft/PCMPlayer.py",
    "chars": 1668,
    "preview": "import os\nimport threading\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\nvoid* PCMPlayerCreate(double sample_rate, unsi"
  },
  {
    "path": "python/ScoreDraft/Percussion.py",
    "chars": 3968,
    "preview": "import numbers\n\ndef isNumber(x):\n    return isinstance(x, numbers.Number)\n\ndef GetTempoMap(tMap, beat48):\n    for i in r"
  },
  {
    "path": "python/ScoreDraft/RapChinese.py",
    "chars": 498,
    "preview": "baseFreq=1.0\n\ndef SetRapBaseFreq(freq):\n    global baseFreq   \n    baseFreq=freq\n\ndef CRap(lyric, tone, duration=48):\n  "
  },
  {
    "path": "python/ScoreDraft/ScoreDraftCore.py",
    "chars": 9040,
    "preview": "import os\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\n// general\nvoid* PtrArrayCreate(unsigned long long size, const "
  },
  {
    "path": "python/ScoreDraft/SimpleInstruments.py",
    "chars": 2335,
    "preview": "import os\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\nvoid GeneratePureSin(void* ptr_wavbuf, float freq, float fdurat"
  },
  {
    "path": "python/ScoreDraft/Singer.py",
    "chars": 9101,
    "preview": "import numbers\n\ndef isNumber(x):\n    return isinstance(x, numbers.Number)\n\ndef GetTempoMap(tMap, beat48):\n    for i in r"
  },
  {
    "path": "python/ScoreDraft/SoundFont2.py",
    "chars": 3524,
    "preview": "import os\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\n// SF2Bank\nvoid* SF2BankCreate(const char* filename);\nvoid SF2B"
  },
  {
    "path": "python/ScoreDraft/TTEnglishConverter.py",
    "chars": 5276,
    "preview": "import os\nimport pickle\nScoreDraftPath= os.path.dirname(__file__)\n\nlyricSet=set()\nlyricPrefixSet=set()\nvowelSet={'eI','a"
  },
  {
    "path": "python/ScoreDraft/TsuroVCVConverter.py",
    "chars": 1397,
    "preview": "def getVowel(CVLyric):\n    vowels= [\"a\",\"e\",\"i\",\"o\",\"u\",\"v\"]\n    min_i=len(CVLyric)\n    for c in vowels:\n        i=CVLyr"
  },
  {
    "path": "python/ScoreDraft/UTAUUtils.py",
    "chars": 5206,
    "preview": "from .VoiceSampler import FrqDataPoint,FrqData\nimport struct\nimport os\nimport math\nimport re\n\ndef LoadFrq(filename):\n   "
  },
  {
    "path": "python/ScoreDraft/UtauDraft.py",
    "chars": 10097,
    "preview": "import wave\nfrom .ScoreDraftCore import F32Buf\nfrom .UTAUUtils import VoiceBank\nfrom .Singer import Singer\nfrom .Catalog"
  },
  {
    "path": "python/ScoreDraft/VCCVEnglishConverter.py",
    "chars": 5310,
    "preview": "import os\nimport pickle\nScoreDraftPath= os.path.dirname(__file__)\n\nlyricSet=set()\nlyricPrefixSet=set()\nvowelSet={'a','e'"
  },
  {
    "path": "python/ScoreDraft/VoiceSampler.py",
    "chars": 5068,
    "preview": "import os\nfrom cffi import FFI\n\nffi = FFI()\nffi.cdef(\"\"\"\nunsigned HaveCUDA();\nvoid* FrqDataPointCreate(double freq, doub"
  },
  {
    "path": "python/ScoreDraft/XiaYYConverter.py",
    "chars": 2916,
    "preview": "def getCV(CVLyric):\n    vowels= [\"a\",\"e\",\"i\",\"o\",\"u\",\"v\"]\n    min_i=len(CVLyric)\n    for c in vowels:\n        i=CVLyric."
  },
  {
    "path": "python/ScoreDraft/YAMLDocument.py",
    "chars": 17176,
    "preview": "from xsdata.formats.dataclass.parsers import XmlParser\nimport ly.musicxml\nimport yaml\n\nfrom .MusicXMLDocument import Mus"
  },
  {
    "path": "python/ScoreDraft/__init__.py",
    "chars": 3960,
    "preview": "import numbers\n\ndef isNumber(x):\n    return isinstance(x, numbers.Number)\n\ndef TellDuration(seq):\n    duration = 0\n    f"
  },
  {
    "path": "python/ScoreDraft/musicxml/__init__.py",
    "chars": 11367,
    "preview": "from .musicxml import (\n    AboveBelow,\n    Accidental,\n    AccidentalMark,\n    AccidentalText,\n    AccidentalValue,\n   "
  },
  {
    "path": "python/ScoreDraft/musicxml/musicxml.py",
    "chars": 546607,
    "preview": "from dataclasses import dataclass, field\nfrom decimal import Decimal\nfrom enum import Enum\nfrom typing import List, Opti"
  },
  {
    "path": "python/ScoreDraft/musicxml/xlink.py",
    "chars": 358,
    "preview": "from enum import Enum\n\n__NAMESPACE__ = \"http://www.w3.org/1999/xlink\"\n\n\nclass ActuateValue(Enum):\n    ON_REQUEST = \"onRe"
  },
  {
    "path": "python/ScoreDraft/musicxml/xml.py",
    "chars": 194,
    "preview": "from enum import Enum\n\n__NAMESPACE__ = \"http://www.w3.org/XML/1998/namespace\"\n\n\nclass LangValue(Enum):\n    VALUE = \"\"\n\n\n"
  },
  {
    "path": "python/setup.py",
    "chars": 923,
    "preview": "from setuptools import setup\nfrom codecs import open\nimport os\n\nhere = os.path.abspath(os.path.dirname(__file__))\n\nwith "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/ftconfig.h",
    "chars": 1614,
    "preview": "/****************************************************************************\n *\n * ftconfig.h\n *\n *   ANSI-specific con"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/ftheader.h",
    "chars": 23593,
    "preview": "/****************************************************************************\n *\n * ftheader.h\n *\n *   Build macros of t"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/ftmodule.h",
    "chars": 1385,
    "preview": "/*\n * This file registers the FreeType modules compiled into the library.\n *\n * If you use GNU make, this file IS NOT US"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/ftoption.h",
    "chars": 39657,
    "preview": "/****************************************************************************\n *\n * ftoption.h\n *\n *   User-selectable c"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/ftstdlib.h",
    "chars": 4307,
    "preview": "/****************************************************************************\n *\n * ftstdlib.h\n *\n *   ANSI-specific lib"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/integer-types.h",
    "chars": 7036,
    "preview": "/****************************************************************************\n *\n * config/integer-types.h\n *\n *   FreeT"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/mac-support.h",
    "chars": 1597,
    "preview": "/****************************************************************************\n *\n * config/mac-support.h\n *\n *   Mac/OS "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/config/public-macros.h",
    "chars": 3672,
    "preview": "/****************************************************************************\n *\n * config/public-macros.h\n *\n *   Defin"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/freetype.h",
    "chars": 163281,
    "preview": "/****************************************************************************\n *\n * freetype.h\n *\n *   FreeType high-lev"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftadvanc.h",
    "chars": 5470,
    "preview": "/****************************************************************************\n *\n * ftadvanc.h\n *\n *   Quick computation"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftbbox.h",
    "chars": 2638,
    "preview": "/****************************************************************************\n *\n * ftbbox.h\n *\n *   FreeType exact bbox"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftbdf.h",
    "chars": 5322,
    "preview": "/****************************************************************************\n *\n * ftbdf.h\n *\n *   FreeType API for acc"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftbitmap.h",
    "chars": 9051,
    "preview": "/****************************************************************************\n *\n * ftbitmap.h\n *\n *   FreeType utility "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftbzip2.h",
    "chars": 2786,
    "preview": "/****************************************************************************\n *\n * ftbzip2.h\n *\n *   Bzip2-compressed s"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftcache.h",
    "chars": 33862,
    "preview": "/****************************************************************************\n *\n * ftcache.h\n *\n *   FreeType Cache sub"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftchapters.h",
    "chars": 2548,
    "preview": "/****************************************************************************\n *\n * This file defines the structure of t"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftcid.h",
    "chars": 4022,
    "preview": "/****************************************************************************\n *\n * ftcid.h\n *\n *   FreeType API for acc"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftcolor.h",
    "chars": 49789,
    "preview": "/****************************************************************************\n *\n * ftcolor.h\n *\n *   FreeType's glyph c"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftdriver.h",
    "chars": 46000,
    "preview": "/****************************************************************************\n *\n * ftdriver.h\n *\n *   FreeType API for "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/fterrdef.h",
    "chars": 12336,
    "preview": "/****************************************************************************\n *\n * fterrdef.h\n *\n *   FreeType error co"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/fterrors.h",
    "chars": 9300,
    "preview": "/****************************************************************************\n *\n * fterrors.h\n *\n *   FreeType error co"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftfntfmt.h",
    "chars": 2213,
    "preview": "/****************************************************************************\n *\n * ftfntfmt.h\n *\n *   Support functions"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftgasp.h",
    "chars": 4138,
    "preview": "/****************************************************************************\n *\n * ftgasp.h\n *\n *   Access of TrueType'"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftglyph.h",
    "chars": 18491,
    "preview": "/****************************************************************************\n *\n * ftglyph.h\n *\n *   FreeType convenien"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftgxval.h",
    "chars": 10625,
    "preview": "/****************************************************************************\n *\n * ftgxval.h\n *\n *   FreeType API for v"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftgzip.h",
    "chars": 4211,
    "preview": "/****************************************************************************\n *\n * ftgzip.h\n *\n *   Gzip-compressed str"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftimage.h",
    "chars": 41316,
    "preview": "/****************************************************************************\n *\n * ftimage.h\n *\n *   FreeType glyph ima"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftincrem.h",
    "chars": 10696,
    "preview": "/****************************************************************************\n *\n * ftincrem.h\n *\n *   FreeType incremen"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftlcdfil.h",
    "chars": 11751,
    "preview": "/****************************************************************************\n *\n * ftlcdfil.h\n *\n *   FreeType API for "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftlist.h",
    "chars": 7100,
    "preview": "/****************************************************************************\n *\n * ftlist.h\n *\n *   Generic list suppor"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftlogging.h",
    "chars": 4129,
    "preview": "/****************************************************************************\n *\n * ftlogging.h\n *\n *   Additional debug"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftlzw.h",
    "chars": 2768,
    "preview": "/****************************************************************************\n *\n * ftlzw.h\n *\n *   LZW-compressed strea"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftmac.h",
    "chars": 7771,
    "preview": "/****************************************************************************\n *\n * ftmac.h\n *\n *   Additional Mac-speci"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftmm.h",
    "chars": 21793,
    "preview": "/****************************************************************************\n *\n * ftmm.h\n *\n *   FreeType Multiple Mas"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftmodapi.h",
    "chars": 22434,
    "preview": "/****************************************************************************\n *\n * ftmodapi.h\n *\n *   FreeType modules "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftmoderr.h",
    "chars": 6675,
    "preview": "/****************************************************************************\n *\n * ftmoderr.h\n *\n *   FreeType module e"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftotval.h",
    "chars": 5346,
    "preview": "/****************************************************************************\n *\n * ftotval.h\n *\n *   FreeType API for v"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftoutln.h",
    "chars": 17262,
    "preview": "/****************************************************************************\n *\n * ftoutln.h\n *\n *   Support for the FT"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftparams.h",
    "chars": 5592,
    "preview": "/****************************************************************************\n *\n * ftparams.h\n *\n *   FreeType API for "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftpfr.h",
    "chars": 4910,
    "preview": "/****************************************************************************\n *\n * ftpfr.h\n *\n *   FreeType API for acc"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftrender.h",
    "chars": 6625,
    "preview": "/****************************************************************************\n *\n * ftrender.h\n *\n *   FreeType renderer"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftsizes.h",
    "chars": 4288,
    "preview": "/****************************************************************************\n *\n * ftsizes.h\n *\n *   FreeType size obje"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftsnames.h",
    "chars": 7730,
    "preview": "/****************************************************************************\n *\n * ftsnames.h\n *\n *   Simple interface "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftstroke.h",
    "chars": 21773,
    "preview": "/****************************************************************************\n *\n * ftstroke.h\n *\n *   FreeType path str"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftsynth.h",
    "chars": 3362,
    "preview": "/****************************************************************************\n *\n * ftsynth.h\n *\n *   FreeType synthesiz"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftsystem.h",
    "chars": 8518,
    "preview": "/****************************************************************************\n *\n * ftsystem.h\n *\n *   FreeType low-leve"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/fttrigon.h",
    "chars": 7411,
    "preview": "/****************************************************************************\n *\n * fttrigon.h\n *\n *   FreeType trigonom"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/fttypes.h",
    "chars": 14487,
    "preview": "/****************************************************************************\n *\n * fttypes.h\n *\n *   FreeType simple ty"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ftwinfnt.h",
    "chars": 7966,
    "preview": "/****************************************************************************\n *\n * ftwinfnt.h\n *\n *   FreeType API for "
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/t1tables.h",
    "chars": 22829,
    "preview": "/****************************************************************************\n *\n * t1tables.h\n *\n *   Basic Type 1/Type"
  },
  {
    "path": "thirdparty/freetype/include/freetype2/freetype/ttnameid.h",
    "chars": 58769,
    "preview": "/****************************************************************************\n *\n * ttnameid.h\n *\n *   TrueType name ID "
  }
]

// ... and 712 more files (download for full content)

About this extraction

This page contains the full source code of the fynv/ScoreDraft GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 912 files (37.3 MB), approximately 3.9M tokens, and a symbol index with 8641 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!