Coder Social home page Coder Social logo

street-life's Introduction

Street-Life

So I was listening to this song and wanted to play a bit of it on my keyboard (the computer's one, not the piano). Many Java music libraries are available (jMusic, jFugue). First I tried with jMusic but it seems to be a bit unstable. I tried to figure out an easy way to write the parts of the song and decided to write a POC in Kotlin.

The main.kt contains the 5 first bars of the song. It's far from perfect (and relies on the MIDI sequencer) but you can easily understand the source and how it generates the music.

The smallest unit is a Chunk class that contains many sequences of keys. The magic of Kotlin allows some basic operations:

  • chunk + 12 will transpose the chunk to the upper octave
  • chunk * 4 will repeat the chunk 4 times
  • chunk1 then chunk2 will play the chunks in a row
  • chunk1 or chunk2 will mix the chunks

street-life's People

Contributors

martinsaison avatar

Watchers

James Cloos 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.