Code Monkey home page Code Monkey logo

Comments (1)

DimaSamoz avatar DimaSamoz commented on August 18, 2024

Hi! Thanks for your interest :)
I think the issue in your case is the play function: it is only intended to convert melodies into Music values, which is what prog does with progressions. In very simplistic terms, you have:

  • Progression: the abstract type for chord progressions.
  • Music: the main data type which performs the rule-checking.
  • Score: type of MIDI tracks which can be exported into MIDI files.
  • prog :: Progression -> Music: function to convert abstract progressions into concrete Music values.
  • defScore :: Music -> Score: function to convert Music values into exportable MIDI tracks.

Hence you only need

p = defScore $ prog $ ph_IVI ton dom_V ton :+ cadence (full subdom_IV auth_V7_I)

As an aside, play was renamed to start in the latest release (which I just added) to avoid confusion with the live playback functions.

Once you have a Score (by applying defScore or the more general score construction functions to a Music value), you can use renderScore to render it into a MIDI file (that part of your program seems correct).

Thanks for the kind words! I do agree that type-level hackery is a bit risky – it's quite easy to break stuff and output an enormous and scary error message. However, it's quite nice when it works! I am considering rewriting Mezzo on the term level (or even TH, as you suggest) in the future to compare the benefits and drawbacks of the two approaches (though this will have to wait as I need to concentrate on a different project this year).

I hope this helped!

from mezzo.

Related Issues (4)

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.