All Projects → jmiskovic → hexpress

jmiskovic / hexpress

Licence: Unlicense license
Modern mobile music instrument

Programming Languages

lua
6591 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to hexpress

r e c u r
an open diy py/pi based video sampler
Stars: ✭ 220 (+331.37%)
Mutual labels:  instrument, sampler
AndroidFuzz
JavaFuzz 4 Android
Stars: ✭ 27 (-47.06%)
Mutual labels:  instrument
React Music
Make beats with React!
Stars: ✭ 2,696 (+5186.27%)
Mutual labels:  instrument
imogen
ultimate vocal harmonizer
Stars: ✭ 169 (+231.37%)
Mutual labels:  instrument
Trackpad-Drummer
Drum with your trackpad.
Stars: ✭ 22 (-56.86%)
Mutual labels:  drums
puma-status
Command-line tool for puma to display information about running request/process... Fork of https://github.com/dimelo/puma-helper/ in ruby.
Stars: ✭ 108 (+111.76%)
Mutual labels:  instrument
Trashed
Tell StatsD about request time, GC, objects and more. Latest Rails 4 and Ruby 2.1 support, and ancient Rails 2 and Ruby 1.8 support.
Stars: ✭ 188 (+268.63%)
Mutual labels:  instrument
hacktribe
Electribe 2 firmware hacks.
Stars: ✭ 97 (+90.2%)
Mutual labels:  sampler
p2p-project
A peer-to-peer networking framework to work across languages
Stars: ✭ 68 (+33.33%)
Mutual labels:  chords
arpeggio
A chord naming app for guitar written in React.
Stars: ✭ 49 (-3.92%)
Mutual labels:  chords
HAGIWOs Module
eurorack modular synthesizers projects using Arduino.
Stars: ✭ 76 (+49.02%)
Mutual labels:  sampler
Spleeter
Spleeter is Deezer source separation library with pretrained models written in Python and uses Tensorflow. It makes it easy to train source separation model (assuming you have a dataset of isolated sources), and provides already trained state of the art model for performing various flavour of separation :
Stars: ✭ 18,128 (+35445.1%)
Mutual labels:  drums
chords
Text-based chord progression editor
Stars: ✭ 25 (-50.98%)
Mutual labels:  chords
strumpract
Various tools for musicians.
Stars: ✭ 20 (-60.78%)
Mutual labels:  drums
live-band
Play drums and other instruments with the rest of the world
Stars: ✭ 20 (-60.78%)
Mutual labels:  drums
Dx7 Synth Js
A JavaScript implementation of the Yamaha DX7 synthesizer
Stars: ✭ 201 (+294.12%)
Mutual labels:  instrument
uke
𝄝 Ukulele CLI Support
Stars: ✭ 13 (-74.51%)
Mutual labels:  chords
phptabs
A PHP library for reading, writing and rendering guitar tablatures and MIDI files
Stars: ✭ 34 (-33.33%)
Mutual labels:  chords
chords
A Kotlin multi-platform view library for displaying stringed instrument chord diagrams
Stars: ✭ 25 (-50.98%)
Mutual labels:  chords
sequencer64
64-step sequencer PWA
Stars: ✭ 200 (+292.16%)
Mutual labels:  drums

Hexpress

Hexpress app on Google Play

Hexpress is a playground for constructing interactive musical experiments for use on Android devices. It's built on top of LÖVE framework. It is available as free-of-charge Android app and open-source project.

App screenshot

Note layouts

Hexpress currently implements three note layouts:

  • hexagonal note layout
  • fretboard arrangement
  • free-form layout

Hexagonal layout is based on Harmonic table note layout. This arrangement has quite simple patterns for chords & arpeggios, and it was used historically as a method for music theory analysis and composition.

Fretboard is mostly modeled after guitar, but can also be used for other instruments. It supports any number of strings with customizable tuning. Compared to hexagonal layout, fretboard can be considered as generalized rectangle tiling, as strings and frets correspond to two axes of symmetry.

Free-form layout allows placing any number of circular zones that act as note triggers. It's meant to be used for percussive instruments or for instruments with irregular note arrangements.

Design & architecture

Hexpress runs on Android & desktop versions of LÖVE framework. LÖVE is an awesome framework for 2D games, which also makes it decent fit for implementing musical instruments.

LÖVE uses openal-soft library for cross-platform audio. It supports spatial audio, real-time effects (reverb, chorus, distortion, echo, flanger, modulator, compressor, equalizer), and sound capture. It's not meant for professional music applications, but so far it's proven to be effective for the needed scope. Recently the LÖVE Android port started using Oboe which enables low-latency audio across many devices.

