GoldenPond Library
This is the Python version of the GoldenPond Library.
https://github.com/interstar/golden-pond
Quick Start
from goldenpond import GoldenData, Mode, TimeManipulator, MidiInstrumentContext
# Create a GoldenData instance
data = GoldenData()
data.root = 48 # C3
data.mode = 1 # Minor mode (0=major, 1=minor, 2=harmonic minor, 3=melodic minor)
data.chordSequence = "71,76,72,-75,71,76,72,-75i,77,73,76,<12,77ii,>12,71,96,74ii,75"
data.stutter = 0 # No stuttering
data.bpm = 120
data.chordDuration = 4
# Add lines with different patterns and instrument contexts
data.addLine("5/8 c 1", MidiInstrumentContext(0, 64, 0.8, 0)) # Chords on channel 0
data.addLine("7/12 > 2", MidiInstrumentContext(1, 80, 0.5, 12)) # Arpeggio on channel 1
data.addLine("4/8 1 4", MidiInstrumentContext(2, 90, 0.8, -12)) # Bass on channel 2
# Create TimeManipulator and line generators
tm = TimeManipulator().setPPQ(96).setChordDuration(data.chordDuration).setBPM(data.bpm)
generators = data.createLineGenerators(tm)
# Generate notes from each line
chords = generators[0].generateNotes(0) # First line (chords)
arp = generators[1].generateNotes(0) # Second line (arpeggio)
bass = generators[2].generateNotes(0) # Third line (bass)
# Print chord notes with formatted floats
print("First 20 Chord notes:")
for note in chords[:20]:
print(f"Note[midi: {note.getMidiNoteValue()}, startTime: {note.getStartTime():.1f}, length: {note.getLength():.1f}]")
# Print first arp note details with formatted floats
first_note = arp[0]
print("\nFirst Note from Arpeggio")
print(f"Getting individual fields: midi={first_note.getMidiNoteValue()}, "
f"startTime={first_note.getStartTime():.1f}, length={first_note.getLength():.1f}")
# Print a summary of the data
print("\nGoldenData Summary:")
print(data.toString())
GoldenPond is a library for creating musical patterns using a simple text-based language. It helps you define chord progressions and rhythmic patterns (like arpeggios and basslines) that follow music theory rules.
Understanding the Example Code
Let's break down what the example code does:
-
Setting Up the Musical Data
data = GoldenData() data.root = 48 # C3 data.mode = 1 # Minor mode data.chordSequence = "71,76,72,-75,71,76,72,-75i,77,73,76,<12,77ii,>12,71,96,74ii,75" data.bpm = 120 data.chordDuration = 4
This creates a musical piece in C minor at 120 BPM, with each chord lasting 4 beats.
-
Defining Musical Lines
data.addLine("5/8 c 1", MidiInstrumentContext(0, 64, 0.8, 0)) # Chords data.addLine("7/12 > 2", MidiInstrumentContext(1, 80, 0.5, 12)) # Arpeggio data.addLine("4/8 1 4", MidiInstrumentContext(2, 90, 0.8, -12)) # Bass
Each line defines a different musical part:
- First line: Full chords playing 5 notes in 8 steps
- Second line: Ascending arpeggios playing 7 notes in 12 steps
- Third line: Bass notes playing 4 notes in 8 steps
-
Generating Notes
tm = TimeManipulator().setPPQ(96).setChordDuration(data.chordDuration).setBPM(data.bpm) generators = data.createLineGenerators(tm) chords = generators[0].generateNotes(0)
This creates the actual musical notes with proper timing.
-
Accessing Note Data
print(f"Note[midi: {note.getMidiNoteValue()}, startTime: {note.getStartTime():.1f}, length: {note.getLength():.1f}]")
Each note contains:
midi: The MIDI note number (pitch)startTime: When the note starts (in beats)length: How long the note lasts (in beats)
What You Can Do With This
GoldenPond doesn't play music directly - it creates a data structure that you can use to:
- Generate MIDI files (see the
midi_example.pyin the repository) - Create music in your own application
- Analyze musical patterns
- Experiment with different chord progressions and rhythms
For more details about the chord and rhythm languages, visit the GoldenPond website.
Technical Note
The GoldenPond library is written in Haxe and transpiled to Python. The source repository contains the original Haxe code and build scripts.
Metadata
Release files for goldenpond 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| goldenpond-0.5.0.tar.gz | 39.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| goldenpond-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 78.6 kB
Release files / goldenpond-0.5.0.tar.gz
| Download URL | goldenpond-0.5.0.tar.gz |
|---|---|
| Size | 39.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1086886a5dd8d94a48f1b6bb9a427f7c34d92107f9d2062e0fad8f4208846742
|
|
BLAKE2b-256 checksum How to use checksums |
51b205a91716dd87d3785becf8bf742f6fa7b2105970060e327f8d9e2ccee0c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / goldenpond-0.5.0-py3-none-any.whl
| Download URL | goldenpond-0.5.0-py3-none-any.whl |
|---|---|
| Size | 39.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e30f35fd19128c3f5f99a07623a3bb74ea0d3d3039b2f80926b0b48d8fe767ef
|
|
BLAKE2b-256 checksum How to use checksums |
c13f82b6826d8af1f36397e6b6dd61e0de03b2989aa3d268cdf0567354bf6b83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Security for goldenpond 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.