CreativePython 0.1.1__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {creativepython-0.1.1 → creativepython-0.1.3}/MANIFEST.in +1 -0
- {creativepython-0.1.1/src/CreativePython.egg-info → creativepython-0.1.3}/PKG-INFO +18 -13
- {creativepython-0.1.1 → creativepython-0.1.3}/README.md +17 -12
- {creativepython-0.1.1 → creativepython-0.1.3}/pyproject.toml +1 -1
- creativepython-0.1.1/src/CreativePython/scripts/creativePythonSetup.py → creativepython-0.1.3/src/CreativePython/_creativepythonSetup.py +29 -10
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/_soundfont.py +14 -7
- creativepython-0.1.3/src/CreativePython/resources/.DS_Store +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3/src/CreativePython.egg-info}/PKG-INFO +18 -13
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython.egg-info/SOURCES.txt +6 -2
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython.egg-info/top_level.txt +3 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/gui.py +81 -67
- creativepython-0.1.3/src/iannix.py +455 -0
- creativepython-0.1.3/src/markov.py +543 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/music.py +71 -73
- {creativepython-0.1.1 → creativepython-0.1.3}/src/timer.py +7 -6
- creativepython-0.1.3/src/zipf.py +224 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/LICENSE +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/setup.cfg +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/__init__.py +0 -0
- {creativepython-0.1.1/src/CreativePython/resources → creativepython-0.1.3/src/CreativePython/examples}/.DS_Store +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/ArvoPart.CantusInMemoriam.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/ConcretPH_Xenakis.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/DeepPurple.SmokeOnTheWater.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/JS_Bach.Canon.TriasHarmonica.BWV1072.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/JS_Bach.Canon_1.GoldbergGround.BWV1087.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/Mozart.MusikalischesWurfelspiel.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/PierreCage.StructuresPourDeuxChances.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/RGB_Display.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/TerryRiley.InC.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/arpeggiator1.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/arpeggiator2.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/autumnLeaves.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/axelF.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/biosignals.txt +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/boids.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/brownianMelody.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/changesByTupac.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/clementine.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/continuousPitchInstrumentAudio.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/drumExample.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/drumMachinePattern1.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/drumsComeAlive.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/fibonacci.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/findPitchOctave.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/furElise.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/generativeMusic.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/goldenTree.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/guidoWordMusic.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/harmonicesMundi.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/harmonicesMundiRevisisted.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/harmonographLateral.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/harmonographRotary.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoBlackDown.png +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoOctave.png +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoParallel.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoSimple.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoWhiteCenterDown.png +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoWhiteLeftDown.png +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/iPianoWhiteRightDown.png +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiIn1.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiIn2.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiIn3.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiOut.a.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiOut.b.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiSynthesizer.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/midiSynthesizer2.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/moondog-bird_slament.wav +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/musicalSphere.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/note.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/octoplus.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/oscIn1.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/oscIn2.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/pentatonicMelody.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/pianoPhase.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/pianoRollGenerator.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/playNote.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/proteinMusic.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/randomCircles.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/randomCirclesThroughMidiInput.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/randomCirclesTimed.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/retrograde.a.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/retrograde.b.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/retrograde.c.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/rowYourBoat.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/scaleTutor.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/sierpinskiTriangle.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/simpleButtonInstrument.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/simpleCircleInstrument.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/sineMelody.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/sineMelodyPlus.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/sliderControl.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/sonifyBiosignals.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/sonifyImage.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/soundscapeLoutrakiSunset.jpg +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/stringQuartet.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/textMusic.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/theWayItIs.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/themeAndVariations.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/throwingDice.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/windChimes.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/examples/zipfMetrics.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/resources/550973__luizguilherme_a__clean-guitarr-riff.mp3 +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/resources/chopper.jpg +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython/resources/de-brazzas-monkey.jpg +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython.egg-info/dependency_links.txt +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/CreativePython.egg-info/requires.txt +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/_RealtimeAudioPlayer.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/image.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/midi.py +0 -0
- {creativepython-0.1.1 → creativepython-0.1.3}/src/osc.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CreativePython
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A Python-based software environment for developing algorithmic art projects.
|
|
5
5
|
Author-email: "Dr. Bill Manaris" <manaris@cofc.edu>, Taj Ballinger <ballingertj@g.cofc.edu>, Trevor Ritchie <ritchiets@g.cofc.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -53,19 +53,26 @@ CreativePython is a Python-based software environment for learning and developin
|
|
|
53
53
|
|
|
54
54
|
CreativePython is distributed under the MIT License.
|
|
55
55
|
|
|
56
|
-
[Homepage](https://jythonmusic.me/)
|
|
56
|
+
- [Homepage](https://jythonmusic.me/)
|
|
57
|
+
- [Download All Examples [ZIP]](https://www.dropbox.com/scl/fo/rvc8m8pt4m0281qn0t4oi/AO2Y0W2qOrOcurlQmLa7M54?rlkey=0sf80bmov135tc85dk9k7ats6&dl=1)
|
|
57
58
|
|
|
58
59
|
This package is still under development.
|
|
59
60
|
|
|
60
61
|
# Beginner Installation (IDLE)
|
|
61
62
|
|
|
62
|
-
Download and install the latest version of [Python](https://www.python.org/downloads/).
|
|
63
|
+
1. Download and install the latest version of [Python](https://www.python.org/downloads/).
|
|
63
64
|
|
|
64
|
-
Download the [CreativePython
|
|
65
|
+
2. Download the [CreativePython Setup Script](https://www.dropbox.com/scl/fi/253bvfqsf0ij3rmza88q5/_creativepythonSetup.py?rlkey=iu4y4u8pujltgfx6kbjmodu9m&dl=1).
|
|
65
66
|
|
|
66
|
-
Open
|
|
67
|
+
3. Open `creativePythonSetup.py` with IDLE, Python's Integrated Development Learning Environment.
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
4. From the IDLE toolbar, select `Run`, then `Run Module`.
|
|
70
|
+
|
|
71
|
+
5. CreativePython will check for its requirements on your system, download any missing requirements, and install its libraries.
|
|
72
|
+
|
|
73
|
+
6. When you see `[CreativePython Setup]: CreativePython installed successfully.`, you're all done! You're ready to start using CreativePython.
|
|
74
|
+
|
|
75
|
+
**NOTE**: You can use the setup script in any Python3 environment - not just IDLE!
|
|
69
76
|
|
|
70
77
|
# Custom Installation
|
|
71
78
|
|
|
@@ -97,7 +104,7 @@ pip install CreativePython
|
|
|
97
104
|
|
|
98
105
|
# Using CreativePython
|
|
99
106
|
|
|
100
|
-
##
|
|
107
|
+
## Importing Libraries
|
|
101
108
|
|
|
102
109
|
CreativePython's core modules are the `music`, `gui`, `image`, `timer`, `osc`, and `midi` libraries. You can import these libraries into your python code using:
|
|
103
110
|
|
|
@@ -109,9 +116,9 @@ from music import Note, Play, C4, HN
|
|
|
109
116
|
|
|
110
117
|
Or a similar statement. CreativePython includes a number of useful constants, so we recommend using wildcard imports like `from music import *`.
|
|
111
118
|
|
|
112
|
-
**NOTE**:
|
|
119
|
+
**NOTE**: The first time you import `music`, CreativePython will ask permission to download a high-quality soundfont (FluidR3 G2-2.sf2) for you. You should only have to do this once.
|
|
113
120
|
|
|
114
|
-
##
|
|
121
|
+
## Running CreativePython programs
|
|
115
122
|
|
|
116
123
|
CreativePython is designed for use in Python's Interactive Mode. To use Interactive Mode, enter a command like:
|
|
117
124
|
|
|
@@ -133,7 +140,7 @@ note = Note(C4, HN) # create a middle C half note
|
|
|
133
140
|
Play.midi(note) # and play it!
|
|
134
141
|
```
|
|
135
142
|
|
|
136
|
-
In a terminal, run the code
|
|
143
|
+
In a terminal, run the code in interactive mode:
|
|
137
144
|
|
|
138
145
|
```
|
|
139
146
|
python -i playNote.py
|
|
@@ -141,6 +148,4 @@ python -i playNote.py
|
|
|
141
148
|
|
|
142
149
|
If this is the first time you've used CreativePython, it will ask to download a soundfont.
|
|
143
150
|
|
|
144
|
-
After
|
|
145
|
-
|
|
146
|
-
[[Download All Examples](https://www.dropbox.com/scl/fo/rvc8m8pt4m0281qn0t4oi/AO2Y0W2qOrOcurlQmLa7M54?rlkey=0sf80bmov135tc85dk9k7ats6&dl=1)]
|
|
151
|
+
After you do, you should hear a single C4 half-note.
|
|
@@ -4,19 +4,26 @@ CreativePython is a Python-based software environment for learning and developin
|
|
|
4
4
|
|
|
5
5
|
CreativePython is distributed under the MIT License.
|
|
6
6
|
|
|
7
|
-
[Homepage](https://jythonmusic.me/)
|
|
7
|
+
- [Homepage](https://jythonmusic.me/)
|
|
8
|
+
- [Download All Examples [ZIP]](https://www.dropbox.com/scl/fo/rvc8m8pt4m0281qn0t4oi/AO2Y0W2qOrOcurlQmLa7M54?rlkey=0sf80bmov135tc85dk9k7ats6&dl=1)
|
|
8
9
|
|
|
9
10
|
This package is still under development.
|
|
10
11
|
|
|
11
12
|
# Beginner Installation (IDLE)
|
|
12
13
|
|
|
13
|
-
Download and install the latest version of [Python](https://www.python.org/downloads/).
|
|
14
|
+
1. Download and install the latest version of [Python](https://www.python.org/downloads/).
|
|
14
15
|
|
|
15
|
-
Download the [CreativePython
|
|
16
|
+
2. Download the [CreativePython Setup Script](https://www.dropbox.com/scl/fi/253bvfqsf0ij3rmza88q5/_creativepythonSetup.py?rlkey=iu4y4u8pujltgfx6kbjmodu9m&dl=1).
|
|
16
17
|
|
|
17
|
-
Open
|
|
18
|
+
3. Open `creativePythonSetup.py` with IDLE, Python's Integrated Development Learning Environment.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
4. From the IDLE toolbar, select `Run`, then `Run Module`.
|
|
21
|
+
|
|
22
|
+
5. CreativePython will check for its requirements on your system, download any missing requirements, and install its libraries.
|
|
23
|
+
|
|
24
|
+
6. When you see `[CreativePython Setup]: CreativePython installed successfully.`, you're all done! You're ready to start using CreativePython.
|
|
25
|
+
|
|
26
|
+
**NOTE**: You can use the setup script in any Python3 environment - not just IDLE!
|
|
20
27
|
|
|
21
28
|
# Custom Installation
|
|
22
29
|
|
|
@@ -48,7 +55,7 @@ pip install CreativePython
|
|
|
48
55
|
|
|
49
56
|
# Using CreativePython
|
|
50
57
|
|
|
51
|
-
##
|
|
58
|
+
## Importing Libraries
|
|
52
59
|
|
|
53
60
|
CreativePython's core modules are the `music`, `gui`, `image`, `timer`, `osc`, and `midi` libraries. You can import these libraries into your python code using:
|
|
54
61
|
|
|
@@ -60,9 +67,9 @@ from music import Note, Play, C4, HN
|
|
|
60
67
|
|
|
61
68
|
Or a similar statement. CreativePython includes a number of useful constants, so we recommend using wildcard imports like `from music import *`.
|
|
62
69
|
|
|
63
|
-
**NOTE**:
|
|
70
|
+
**NOTE**: The first time you import `music`, CreativePython will ask permission to download a high-quality soundfont (FluidR3 G2-2.sf2) for you. You should only have to do this once.
|
|
64
71
|
|
|
65
|
-
##
|
|
72
|
+
## Running CreativePython programs
|
|
66
73
|
|
|
67
74
|
CreativePython is designed for use in Python's Interactive Mode. To use Interactive Mode, enter a command like:
|
|
68
75
|
|
|
@@ -84,7 +91,7 @@ note = Note(C4, HN) # create a middle C half note
|
|
|
84
91
|
Play.midi(note) # and play it!
|
|
85
92
|
```
|
|
86
93
|
|
|
87
|
-
In a terminal, run the code
|
|
94
|
+
In a terminal, run the code in interactive mode:
|
|
88
95
|
|
|
89
96
|
```
|
|
90
97
|
python -i playNote.py
|
|
@@ -92,6 +99,4 @@ python -i playNote.py
|
|
|
92
99
|
|
|
93
100
|
If this is the first time you've used CreativePython, it will ask to download a soundfont.
|
|
94
101
|
|
|
95
|
-
After
|
|
96
|
-
|
|
97
|
-
[[Download All Examples](https://www.dropbox.com/scl/fo/rvc8m8pt4m0281qn0t4oi/AO2Y0W2qOrOcurlQmLa7M54?rlkey=0sf80bmov135tc85dk9k7ats6&dl=1)]
|
|
102
|
+
After you do, you should hear a single C4 half-note.
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "CreativePython"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.3"
|
|
8
8
|
description = "A Python-based software environment for developing algorithmic art projects."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
# Linux: None
|
|
6
6
|
|
|
7
7
|
import os, platform, shutil, subprocess
|
|
8
|
-
import sys
|
|
8
|
+
import sys, pathlib
|
|
9
9
|
|
|
10
10
|
debug = True
|
|
11
|
+
LOG_PATH = str(pathlib.Path.home() / "Desktop" / "creativepython-install.log")
|
|
11
12
|
|
|
12
13
|
class SetupError(Exception):
|
|
13
14
|
pass
|
|
@@ -15,16 +16,26 @@ class SetupError(Exception):
|
|
|
15
16
|
def _print(text):
|
|
16
17
|
print(f"[CreativePython Setup]: {text}")
|
|
17
18
|
|
|
18
|
-
def _run(cmd, env=os.environ):
|
|
19
|
-
|
|
19
|
+
def _run(cmd, env=os.environ, log=None, check=True, quiet=True):
|
|
20
|
+
if debug: _print(f"Running: {' '.join(cmd)}")
|
|
21
|
+
result = subprocess.run(
|
|
20
22
|
cmd,
|
|
21
|
-
check=
|
|
23
|
+
check=False,
|
|
22
24
|
text=True,
|
|
23
|
-
stdout=subprocess.PIPE,
|
|
24
|
-
stderr=subprocess.PIPE,
|
|
25
|
+
stdout=subprocess.PIPE if quiet else None,
|
|
26
|
+
stderr=subprocess.PIPE if quiet else None,
|
|
25
27
|
env=env
|
|
26
28
|
)
|
|
27
29
|
|
|
30
|
+
if log:
|
|
31
|
+
log.write(f"\n$ {' '.join(cmd)}\n")
|
|
32
|
+
if result.stdout: log.write(result.stdout)
|
|
33
|
+
if result.stderr: log.write(f"\n[stderr]\n{result.stderr}")
|
|
34
|
+
if check and result.returncode != 0:
|
|
35
|
+
raise SetupError(f"Command failed: {' '.join(cmd)} (exit {result.returncode})")
|
|
36
|
+
|
|
37
|
+
return result
|
|
38
|
+
|
|
28
39
|
|
|
29
40
|
def _findHomebrew():
|
|
30
41
|
if debug: _print("Looking for Homebrew...")
|
|
@@ -94,13 +105,21 @@ def _installBrewPackage(package, brew=None):
|
|
|
94
105
|
|
|
95
106
|
|
|
96
107
|
def _installCreativePython():
|
|
97
|
-
if debug: _print("Installing CreativePython...")
|
|
98
|
-
|
|
99
|
-
|
|
108
|
+
if debug: _print(f"Installing CreativePython... (log: {LOG_PATH})")
|
|
109
|
+
|
|
110
|
+
with open(LOG_PATH, "w", encoding="utf-8", errors="replace") as log:
|
|
111
|
+
# find the python interpreter location
|
|
112
|
+
py = sys.executable
|
|
113
|
+
|
|
114
|
+
_run([py, '-m', 'pip', 'install', '--upgrade', 'pip', 'setuptools', 'wheel'], log=log, check=False)
|
|
115
|
+
_run([py, '-m', 'pip', 'install', '--no-cache-dir', 'CreativePython'], log=log, quiet=True)
|
|
100
116
|
|
|
101
|
-
import music # import music to install soundfont
|
|
102
117
|
if debug: _print("CreativePython installed successfully.")
|
|
103
118
|
|
|
119
|
+
import music # import music to trigger soundfont download
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
104
123
|
if __name__ == "__main__":
|
|
105
124
|
|
|
106
125
|
if platform.system() == "Darwin": # check for MacOS...
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from platformdirs import user_data_dir
|
|
3
3
|
from pooch import retrieve
|
|
4
|
-
import
|
|
4
|
+
import os
|
|
5
5
|
|
|
6
6
|
APP = "CreativePython"
|
|
7
7
|
ORG = "CofC"
|
|
@@ -15,10 +15,6 @@ SF2_SHA256 = "2ae766ab5c5deb6f7fffacd6316ec9f3699998cce821df3163e7b10a78a64066"
|
|
|
15
15
|
|
|
16
16
|
##### SOUNDFONTS #####
|
|
17
17
|
|
|
18
|
-
def _soundfontPath():
|
|
19
|
-
"""Expose the intended soundfont path as a method."""
|
|
20
|
-
return SOUNDFONT_PATH
|
|
21
|
-
|
|
22
18
|
def _findSoundfont(candidate=None):
|
|
23
19
|
"""
|
|
24
20
|
Finds a soundfont 'default.sf2' and returns its location.
|
|
@@ -45,6 +41,7 @@ def _findSoundfont(candidate=None):
|
|
|
45
41
|
c = candidates[i]
|
|
46
42
|
if c and c.exists():
|
|
47
43
|
soundfontPath = str(c)
|
|
44
|
+
i = i + 1
|
|
48
45
|
|
|
49
46
|
return soundfontPath
|
|
50
47
|
|
|
@@ -59,8 +56,18 @@ def _downloadSoundfont(destination=SOUNDFONT_PATH):
|
|
|
59
56
|
path = retrieve(
|
|
60
57
|
url=SF2_URL,
|
|
61
58
|
known_hash=f"sha256:{SF2_SHA256}",
|
|
62
|
-
progressbar=
|
|
59
|
+
progressbar=False,
|
|
63
60
|
fname=destination.name,
|
|
64
61
|
path=str(destination.parent)
|
|
65
62
|
)
|
|
66
|
-
return path
|
|
63
|
+
return path
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _installSoundfont():
|
|
67
|
+
soundfontPath = _findSoundfont()
|
|
68
|
+
if not soundfontPath:
|
|
69
|
+
print(f"[CREATIVEPYTHON SETUP]: Downloading MIDI Soundfont...")
|
|
70
|
+
_soundfontPath = _downloadSoundfont()
|
|
71
|
+
print(f"[CREATIVEPYTHON SETUP]: Soundfont downloaded to {_soundfontPath}")
|
|
72
|
+
|
|
73
|
+
return _soundfontPath
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CreativePython
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.3
|
|
4
4
|
Summary: A Python-based software environment for developing algorithmic art projects.
|
|
5
5
|
Author-email: "Dr. Bill Manaris" <manaris@cofc.edu>, Taj Ballinger <ballingertj@g.cofc.edu>, Trevor Ritchie <ritchiets@g.cofc.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -53,19 +53,26 @@ CreativePython is a Python-based software environment for learning and developin
|
|
|
53
53
|
|
|
54
54
|
CreativePython is distributed under the MIT License.
|
|
55
55
|
|
|
56
|
-
[Homepage](https://jythonmusic.me/)
|
|
56
|
+
- [Homepage](https://jythonmusic.me/)
|
|
57
|
+
- [Download All Examples [ZIP]](https://www.dropbox.com/scl/fo/rvc8m8pt4m0281qn0t4oi/AO2Y0W2qOrOcurlQmLa7M54?rlkey=0sf80bmov135tc85dk9k7ats6&dl=1)
|
|
57
58
|
|
|
58
59
|
This package is still under development.
|
|
59
60
|
|
|
60
61
|
# Beginner Installation (IDLE)
|
|
61
62
|
|
|
62
|
-
Download and install the latest version of [Python](https://www.python.org/downloads/).
|
|
63
|
+
1. Download and install the latest version of [Python](https://www.python.org/downloads/).
|
|
63
64
|
|
|
64
|
-
Download the [CreativePython
|
|
65
|
+
2. Download the [CreativePython Setup Script](https://www.dropbox.com/scl/fi/253bvfqsf0ij3rmza88q5/_creativepythonSetup.py?rlkey=iu4y4u8pujltgfx6kbjmodu9m&dl=1).
|
|
65
66
|
|
|
66
|
-
Open
|
|
67
|
+
3. Open `creativePythonSetup.py` with IDLE, Python's Integrated Development Learning Environment.
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
4. From the IDLE toolbar, select `Run`, then `Run Module`.
|
|
70
|
+
|
|
71
|
+
5. CreativePython will check for its requirements on your system, download any missing requirements, and install its libraries.
|
|
72
|
+
|
|
73
|
+
6. When you see `[CreativePython Setup]: CreativePython installed successfully.`, you're all done! You're ready to start using CreativePython.
|
|
74
|
+
|
|
75
|
+
**NOTE**: You can use the setup script in any Python3 environment - not just IDLE!
|
|
69
76
|
|
|
70
77
|
# Custom Installation
|
|
71
78
|
|
|
@@ -97,7 +104,7 @@ pip install CreativePython
|
|
|
97
104
|
|
|
98
105
|
# Using CreativePython
|
|
99
106
|
|
|
100
|
-
##
|
|
107
|
+
## Importing Libraries
|
|
101
108
|
|
|
102
109
|
CreativePython's core modules are the `music`, `gui`, `image`, `timer`, `osc`, and `midi` libraries. You can import these libraries into your python code using:
|
|
103
110
|
|
|
@@ -109,9 +116,9 @@ from music import Note, Play, C4, HN
|
|
|
109
116
|
|
|
110
117
|
Or a similar statement. CreativePython includes a number of useful constants, so we recommend using wildcard imports like `from music import *`.
|
|
111
118
|
|
|
112
|
-
**NOTE**:
|
|
119
|
+
**NOTE**: The first time you import `music`, CreativePython will ask permission to download a high-quality soundfont (FluidR3 G2-2.sf2) for you. You should only have to do this once.
|
|
113
120
|
|
|
114
|
-
##
|
|
121
|
+
## Running CreativePython programs
|
|
115
122
|
|
|
116
123
|
CreativePython is designed for use in Python's Interactive Mode. To use Interactive Mode, enter a command like:
|
|
117
124
|
|
|
@@ -133,7 +140,7 @@ note = Note(C4, HN) # create a middle C half note
|
|
|
133
140
|
Play.midi(note) # and play it!
|
|
134
141
|
```
|
|
135
142
|
|
|
136
|
-
In a terminal, run the code
|
|
143
|
+
In a terminal, run the code in interactive mode:
|
|
137
144
|
|
|
138
145
|
```
|
|
139
146
|
python -i playNote.py
|
|
@@ -141,6 +148,4 @@ python -i playNote.py
|
|
|
141
148
|
|
|
142
149
|
If this is the first time you've used CreativePython, it will ask to download a soundfont.
|
|
143
150
|
|
|
144
|
-
After
|
|
145
|
-
|
|
146
|
-
[[Download All Examples](https://www.dropbox.com/scl/fo/rvc8m8pt4m0281qn0t4oi/AO2Y0W2qOrOcurlQmLa7M54?rlkey=0sf80bmov135tc85dk9k7ats6&dl=1)]
|
|
151
|
+
After you do, you should hear a single C4 half-note.
|
|
@@ -4,18 +4,23 @@ README.md
|
|
|
4
4
|
pyproject.toml
|
|
5
5
|
src/_RealtimeAudioPlayer.py
|
|
6
6
|
src/gui.py
|
|
7
|
+
src/iannix.py
|
|
7
8
|
src/image.py
|
|
9
|
+
src/markov.py
|
|
8
10
|
src/midi.py
|
|
9
11
|
src/music.py
|
|
10
12
|
src/osc.py
|
|
11
13
|
src/timer.py
|
|
14
|
+
src/zipf.py
|
|
12
15
|
src/CreativePython/__init__.py
|
|
16
|
+
src/CreativePython/_creativepythonSetup.py
|
|
13
17
|
src/CreativePython/_soundfont.py
|
|
14
18
|
src/CreativePython.egg-info/PKG-INFO
|
|
15
19
|
src/CreativePython.egg-info/SOURCES.txt
|
|
16
20
|
src/CreativePython.egg-info/dependency_links.txt
|
|
17
21
|
src/CreativePython.egg-info/requires.txt
|
|
18
22
|
src/CreativePython.egg-info/top_level.txt
|
|
23
|
+
src/CreativePython/examples/.DS_Store
|
|
19
24
|
src/CreativePython/examples/ArvoPart.CantusInMemoriam.py
|
|
20
25
|
src/CreativePython/examples/ConcretPH_Xenakis.py
|
|
21
26
|
src/CreativePython/examples/DeepPurple.SmokeOnTheWater.py
|
|
@@ -100,5 +105,4 @@ src/CreativePython/examples/zipfMetrics.py
|
|
|
100
105
|
src/CreativePython/resources/.DS_Store
|
|
101
106
|
src/CreativePython/resources/550973__luizguilherme_a__clean-guitarr-riff.mp3
|
|
102
107
|
src/CreativePython/resources/chopper.jpg
|
|
103
|
-
src/CreativePython/resources/de-brazzas-monkey.jpg
|
|
104
|
-
src/CreativePython/scripts/creativePythonSetup.py
|
|
108
|
+
src/CreativePython/resources/de-brazzas-monkey.jpg
|
|
@@ -1480,108 +1480,122 @@ class Display(Interactable):
|
|
|
1480
1480
|
self._callbackFunctions['onClose'] = function
|
|
1481
1481
|
|
|
1482
1482
|
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
def drawLine(self, x1, y1, x2, y2):
|
|
1486
|
-
"""
|
|
1487
|
-
Draws a basic line from (x1, y1) to (x2, y2).
|
|
1483
|
+
# drawing functions (for convenience)
|
|
1484
|
+
def drawLine(self, x1, y1, x2, y2, color=Color.BLACK, thickness=1):
|
|
1488
1485
|
"""
|
|
1489
|
-
line
|
|
1490
|
-
self.add(line)
|
|
1491
|
-
return line
|
|
1486
|
+
Draw a line between the points (x1, y1) and (x2, y2) with given color and thickness.
|
|
1492
1487
|
|
|
1493
|
-
|
|
1494
|
-
"""
|
|
1495
|
-
Draws a basic circle with the specified radius and center coordinates.
|
|
1488
|
+
Returns the line object (in case we want to move it or delete it later).
|
|
1496
1489
|
"""
|
|
1497
|
-
|
|
1498
|
-
self.add(
|
|
1499
|
-
return
|
|
1490
|
+
line = Line(x1, y1, x2, y2, color, thickness) # create line
|
|
1491
|
+
self.add(line) # add it
|
|
1492
|
+
return line # and return it
|
|
1500
1493
|
|
|
1501
|
-
|
|
1502
|
-
def drawPoint(self, x, y):
|
|
1503
|
-
"""
|
|
1504
|
-
Draws a basic point at the specified coordinates.
|
|
1494
|
+
def drawCircle(self, x, y, radius, color = Color.BLACK, fill = False, thickness=1):
|
|
1505
1495
|
"""
|
|
1506
|
-
|
|
1507
|
-
self.add(point)
|
|
1508
|
-
return point
|
|
1509
|
-
|
|
1496
|
+
Draw a circle at (x, y) with the given radius, color, fill, and thickness.
|
|
1510
1497
|
|
|
1511
|
-
|
|
1498
|
+
Returns the circle object (in case we want to move it or delete it later).
|
|
1512
1499
|
"""
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
"""
|
|
1517
|
-
oval = Oval(x1, y1, x2, y2)
|
|
1518
|
-
self.add(oval)
|
|
1519
|
-
return oval
|
|
1520
|
-
|
|
1500
|
+
circle = Circle(x, y, radius, color, fill, thickness) # create circle
|
|
1501
|
+
self.add(circle) # add it
|
|
1502
|
+
return circle # and return it
|
|
1521
1503
|
|
|
1522
|
-
def
|
|
1504
|
+
def drawPoint(self, x, y, color = Color.BLACK, thickness=1):
|
|
1523
1505
|
"""
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1506
|
+
Draw a point at (x, y) with the given color and thickness.
|
|
1507
|
+
|
|
1508
|
+
Returns the point object (in case we want to move it or delete it later).
|
|
1527
1509
|
"""
|
|
1528
|
-
|
|
1529
|
-
self.add(
|
|
1530
|
-
return
|
|
1510
|
+
point = Point(x, y, color, thickness) # create point
|
|
1511
|
+
self.add(point) # add it
|
|
1512
|
+
return point # and return it
|
|
1531
1513
|
|
|
1514
|
+
def drawOval(self, x1, y1, x2, y2, color = Color.BLACK, fill = False, thickness = 1):
|
|
1515
|
+
"""
|
|
1516
|
+
Draw an oval using the coordinates of its enclosing rectangle with the given color,
|
|
1517
|
+
fill, and thickness.
|
|
1532
1518
|
|
|
1533
|
-
|
|
1519
|
+
Returns the oval object (in case we want to move it or delete it later).
|
|
1534
1520
|
"""
|
|
1535
|
-
|
|
1536
|
-
|
|
1521
|
+
oval = Oval(x1, y1, x2, y2, color, fill, thickness) # create oval
|
|
1522
|
+
self.add(oval) # add it
|
|
1523
|
+
return oval # and return it
|
|
1524
|
+
|
|
1525
|
+
def drawArc(self, x1, y1, x2, y2, startAngle, endAngle, color = Color.BLACK, fill = False, thickness = 1):
|
|
1537
1526
|
"""
|
|
1538
|
-
|
|
1539
|
-
self.add(polyline)
|
|
1540
|
-
return polyline
|
|
1527
|
+
Draw an arc using the provided coordinates, arc angles, color, fill, and thickness.
|
|
1541
1528
|
|
|
1529
|
+
Returns the arc object (in case we want to move it or delete it later).
|
|
1530
|
+
"""
|
|
1531
|
+
arc = Arc(x1, y1, x2, y2, startAngle, endAngle, color, fill, thickness) # create arc
|
|
1532
|
+
self.add(arc) # add it
|
|
1533
|
+
return arc # and return it
|
|
1542
1534
|
|
|
1543
|
-
def
|
|
1535
|
+
def drawRectangle(self, x1, y1, x2, y2, color = Color.BLACK, fill = False, thickness = 1):
|
|
1544
1536
|
"""
|
|
1545
|
-
|
|
1546
|
-
|
|
1537
|
+
Draw a rectangle using the provided coordinates, color, fill, and thickness.
|
|
1538
|
+
|
|
1539
|
+
Returns the rectangle object (in case we want to move it or delete it later).
|
|
1547
1540
|
"""
|
|
1548
|
-
|
|
1549
|
-
self.add(
|
|
1550
|
-
return
|
|
1541
|
+
rec = Rectangle(x1, y1, x2, y2, color, fill, thickness) # create rectangle
|
|
1542
|
+
self.add(rec) # add it
|
|
1543
|
+
return rec # and return it
|
|
1551
1544
|
|
|
1545
|
+
def drawPolygon(self, xPoints, yPoints, color = Color.BLACK, fill = False, thickness = 1):
|
|
1546
|
+
"""
|
|
1547
|
+
Draw a polygon using the provided coordinates, color, fill, and thickness.
|
|
1552
1548
|
|
|
1553
|
-
|
|
1549
|
+
Returns the polygon object (in case we want to move it or delete it later).
|
|
1554
1550
|
"""
|
|
1555
|
-
|
|
1551
|
+
poly = Polygon(xPoints, yPoints, color, fill, thickness) # create polygon
|
|
1552
|
+
self.add(poly) # add it
|
|
1553
|
+
return poly # and return it
|
|
1554
|
+
|
|
1555
|
+
def drawIcon(self, filename, x, y, width = None, height = None):
|
|
1556
1556
|
"""
|
|
1557
|
-
icon
|
|
1558
|
-
|
|
1559
|
-
self.add(icon)
|
|
1560
|
-
return icon
|
|
1557
|
+
Draw an icon (image) from the provided external file (.jpg or .png) at the given coordinates (top-left).
|
|
1558
|
+
Also rescale according to provided width and height (if any).
|
|
1561
1559
|
|
|
1560
|
+
Returns the icon object (in case we want to move it or delete it later).
|
|
1561
|
+
"""
|
|
1562
|
+
icon = Icon(filename, width, height) # load image (and rescale, if specified)
|
|
1563
|
+
self.add(icon, x, y) # add it at given coordinates
|
|
1564
|
+
return icon # and return it
|
|
1562
1565
|
|
|
1563
|
-
def drawImage(self, filename, x
|
|
1566
|
+
def drawImage(self, filename, x, y, width = None, height = None):
|
|
1564
1567
|
"""
|
|
1565
1568
|
Same as drawIcon().
|
|
1566
|
-
"""
|
|
1567
|
-
return self.drawIcon(filename, x, y)
|
|
1568
1569
|
|
|
1570
|
+
Returns the image object (in case we want to move it or delete it later).
|
|
1571
|
+
"""
|
|
1572
|
+
return self.drawIcon(filename, x, y, width, height)
|
|
1569
1573
|
|
|
1570
|
-
def drawLabel(self, text, x
|
|
1574
|
+
def drawLabel(self, text, x, y, color = Color.BLACK, font = None):
|
|
1571
1575
|
"""
|
|
1572
|
-
|
|
1576
|
+
Draw the text label on the display at the given coordinates (top-left) and with the provided
|
|
1577
|
+
color and font.
|
|
1578
|
+
|
|
1579
|
+
Returns the label object (in case we want to move it or delete it later).
|
|
1573
1580
|
"""
|
|
1574
|
-
label = Label(text)
|
|
1575
|
-
label.setPosition(x, y)
|
|
1576
|
-
self.add(label)
|
|
1577
|
-
return label
|
|
1578
1581
|
|
|
1582
|
+
# Font example - Font("Serif", Font.ITALIC, 16)
|
|
1583
|
+
#
|
|
1584
|
+
# see http://docs.oracle.com/javase/tutorial/2d/text/fonts.html#logical-fonts
|
|
1579
1585
|
|
|
1580
|
-
|
|
1586
|
+
label = Label(text, LEFT, color) # create label
|
|
1587
|
+
if font: # did they provide a font?
|
|
1588
|
+
label.setFont(font) # yes, so set it
|
|
1589
|
+
self.add(label, x, y) # add it at given coordinates
|
|
1590
|
+
return label # and return it
|
|
1591
|
+
|
|
1592
|
+
def drawText(self, text, x, y, color = Color.BLACK, font = None):
|
|
1581
1593
|
"""
|
|
1582
1594
|
Same as drawLabel().
|
|
1595
|
+
|
|
1596
|
+
Returns the label object (in case we want to move it or delete it later).
|
|
1583
1597
|
"""
|
|
1584
|
-
return self.drawLabel(text, x, y)
|
|
1598
|
+
return self.drawLabel(text, x, y, color, font)
|
|
1585
1599
|
|
|
1586
1600
|
|
|
1587
1601
|
#######################################################################################
|