The released Hexpress app makes some modifications to LÖVE framework code. The framework code and Android building environment is currently not included in this repository because of maintainability problems. It is almost identical to official [LÖVE for Android] app, with differences being app icon and name. Please open an issue if hosting app is of any interest. The code from this repo can be used with official LÖVE for Android app.

Hexpress supports any number of virtual instruments. Several instruments are provided in patches subdirectory. When application starts, a selector.lua module scans for patches and presents them to user for selection. For this purpose, patch contains icon() function that is called each frame by selector to render representation of patch to user. Once a patch is selected, it starts executing in place of selector module. The phone's back button unloads current patch and returns execution to selector.

The patch script acts like a mini-app and has full control over input, sound and rendering. Some patches use this to implement specialized visualizations and control methods. Patch creates a runnable instance during load() method, and this instance is later given control with process(dt) and draw() calls.

Each frame, an empty stream table is created in main.lua. Touch inputs and phone tilt are read and processed in control.lua and forwarded to patch within the stream table. The patch can use any note layout (hexpad.lua, fretboard.lua, freeform.lua) to convert touch locations into note pitch. During this conversion, it is determined if touch triggers new note (noteRetrigger property), or if it is holding down same note as on previous frame. All this information is stored back into the stream. It can be further manipulated by patch to implement note bending, vibrato, chords/arpeggios or other real-time musical techniques.

The stream is then sent to sampler module to convert to audio output. Each sampler keeps table of audio samples with assigned note pitch and velocity (volume). For each new note, the sampler will select correct audio sample based on best match for note's pitch and velocity. It will then tune the pitch of sample to played note and start sample playback. The volume of playback is constantly adjusted according to ADSR envelope. The maximum number of simultaneous sample playbacks is customizable, if limit is reached the oldest sample is stopped to make room for new note. Sampler is heavily customizable during initialization from patch, and some real-time parameters are controllable during execution.

The drawing of visuals is mostly done inside note layout modules (hexpad.lua, fretboard.lua, freeform.lua). They render iterate through grid of note layout to show positions of notes, with currently played notes being rendered with different color/size/animation. There are three level of granularity for customizing instrument visualizations. Easiest modification is just changing color scheme of note layout (for example choir.lua). More customization is possible by re-using grid layout but overriding drawing of individual cells (for example analog.lua). For complete control, note layout rendering is not used at all and rendering is re-implement inside the patch (this makes strings.lua look unique).

Creating and modifying instruments

Creating new instrument is done by of collecting audio samples, processing them, and creating a lua script to implement behavior.

For decent quality, there should be at least three samples per one octave. Instrument samples need to be in mono. Some samples require fine-tuning to get them into correct pitch. It is also good idea to cut off any silence at beginning of sample, at the zero crossing to prevent popping. Audacity is good audio editor for processing, while Sox can be used for automatic normalization and data compression.

The lua script for patch has to be named same as patch directory. The script is quite straightforward to create by modifying an existing patch (choir.lua patch can serve as a good template). The load() function is executed once to create a sampler and feed it a list of samples and parameters of ADSR envelope. Functions process() and draw() can be left unchanged for simple instruments.

As mentioned, modified codebase doesn't require any code compilation or building of APK. The installed Hexpress app can load modified codebase instead of built-in codebase. This allows for tweaking of any settings, designing of new insturments, modifying visuals, changing sound samples, all by modifying files on your phone.

Unexplored ideas

Here are some promising ideas that I never got around to implementing.

A monophonic instrument that works in portrait mode, playable with single thumb. Sometimes you want to keep phone in the pocket and still make noise.

Capture sound with microphone, do on-the-fly harmonic analysis, and display the results as overlay on the hexagonal grid. This would enable strong feedback between outside performed music and the virtual instrument itself. One could whistle a melody and then play it flawlessly just by pressing the highlighted notes.

Allow for zooming and scrolling of the underlaying musical grid and thereby extending the musical range of instrument. Being able to bring any note to screen center would also make it more useful for studying music theory.

Explore the musical theory concepts by implementing different note arrangements - Wicki-Hayden layout, circle-of-fifths, Janko piano layout and others.

Add an intelligent music assistant that automatically adds harmonic accompaniment to played melody, and suggests next melody note based on previous notes and learned model.

Make interactive tool for creating custom instruments. It could focus on stringed instruments (drag string endpoints around, shorter strings produce higher pitches), or it could support generic trigger pads with assigned sounds and pitches.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].