Skip to main content

A small python package for generating music.

Reason this release was yanked:

this version has an unnecessary dependency on scipy

Project description

jc3000

A small python package for generating music. Inspired by this which was inspired by this (that's why it's called jc3000).

You can generate any notes you want based on any fundamental (the frequency of concert A in this case, fundamental as a term is used kind of loosely). You can also use either just or equal temperament.

More reading

This page has really good information on how music and scales work at the physical level.

Default sample rate is 44,100 Hz.
Default concert A is 440 Hz.

Examples

  • Play the licc
from jc3000 import Sequence

s = Sequence(fs=44100, fundamental=440, equal=True)
s.add_note('d', duration=.125)
s.add_note('e', .125)
s.add_note('f', .125)
s.add_note('g', .125)
s.add_note('e', .257)  # .257 for ~swing-iness~
s.add_note('c', .125)
s.add_note('d', .25)

s.write_file('the_licc.wav')
  • Play the C major scale with concert A set to 432 Hz.
from jc3000 import Sequence

s = Sequence(fundamental=432)

notes = ['cdefgabc']

for i, note in enumerate(notes):
    if i < 5:
        s.add_note(note)
    else:
        s.add_note(note, octave=1)
        
s.write_file('cmajor_432hz.wav')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jc3000-0.0.1.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

jc3000-0.0.1-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page