• Stars
    star
    179
  • Rank 212,809 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created almost 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

-> 中文Readme

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.

    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:

# 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

For more detailed introduction and demos see: 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.

License

ScoreDraft is now formally available under MIT license.

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 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

More Repositories

1

Three.V8

3D rendering engine using JavaScript as user script.
JavaScript
63
star
2

ThrustRTC

CUDA tool set for non-C++ languages that provides similar functionality like Thrust, with NVRTC at its core.
C++
51
star
3

VkInline

A tool to make it easy to use Vulkan from Python. An interface for computation and off-screen rendering.
C++
18
star
4

BVHTracing

BVH accelerated CPU and OpenGL ray-tracing
C++
15
star
5

RubikNotes

Some notes about Rubics cube
C++
11
star
6

FeiRays

Reusable Vulkan based ray-tracing library
C++
8
star
7

pyTinySoundFont

A Python port of TinySoundFont
Python
6
star
8

optimal_sgemm_cuda_c

Trying to optimize sgemm just in CUDA C without sass tuning.
Cuda
6
star
9

RaspMusicStation

Tools for setting-up Raspberry Pi as a music server which can be controlled from an android device through Wifi
C
5
star
10

CURandRTC

CURandRTC is a GPU random number generation module based on ThrustRTC.
C++
4
star
11

GLVulkanTest

Vulkan - GLES interop in Android
C++
3
star
12

ScoreDraftEditor

Electron based editor UI for ScoreDraft
JavaScript
3
star
13

Scratcher

A DJ Scratching Simulator by time-domain interactive GUI editing
C++
3
star
14

usd2glb

converting usdc to glb using tinyusdz & tinygltf
C
2
star
15

VkRayTraceWeekend

Ray Tracing in One Weekend done with Vulkan
C++
2
star
16

RTRTC

Toy GPU ray-tracer based on ThrustRTC on CURandRTC
C++
2
star
17

webgpu_test

webgpu experiment code
C++
2
star
18

FeiRaysInline

Vulkan accelerated PBRT based on VkInline. Pure python. On going.
Python
2
star
19

CUDAInline

A CUDA interface for Python. A distillation of the engine part of ThrustRTC.
C++
1
star
20

RawNN

Try implementing a NN inference using cudnn directly
C++
1
star
21

webpbf

WebGPU implementation of position-based-fluid
JavaScript
1
star
22

fynv.github.io

Home Page for Fei Yang's projects
JavaScript
1
star
23

CreateAMaze

Web game based on an infinite maze generator.
C++
1
star