Code Monkey home page Code Monkey logo

render-stock-movements-to-music-'s Introduction

Render-stock-movements-to-music

Python 3 program to render asset (eg stock) time series data in 'OHLC' # with trading volumes into music streams, using the Music21 libraries.

This program can take in any set of stock price data in a table with columns "Open High Low Cls Vol" stored in an .xls file. The example uses the Hong Kong Hang Seng Stock Index ^HSI monthly data.

The programs maps each monthly set of OHLC prices into 4 equal quarter notes within a define pitch range. In this rendering the higher the price goes the higher the volume of the main instruments. But the base instrument volume goes down in the opposite manner, giving the music some interesting dynamics.

The trading volume of the month is not used here but if I have any new idea in the future I will make use of it to make the music richer.

At the end the program creates a midi file playable on the computer. It also dumps out a .xml file which can be rendered into a music score readable/playable by MuseScore or Finale etc.

This is my first Python code so not everything is written in good Pythonic manner. Any advice or suggestion to improve is welcome.

render-stock-movements-to-music-'s People

Contributors

tttwong avatar

Watchers

 avatar

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.