GithubHelp home page GithubHelp logo

mrombout / demuse Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 972 KB

DEMUSE is a toy programming language that compiles into .midi files.

License: GNU General Public License v3.0

CMake 3.58% C++ 96.42%
compiler midi abandonware broken cpp

demuse's Introduction

DEMUSE

Compiling

DEMUSE uses CMake to generate build files for your preferred environment.

Warning! You need a C++11 compliant compiler.

Dependencies

DEMUSE directly depends on the following libraries:

Library Version Notes
wxWidgets >= 3.0.2 Only required for IDE
midifile 9ee5898 Only required for MIDI compilation
googletest >= 1.7.0 Only required for building tests

demuse's People

Contributors

mrombout avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

demuse's Issues

Instrument change on different channel

It seems like MuseScore (other most likely other players) do not support changing the instrument on the same channel. Instead it plays all notes as the same instrument.

Another editor called MidiEditor does seem to support it.

Best check out the specs and see who's right.

Support for escape characters

Currently there is no support for escape characters. Due to the tokenizer the user is able to escape a " in a string. But this and the escape \ character and then simple included in the string.

NotePrimitiveMatcher refactor

Currently NotePrimitiveMatcher is exploiting a dirty hack to get multiple tokens into the deck using a single matcher. This however causes any following tokens to fails since the lexer does not match and the lexer continues as if the token is unknown.

A ">" in front of a variable should play it.

Currently, notes and variables are only playable using the sequence syntax(i.e. <<C C D E>>. I think it might be cool if sequences were also just objects. This allows the use of sequences as reusable patterns.

Than in order to play a pattern or anything in a variable, the player can use the > syntax, now currently used to start a note primitive. We do need a different synax for notes if we do that, since note literals could be pretty useful.

Tempo issues

Tempo of MIDI output is incorrect. It should adhere to the tempo variable in de correct scope, which defaults to 120BPM.

Support for samples

Since DEMUSE is moving from MIDI to the MOD format, there should be syntax to load samples. For example the following syntax could be used:

sample = "sample" identifier text [sample_length] generator
generator = identifier | function
// will dynamically generate a sine wave
sample Sample01 "Sample 01" 32 function(x){
    return sin(x);
};

// will load a file as a sample
sample Sample02 "Sample 02" genFile("my_file.wav");

// will use a generator (same as Sample 01, generator is just a callback function)
sample Sample03 "Sample 03" genSine;

Specific details have to be researched. But essentially a sample definition could be a callback function that gets called for every part of the sample length (in the above example 32 times).

These should also be support for looping (not included in samples above).

There is something terribly wrong with scoping functions calls and returns

The following code errors, stating that variable a does not exist.

This runs:

// test 1 - recursive variables
function test1(n) {
    if(n > 1) {
        return 6;
    }
    var a = n + 1;
    var b = n + 2;

    var a1 = test1(a);
    var b1 = test1(b);
    return a1 + b1;
}
var r1 = test1(0);
if(r1 === 18)
    print("test1 - OK!");
else
    print("test1 - FAIL!");

While this doesn't:

// test 2 - recursive return directly
function test2(n) {
    if(n > 1) {
        return 6;
    }
    var a = n + 1;
    var b = n + 2;

    return test2(a) + test2(b);
}
var r2 = test2(0);
if(r2 === 18)
    print("test2 - OK!");
else
    print("test2 - FAIL!");

Identifier 'b' is recognized as accidental

Currently 'b' is recognized as an accidental. In order to be able to differentiate between the identifier 'b' and the accidental 'b' the regex of the accidental should verify that the previous token was a Note.

Playing notes simultaneously

Currently it's possible to play several notes simultaneously by playing in harmony using de + synax or by playing on 2 tracks. Perhaps there is a better way to more easily play for example a bass note while playing a melody.

Default constructors for Objects

Java uses default constructors for their Objects. Booleans for example has a wide range of constructors that knows how to turns any Object into a boolean. Currently this in DEMUSE this logic is spread all over the classes using the as* methods.

We might want to use a load of implicit convertor functions. Than we could add some internal functions to implicitely call these to turn any Object into say an Boolean object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.