CreativePython 1.1.3__tar.gz → 1.1.5__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-1.1.3/src/CreativePython.egg-info → creativepython-1.1.5}/PKG-INFO +1 -1
- {creativepython-1.1.3 → creativepython-1.1.5}/pyproject.toml +1 -1
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/GuiHandler.py +50 -29
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/GuiRenderer.py +753 -476
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/__init__.py +6 -0
- {creativepython-1.1.3 → creativepython-1.1.5/src/CreativePython.egg-info}/PKG-INFO +1 -1
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython.egg-info/SOURCES.txt +6 -1
- {creativepython-1.1.3 → creativepython-1.1.5}/src/gui.py +56 -90
- {creativepython-1.1.3 → creativepython-1.1.5}/src/image.py +3 -2
- creativepython-1.1.5/src/midi.py +732 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/music.py +83 -50
- creativepython-1.1.5/src/osc.py +266 -0
- creativepython-1.1.5/tests/testCompress.py +12 -0
- creativepython-1.1.5/tests/testGameboard.py +49 -0
- creativepython-1.1.5/tests/testToolTips.py +16 -0
- creativepython-1.1.5/tests/test_midi.py +71 -0
- creativepython-1.1.5/tests/test_osc.py +71 -0
- creativepython-1.1.3/src/midi.py +0 -1007
- creativepython-1.1.3/src/osc.py +0 -450
- {creativepython-1.1.3 → creativepython-1.1.5}/LICENSE +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/LICENSE-PSF +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/MANIFEST.in +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/README.md +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/setup.cfg +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/RealtimeAudioPlayer.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/Java-Comparison-Tests/advMetricRunner.pythonSurvey.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/Java-Comparison-Tests/compareMetrics_Java-Vs-Python.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/RunMetrics.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/Surveyor.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/__init__.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/Confidence.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/Contig.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/ExtendedNote.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/Histogram.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/Judgement.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/Measurement.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/PianoRoll.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/PianoRollOld.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/__init__.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_ExtendedNote.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_Histogram.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_Measurement.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_PianoRoll_assertions.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_PianoRoll_integration.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_PianoRoll_quantization.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/data/test_PianoRoll_unit.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/Metric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/ZipfMetrics.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/__init__.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ChordDensityMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ChordDistanceMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ChordMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ChordNormalizedMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ChromaticToneMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ContourBasslineDurationMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ContourBasslineDurationQuantizedMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ContourBasslinePitchMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ContourMelodyDurationMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ContourMelodyDurationQuantizedMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/ContourMelodyPitchMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/DurationBigramMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/DurationDistanceMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/DurationMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/DurationQuantizedBigramMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/DurationQuantizedDistanceMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/DurationQuantizedMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/HarmonicBigramMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/HarmonicConsonanceMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/HarmonicIntervalMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/MelodicBigramMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/MelodicConsonanceMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/MelodicIntervalMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/PitchDistanceMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/PitchDurationMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/PitchDurationQuantizedMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/PitchMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/RestMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/__init__.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_DurationMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_BasicIntervalsAndBigrams.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_ChordsAndConsonance.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_ContoursAndChromatic.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_Metrics_QuantizedDurationsAndDistances.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_PitchMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/simple/test_RestMetric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/metrics/test_Metric.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/utilities/CSVWriter.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/utilities/PowerLawRandom.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/nevmuse/utilities/__init__.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython/notationRenderer.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython.egg-info/dependency_links.txt +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython.egg-info/requires.txt +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/CreativePython.egg-info/top_level.txt +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/bin/libportaudio.2.dylib +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/iannix.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/markov.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/timer.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/src/zipf.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/tests/testAnimate.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/tests/testHitTesting.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/tests/testPeer.py +0 -0
- {creativepython-1.1.3 → creativepython-1.1.5}/tests/test_keyEvent.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: CreativePython
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.5
|
|
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
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "CreativePython"
|
|
7
|
-
version = "1.1.
|
|
7
|
+
version = "1.1.5"
|
|
8
8
|
description = "A Python-based software environment for developing algorithmic art projects."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { file = "LICENSE" }
|
|
@@ -66,37 +66,58 @@ def _createEvent(eventType, target, args=None):
|
|
|
66
66
|
# Child process entry point
|
|
67
67
|
#######################################################################################
|
|
68
68
|
|
|
69
|
-
def _launchRenderer(
|
|
69
|
+
def _launchRenderer(childCommandConnection, childPriorityConnection, parentPriorityConnection):
|
|
70
70
|
"""
|
|
71
71
|
Entry point for the GuiRenderer child process.
|
|
72
72
|
Defined here so GuiHandler can reference it without importing from GuiRenderer
|
|
73
73
|
globally (which would also import Qt/PySide6 in the parent process).
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
childPriorityConnection is the child end of the duplex admin pipe; the child watches it
|
|
76
76
|
with QSocketNotifier. Admin commands (setRate, getRate) arrive here, bypassing
|
|
77
|
-
the command buffer. When the parent closes its end (
|
|
77
|
+
the command buffer. When the parent closes its end (parentPriorityConnection), the child
|
|
78
78
|
receives EOF and initiates shutdown.
|
|
79
79
|
|
|
80
|
-
|
|
80
|
+
parentPriorityConnection is the parent's end; the child closes it immediately so that
|
|
81
81
|
only the parent holds it — ensuring the child sees EOF when the parent closes.
|
|
82
82
|
|
|
83
83
|
At runtime this function only executes in the child process.
|
|
84
84
|
"""
|
|
85
|
-
import sys, os
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
#
|
|
90
|
-
#
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
85
|
+
import sys, os, traceback
|
|
86
|
+
|
|
87
|
+
parentPriorityConnection.close() # child must not hold the parent end open
|
|
88
|
+
|
|
89
|
+
# Set to True to redirect stderr to PENCIL_debug.log for diagnostics.
|
|
90
|
+
# When False, stderr is silenced (sent to /dev/null) to suppress Qt/Cocoa noise.
|
|
91
|
+
_DEBUG_LOG = False
|
|
92
|
+
|
|
93
|
+
if _DEBUG_LOG:
|
|
94
|
+
# Redirect stderr (fd 2) to a log file so both Python tracebacks and C-level
|
|
95
|
+
# output from Qt/Cocoa/XPC are captured for diagnostics.
|
|
96
|
+
# The log is removed on clean exit if nothing was written to it.
|
|
97
|
+
_logPath = os.path.join(os.getcwd(), "PENCIL_debug.log")
|
|
98
|
+
_logFile = open(_logPath, "w")
|
|
99
|
+
else:
|
|
100
|
+
_logPath = None
|
|
101
|
+
_logFile = open(os.devnull, "w")
|
|
102
|
+
|
|
103
|
+
os.dup2(_logFile.fileno(), 2)
|
|
104
|
+
sys.stderr = _logFile
|
|
105
|
+
|
|
106
|
+
try:
|
|
107
|
+
from CreativePython.GuiRenderer import GuiRenderer
|
|
108
|
+
renderer = GuiRenderer(childCommandConnection, childPriorityConnection)
|
|
109
|
+
renderer.run()
|
|
110
|
+
except Exception:
|
|
111
|
+
traceback.print_exc()
|
|
112
|
+
raise
|
|
113
|
+
finally:
|
|
114
|
+
_logFile.flush()
|
|
115
|
+
if _DEBUG_LOG and _logPath and os.path.getsize(_logPath) == 0:
|
|
116
|
+
try:
|
|
117
|
+
_logFile.close()
|
|
118
|
+
os.unlink(_logPath)
|
|
119
|
+
except OSError:
|
|
120
|
+
pass
|
|
100
121
|
|
|
101
122
|
|
|
102
123
|
#######################################################################################
|
|
@@ -119,8 +140,8 @@ class GuiHandler:
|
|
|
119
140
|
Registers an atexit handler so the child is always cleaned up when
|
|
120
141
|
the parent process exits — no cleanup code required in gui.py.
|
|
121
142
|
"""
|
|
122
|
-
|
|
123
|
-
self.connection =
|
|
143
|
+
parentCommandConnection, childCommandConnection = multiprocessing.Pipe(duplex=True)
|
|
144
|
+
self.connection = parentCommandConnection
|
|
124
145
|
|
|
125
146
|
# Choose the spawn context based on the runtime environment:
|
|
126
147
|
#
|
|
@@ -157,13 +178,13 @@ class GuiHandler:
|
|
|
157
178
|
else:
|
|
158
179
|
ctx = multiprocessing.get_context('fork')
|
|
159
180
|
|
|
160
|
-
# Dedicated duplex admin pipe. The parent holds
|
|
161
|
-
# holds
|
|
162
|
-
# bypassing the command buffer entirely. Closing
|
|
181
|
+
# Dedicated duplex admin pipe. The parent holds parentPriorityConnection; the child
|
|
182
|
+
# holds childPriorityConnection. Admin commands (setRate, getRate) travel here,
|
|
183
|
+
# bypassing the command buffer entirely. Closing parentPriorityConnection sends EOF
|
|
163
184
|
# to the child, which Qt detects via QSocketNotifier and treats as shutdown —
|
|
164
185
|
# independent of the command queue and independent of whether atexit runs.
|
|
165
|
-
|
|
166
|
-
self._adminConn =
|
|
186
|
+
childPriorityConnection, parentPriorityConnection = multiprocessing.Pipe(duplex=True)
|
|
187
|
+
self._adminConn = parentPriorityConnection
|
|
167
188
|
|
|
168
189
|
# With 'spawn' on POSIX (fork+exec), the forked helper calls
|
|
169
190
|
# get_preparation_data() which reads sys.modules['__main__'].__file__.
|
|
@@ -184,7 +205,7 @@ class GuiHandler:
|
|
|
184
205
|
try:
|
|
185
206
|
self.childProcess = ctx.Process(
|
|
186
207
|
target = _launchRenderer,
|
|
187
|
-
args = (
|
|
208
|
+
args = (childCommandConnection, childPriorityConnection, parentPriorityConnection),
|
|
188
209
|
daemon = True # child is killed automatically if parent dies unexpectedly
|
|
189
210
|
)
|
|
190
211
|
self.childProcess.start()
|
|
@@ -194,8 +215,8 @@ class GuiHandler:
|
|
|
194
215
|
_main_mod.__file__ = _saved_file
|
|
195
216
|
if _saved_spec is not _UNSET:
|
|
196
217
|
_main_mod.__spec__ = _saved_spec
|
|
197
|
-
|
|
198
|
-
|
|
218
|
+
childCommandConnection.close() # parent no longer needs the child end of the command pipe
|
|
219
|
+
childPriorityConnection.close() # parent no longer needs the child end of the admin pipe
|
|
199
220
|
|
|
200
221
|
# responseId counter — each sendQuery() call gets a unique ID so the
|
|
201
222
|
# listener thread can route the response back to the correct caller
|