BUILD A STEP SEQUENCER USING PYTHON

Similar documents
R H Y T H M G E N E R A T O R. User Guide. Version 1.3.0

XYNTHESIZR User Guide 1.5

Art of Sound. Professional soundware solution. PULSation. Reference Guide. Waldorf Pulse

y POWER USER MUSIC PRODUCTION and PERFORMANCE With the MOTIF ES Mastering the Sample SLICE function

The MPC X & MPC Live Bible 1

Manual Version 1.0. User Guide. English

Bionic Supa Delay Disciples Edition

Igaluk To Scare the Moon with its own Shadow Technical requirements

Introduction! User Interface! Bitspeek Versus Vocoders! Using Bitspeek in your Host! Change History! Requirements!...

NoteMix Player Note Mixer/Shifter/Splitter/Filter with Snapshot Morphing Rack Extension for Propellerhead Reason

Serie TV Manager for Enigma2 Systems

AutoChorale An Automatic Music Generator. Jack Mi, Zhengtao Jin

GarageBand for the ipad, A Superstar for the Music Classroom

The Complete Guide to Music Technology using Cubase Sample Chapter

CTK-3500 MIDI Implementation

1 Overview. 1.1 Nominal Project Requirements

User Guide Version 1.1.0

bitklavier Manual & Documentation

Polythemus AU Midi Effect for IOS User Manual (11 th Mar 2019)

TABLE OF CONTENTS TABLE OF CONTENTS TABLE OF CONTENTS. 1 INTRODUCTION 1.1 Foreword 1.2 Credits 1.3 What Is Perfect Drums Player?

Eventide Inc. One Alsan Way Little Ferry, NJ

WAVES Scheps Parallel Particles. User Guide

MV-8800 Production Studio

Recommendations for Producing XG Song Data

QUALITY OF COMPUTER MUSIC USING MIDI LANGUAGE FOR DIGITAL MUSIC ARRANGEMENT

Workshop. MPC-to-MV Translator ÂØÒňΠMV-8000

Reason Overview3. Reason Overview

fxbox User Manual P. 1 Fxbox User Manual

Interfacing Analog to Digital Data Converters. A/D D/A Converter 1

SND ACME-4 Advanced Clock Management Engine operating instructions. March 6, 2012

Polyend Poly Polyphonic MIDI to CV Converter User Manual

multitrack sequencer USER GUIDE Social Entropy Electronic Music Instruments

KORG's Gadget for ipad Mobile Synthesizer Studio

Keyboard Music. Operation Manual. Gary Shigemoto Brandon Stark

Audiocation Compressor AC1. Version 1.0

ALYJAMESLAB

Original Marketing Material circa 1976

SM 200. samplemagic.com

For example, an indication of Range: 60, 67, 72, 75 (Hz) means that 60 Hz is the default value.

Korg Kronos Workflow for Worship

Syrah. Flux All 1rights reserved

Hip Hop Robot. Semester Project. Cheng Zu. Distributed Computing Group Computer Engineering and Networks Laboratory ETH Zürich

OCTAVE C 3 D 3 E 3 F 3 G 3 A 3 B 3 C 4 D 4 E 4 F 4 G 4 A 4 B 4 C 5 D 5 E 5 F 5 G 5 A 5 B 5. Middle-C A-440

DW Drum Enhancer. User Manual Version 1.

Cathedral user guide & reference manual

THE INPUT LOGIC DJ TUTORIAL

Oberheim Two Voice Pro the analog dream-synth?

USING A SOFTWARE SYNTH: THE KORG M1 (SOFTWARE) SYNTH

DA-88 QUICK TIPS (VERSION 4 SOFTWARE)

UARP. User Guide Ver 2.2

Here are the product description for each pack:-

MUSIC THEORY & MIDI Notation Software

Sound Magic Piano Thor NEO Hybrid Modeling Horowitz Steinway. Piano Thor. NEO Hybrid Modeling Horowitz Steinway. Developed by

COPYING A PATTERN...35

Royal Reed Organ for NI Kontakt

Ultimate Trance Bundle Volume 6 For Spire, Construction Kits & MIDI

Tau Quick Reference. For Setup: Factory Tau 1 For software version and above

We will cover the following topics in this document:

Operation Manual (not in Cubase LE)

(12) Patent Application Publication (10) Pub. No.: US 2004/ A1. Kusumoto (43) Pub. Date: Oct. 7, 2004

Trance Euphoria are proud to release another super saving bundle Mega PSY Trance Bundle

