Skip to content

katieshiqihe/music_in_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Music in Python

Music theory explained using visuals and acoustics generated in Python.

More information on blog post here and part 2.

Usage

The repo contains sample audio files as well as the following scripts:

  • utils.py: functions to generate sine wave, harmonic series, and ADSR model.
  • middle_c.py: Fourier analysis of a middle C played on the piano.
  • twinkle.py: example on how to write Twinkle Twinkle Little Star.
  • consonance.py: generate plots for common combinations in consonance and dissonance.
  • scale.py: generate C in major scale with and without pedal effect.

Requirements

  • numpy
  • scipy
  • matplotlib