TABLE OF CONTENTS. 2 SGM Light Technology 23/08/1999 Ver. 2.00

TASCAM DM-24. The DM-24 Basics. TEAC Professional Division. Digital Mixing console

Integrate IR Trans with digitalstrom Developer Days Hackaton ( ) Team: Goran Petrovikj Tomasz Hasinski Jurica Mihačić Krzysztof Klimek

Ultimate Trance Bundle Volume 3 For Spire & Construction Kits

Lab P-6: Synthesis of Sinusoidal Signals A Music Illusion. A k cos.! k t C k / (1)

2 einklang.visuals gmbh

Presents. Cinematic Percussion Designer

Cedits bim bum bam. OOG series

Vocal Processor. Operating instructions. English

TV Synchronism Generation with PIC Microcontroller

MAutoPitch. Presets button. Left arrow button. Right arrow button. Randomize button. Save button. Panic button. Settings button

BOUNCE. COMPRESSOR with Analog Sound & Digital Transparency USER MANUAL

Remixing Blue Glove. The song.

Cedits bim bum bam. OOG series

Electronic Musical Instrument Design Spring 2008 Name: Jason Clark Group: Jimmy Hughes Jacob Fromer Peter Fallon. The Octable.

Understanding and Using Your moogerfooger MF-105M MIDI MuRF

User Manual. Introduction. Quick Start. Version

OUTER SPACE USER GUIDE

Presents. Crystal Glasses V3. for NI KONTAKT 4+ Go to Index: 2

GarageBand Tutorial

DCB mk 3. professional bi-directional MIDI to DCB converter. Operating manual

The following is a list of terms you might encounter regarding the VS-840 and synchronization:

MANUAL v.3 CONTACT MORE THAN LOGIC. UNITING ART + ENGINEERING.

The Schwinnaphone A Musical Bicycle. By Jeff Volinski with Mike Caselli

/SM 71. samplemagic.com. Synthwave 2

Applicable to Panorama P1, P4 & P6. Using Panorama with Reason


Sound Magic Imperial Grand3D 3D Hybrid Modeling Piano. Imperial Grand3D. World s First 3D Hybrid Modeling Piano. Developed by

User Guide. Version 2.0.0

Motif and the Modular Synthesis Plug-in System PLG150-PF Professional Piano Plug-in Board. A Getting Started Guide

Computer Coordination With Popular Music: A New Research Agenda 1

Lab 1 Introduction to the Software Development Environment and Signal Sampling

/SM 47. Welcome to... / 3. Synthwave. Synthwave Synth pop, retro-electro and 80s computer-funk. samplemagic.com

Concepts for the MIDI Composer, Arranger, and Orchestrator

NOTE: AT THIS POINT, YOU WILL HAVE TO CHOOSE A SONG NAME FOR YOUR

CONDUCTOR PROGRAM INSTRUCTION MANUAL MAX MATHEWS

ALYJAMESLAB

2 The MIDI Manual. Figure 1.1. Example of a typical MIDI system with the MIDI network connections.

/SM 73. samplemagic.com. Eclectic Electronic

Transcription:

BUILD A STEP SEQUENCER USING PYTHON

WHO AM I? Yann Gravrand (@ygravrand) Techie Musician

PART 1: BACKGROUND Musical instruments Synthetizers and samplers Sequencers Step sequencers

MUSICAL INSTRUMENTS Can be played by humans uk.funzing.com Some can be "played" by computers: Synthetizers Samplers...

SYNTHETIZERS Sound generators Lots of parameters can be tweaked

FAMOUS SYNTHETIZERS Minimoog (analog) DX7 (digital)

FAMOUS SYNTHETIZERS Nord Lead (analog modeling) Mininova (analog modeling)

VST VST Plugins

SAMPLERS Do not generate sounds themselves Play samples (little chunks of sound)

SAMPLES / NOTES: One sample for the whole keyboard (pitch adjusted or not)

One sample for each note

One sample for a group of notes, pitch is ajusted

DRUM MACHINES? Sound generator (drum oriented) + step sequencer TR 909 Tempest

SEQUENCERS Play a sequence of notes Several tracks, instruments...

STEP SEQUENCER A 4/4 measure is divided into: 4 quarter notes Each quarter note is divided into 4 steps --> A sequence like this is 16 steps long

STEP SEQUENCER For each step, we define: the note / pitch other attributes: length...... and activate it or not

EXAMPLES Daft punk - Aerodynamic @ 1:03 4 * 16-step patterns

EXAMPLES Daft punk - Aerodynamic @ 2:28 4 * 16-step patterns, some notes off

USING A STEP SEQUENCER "Step by step" mode: for each step, define the note attributes. No timing, no rush "Live" mode: turn steps on and off in real time, adjust pitch, length...

PART 2: THE PROJECT Project goals MIDI Using mido The Dirty Part: blocking, threads, asyncio...

I HAD A cool synth Colorful (and empty) pads

AND A snake

PROJECT GOALS Make the synthetizer play notes using Python Modify and turn notes on / off to create a sequence Implement "step by step" and "live" modes Change tempo in real time Make interactions possible with any controller...... Starting with mine, of course :) No GUI, focus on usability with hardware (live oriented)

MIDI: MUSICAL INSTRUMENT DIGITAL INTERFACE Extremely old standard: 1983! Still largely in use today To synchronize and communicate between devices Message types: Notes (NOTE ON, NOTE OFF) Control Change (Ex: Filter resonance, Hold pedal...) Program Change (Change instrument) Sys ex...

WE WILL NEED TO SPEAK MIDI WITH DEVICES Midi input: pads pressed, keys pressed, knobs turned... Midi output: play a note, turn a LED on...

MIDI INPUT: RECEIVING MESSAGES inport = mido.open_input() msg = inport.receive() # Blocking call Message reception blocks So if we want to do something else in parallel, we have to handle this in a thread or coroutine or...?

MIDI OUTPUT: PLAYING NOTES import mido outport = mido.open_output() msg = mido.message('note_on', note=100, velocity=3) outport.send(msg) --> BEEEEEEEEEEEEEEEEEEEE... outport.send(mido.message('note_off', note=100)) -->... EEEP. To play notes, we need a timer between NOTE_ON and NOTE_OFF (note duration). time.sleep?

ALIGNING NOTES (STEPS) WITH TEMPO while True: outport.send(mido.message(...)) time.sleep(tempo.step_duration) Naive implementation: Two problems: time.sleep also blocks, so we have to handle it in a thread or coroutine or... Waking up, sleeping for X seconds, waking up...: the tempo slowly drifts. Calculate absolute times

SOLUTIONS Threads Many queues to avoid shared state Coroutines with asyncio Everything in a single thread, less concurrency issues Ok since our app is I/O bound...but we have to modify mido to insert yield from or await... Greenlets with gevent Monkey patches time.sleep so we can use mido as is and have greenlets

PROPOSED DESIGN Main process is I/O bound Console process is CPU bound!

PART 3: IMPLEMENTATION & DEMO System overview Implementing a controller Action!

SYSTEM OVERVIEW

IMPLEMENTING A CONTROLLER Map messages from controller (pad pressed) to sequencer actions (toggle step) Send messages to controller for feedback (LEDs...)

INTERPRETING EVENTS FROM CONTROLLERS Some events are represented by a single message Others are the result of a sequence of messages (ex: NPRN LSB, MSB) Solution: a RulesChain Each Rule matches a message A state automaton keeps track of the matched rules Flexible rules evaluation engine self.register('filter', self.on_cc, RulesChain(Rule(type_='control_change', control='74'), Rule(type_='control_change', control='27', value='0')) )

REACTING TO SEQUENCER EVENTS self.sequencer.on(sequencerevents.step_begin, self, self.on_step_begin)... def on_step_begin(self, step): # Turn on current step LED self.sequencer.output(self, *msb_lsb_output(60, 0, 32 + step.pos))

IN ACTION!

IN ACTION! Bass pattern Drum pattern 1 Drum pattern 2 Mozart pattern (32-step sequence) Daft punk - da funk Remote console

WHY PYTHON? BENEFITS Easy to read, easy to write The dynamic features of Python and plugin system make writing controllers easy! Large ecosystem

CHALLENGES Python is not the best choice for real-time computing Performance on tiny devices (C.H.I.P, Rpi...) Steppy was designed with simplicity in mind (gevent / single thread execution model) Implies we must be "green" and use the least CPU possible

WHERE IS MY CPU? Rules evaluation engine: Speed can be improved: PyPy, Cython, Numba...? Pretty printing (large characters): Isolate on a core Move the problem - using Websockets!

FUTURE PLANS Chords (especially important for a drum machine...) Multi track Load / save to midi External tempo sync Better reactive Web interface Web interface for rules config (like Live's mappings) Other protocols: DMX...

THANK YOU! @ygravrand github.com/ygravrand/steppy