CreativePython 0.1.7__tar.gz → 0.1.8__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.
Files changed (110) hide show
  1. {creativepython-0.1.7/src/CreativePython.egg-info → creativepython-0.1.8}/PKG-INFO +1 -1
  2. {creativepython-0.1.7 → creativepython-0.1.8}/pyproject.toml +1 -1
  3. {creativepython-0.1.7 → creativepython-0.1.8/src/CreativePython.egg-info}/PKG-INFO +1 -1
  4. {creativepython-0.1.7 → creativepython-0.1.8}/src/gui.py +35 -30
  5. {creativepython-0.1.7 → creativepython-0.1.8}/src/music.py +486 -114
  6. {creativepython-0.1.7 → creativepython-0.1.8}/src/timer.py +79 -165
  7. {creativepython-0.1.7 → creativepython-0.1.8}/LICENSE +0 -0
  8. {creativepython-0.1.7 → creativepython-0.1.8}/MANIFEST.in +0 -0
  9. {creativepython-0.1.7 → creativepython-0.1.8}/README.md +0 -0
  10. {creativepython-0.1.7 → creativepython-0.1.8}/setup.cfg +0 -0
  11. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/__init__.py +0 -0
  12. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/_creativepythonSetup.py +0 -0
  13. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/_soundfont.py +0 -0
  14. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/.DS_Store +0 -0
  15. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/ArvoPart.CantusInMemoriam.py +0 -0
  16. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/ConcretPH_Xenakis.py +0 -0
  17. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/DeepPurple.SmokeOnTheWater.py +0 -0
  18. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/JS_Bach.Canon.TriasHarmonica.BWV1072.py +0 -0
  19. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/JS_Bach.Canon_1.GoldbergGround.BWV1087.py +0 -0
  20. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/Mozart.MusikalischesWurfelspiel.py +0 -0
  21. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/PierreCage.StructuresPourDeuxChances.py +0 -0
  22. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/RGB_Display.py +0 -0
  23. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/TerryRiley.InC.py +0 -0
  24. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/arpeggiator1.py +0 -0
  25. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/arpeggiator2.py +0 -0
  26. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/autumnLeaves.py +0 -0
  27. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/axelF.py +0 -0
  28. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/biosignals.txt +0 -0
  29. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/boids.py +0 -0
  30. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/brownianMelody.py +0 -0
  31. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/changesByTupac.py +0 -0
  32. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/clementine.py +0 -0
  33. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/continuousPitchInstrumentAudio.py +0 -0
  34. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/drumExample.py +0 -0
  35. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/drumMachinePattern1.py +0 -0
  36. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/drumsComeAlive.py +0 -0
  37. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/fibonacci.py +0 -0
  38. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/findPitchOctave.py +0 -0
  39. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/furElise.py +0 -0
  40. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/generativeMusic.py +0 -0
  41. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/goldenTree.py +0 -0
  42. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/guidoWordMusic.py +0 -0
  43. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/harmonicesMundi.py +0 -0
  44. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/harmonicesMundiRevisisted.py +0 -0
  45. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/harmonographLateral.py +0 -0
  46. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/harmonographRotary.py +0 -0
  47. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoBlackDown.png +0 -0
  48. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoOctave.png +0 -0
  49. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoParallel.py +0 -0
  50. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoSimple.py +0 -0
  51. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoWhiteCenterDown.png +0 -0
  52. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoWhiteLeftDown.png +0 -0
  53. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/iPianoWhiteRightDown.png +0 -0
  54. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiIn1.py +0 -0
  55. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiIn2.py +0 -0
  56. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiIn3.py +0 -0
  57. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiOut.a.py +0 -0
  58. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiOut.b.py +0 -0
  59. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiSynthesizer.py +0 -0
  60. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/midiSynthesizer2.py +0 -0
  61. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/moondog-bird_slament.wav +0 -0
  62. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/musicalSphere.py +0 -0
  63. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/note.py +0 -0
  64. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/octoplus.py +0 -0
  65. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/oscIn1.py +0 -0
  66. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/oscIn2.py +0 -0
  67. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/pentatonicMelody.py +0 -0
  68. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/pianoPhase.py +0 -0
  69. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/pianoRollGenerator.py +0 -0
  70. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/playNote.py +0 -0
  71. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/proteinMusic.py +0 -0
  72. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/randomCircles.py +0 -0
  73. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/randomCirclesThroughMidiInput.py +0 -0
  74. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/randomCirclesTimed.py +0 -0
  75. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/retrograde.a.py +0 -0
  76. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/retrograde.b.py +0 -0
  77. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/retrograde.c.py +0 -0
  78. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/rowYourBoat.py +0 -0
  79. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/scaleTutor.py +0 -0
  80. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/sierpinskiTriangle.py +0 -0
  81. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/simpleButtonInstrument.py +0 -0
  82. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/simpleCircleInstrument.py +0 -0
  83. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/sineMelody.py +0 -0
  84. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/sineMelodyPlus.py +0 -0
  85. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/sliderControl.py +0 -0
  86. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/sonifyBiosignals.py +0 -0
  87. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/sonifyImage.py +0 -0
  88. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/soundscapeLoutrakiSunset.jpg +0 -0
  89. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/stringQuartet.py +0 -0
  90. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/textMusic.py +0 -0
  91. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/theWayItIs.py +0 -0
  92. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/themeAndVariations.py +0 -0
  93. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/throwingDice.py +0 -0
  94. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/windChimes.py +0 -0
  95. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/examples/zipfMetrics.py +0 -0
  96. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/resources/.DS_Store +0 -0
  97. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/resources/550973__luizguilherme_a__clean-guitarr-riff.mp3 +0 -0
  98. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/resources/chopper.jpg +0 -0
  99. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython/resources/de-brazzas-monkey.jpg +0 -0
  100. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython.egg-info/SOURCES.txt +0 -0
  101. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython.egg-info/dependency_links.txt +0 -0
  102. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython.egg-info/requires.txt +0 -0
  103. {creativepython-0.1.7 → creativepython-0.1.8}/src/CreativePython.egg-info/top_level.txt +0 -0
  104. {creativepython-0.1.7 → creativepython-0.1.8}/src/_RealtimeAudioPlayer.py +0 -0
  105. {creativepython-0.1.7 → creativepython-0.1.8}/src/iannix.py +0 -0
  106. {creativepython-0.1.7 → creativepython-0.1.8}/src/image.py +0 -0
  107. {creativepython-0.1.7 → creativepython-0.1.8}/src/markov.py +0 -0
  108. {creativepython-0.1.7 → creativepython-0.1.8}/src/midi.py +0 -0
  109. {creativepython-0.1.7 → creativepython-0.1.8}/src/osc.py +0 -0
  110. {creativepython-0.1.7 → creativepython-0.1.8}/src/zipf.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CreativePython
3
- Version: 0.1.7
3
+ Version: 0.1.8
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 = "0.1.7"
7
+ version = "0.1.8"
8
8
  description = "A Python-based software environment for developing algorithmic art projects."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: CreativePython
3
- Version: 0.1.7
3
+ Version: 0.1.8
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
@@ -567,10 +567,10 @@ class EventDispatcher(_QtCore.QObject):
567
567
  def __init__(self, display):
568
568
  super().__init__()
569
569
  self.display = display
570
- self.lastMouseDown = None # last location mouse down event occured (set to None when mouse is up)
571
- self.lastMouseMove = None # last known mouse movement/position
572
- self.moveThreshold = 5 # maximum distance to trigger a mouse click (down/up in the same place)
573
- self.focusItem = None # last item clicked on (doesn't need to have an event)
570
+ self.lastMouseDown = None # last location mouse down event occured (set to None when mouse is up)
571
+ self.lastMouseMove = None # last known mouse movement/position
572
+ self.moveThreshold = 5 # maximum distance to trigger a mouse click (down/up in the same place)
573
+ self.draggingItem = None # last item clicked on
574
574
  self.itemsUnderMouse = set() # set of items under last known mouse position
575
575
 
576
576
  self.display._view.viewport().installEventFilter(self) # redirect mouse events
@@ -630,10 +630,14 @@ class EventDispatcher(_QtCore.QObject):
630
630
  self.lastMouseDown = (x, y) # store mouse down position
631
631
  candidates = self._findObjectListAt(x, y) # find all items under mouse
632
632
 
633
- if len(candidates) > 0:
634
- self.focusItem = candidates[0] # store topmost item under mouse (for key events)
635
- else:
636
- self.focusItem = None
633
+ self.draggingItem = None # clear dragging item
634
+ i = 0
635
+ while self.draggingItem is None and i < len(candidates):
636
+ item = candidates[i]
637
+ if "mouseDrag" in item._callbackFunctions: # if item has a mouseDrag event, store it
638
+ self.draggingItem = item
639
+ i = i + 1
640
+
637
641
 
638
642
  # second, we can send event to display
639
643
  self.display._event("mouseDown", [x, y])
@@ -661,8 +665,8 @@ class EventDispatcher(_QtCore.QObject):
661
665
  if dx <= self.moveThreshold and dy <= self.moveThreshold: # is it under the threshold?
662
666
  isMouseClick = True # yes, this is also a mouseClick
663
667
 
664
- # self.focusItem = None # clear focus item
665
668
  self.lastMouseDown = None # clear mouse down position
669
+ self.draggingItem = None # clear dragging item
666
670
 
667
671
  # second, we can send event(s) to display
668
672
  self.display._event("mouseUp", [x, y])
@@ -708,11 +712,9 @@ class EventDispatcher(_QtCore.QObject):
708
712
  # second, we can send event to display
709
713
  self.display._event("mouseDrag", [x, y])
710
714
 
711
- # last, drag events only deliver to the last item we clicked on...
712
- # (that way we don't pick up other items while dragging)
713
- # so we send event to focus item, if it exists
714
- if self.focusItem is not None:
715
- moveHandled = self.focusItem._event("mouseDrag", [x,y])
715
+ # last, drag events to the dragging item
716
+ if self.draggingItem is not None:
717
+ moveHandled = self.draggingItem._event("mouseDrag", [x,y])
716
718
  else:
717
719
  moveHandled = False
718
720
 
@@ -774,7 +776,7 @@ class EventDispatcher(_QtCore.QObject):
774
776
 
775
777
  def handleKeyPress(self, event):
776
778
  """
777
- Delivers keyDown and keyType events to the display and last clicked item (focusItem).
779
+ Delivers keyDown and keyType events to the display and each item in the display.
778
780
  keyDown uses the numeric code for the pressed key.
779
781
  keyType uses the typed character for the pressed key (if any).
780
782
  """
@@ -786,20 +788,21 @@ class EventDispatcher(_QtCore.QObject):
786
788
  self.display._event("keyDown", [key])
787
789
  self.display._event("keyType", [char])
788
790
 
789
- # last, we send events to last clicked item (focusItem)
790
- if self.focusItem is not None:
791
- keyDownHandled = self.focusItem._event("keyDown", [key])
792
- keyTypeHandled = self.focusItem._event("keyType", [char])
793
- else:
794
- keyDownHandled = False
795
- keyTypeHandled = False
791
+ # last, we send events to each item
792
+ eventHandled = False
793
+
794
+ for item in self.display.items:
795
+ keyDownHandled = item._event("keyDown", [key])
796
+ keyTypeHandled = item._event("keyType", [char])
797
+ if keyDownHandled or keyTypeHandled:
798
+ eventHandled = True # if either event got handled by any item, report it
796
799
 
797
- return keyDownHandled or keyTypeHandled
800
+ return eventHandled
798
801
 
799
802
 
800
803
  def handleKeyRelease(self, event):
801
804
  """
802
- Delivers keyUp events to the display and last clicked item (focusItem).
805
+ Delivers keyUp events to the display and each item in the display.
803
806
  keyUp uses the numeric code for the pressed key.
804
807
  """
805
808
  # first, we need to find some information
@@ -808,13 +811,15 @@ class EventDispatcher(_QtCore.QObject):
808
811
  # second, we send event to display
809
812
  self.display._event("keyUp", [key])
810
813
 
811
- # last, we send event to last clicked item (focusItem)
812
- if self.focusItem is not None:
813
- keyUpHandled = self.focusItem._event("keyUp", [key])
814
- else:
815
- keyUpHandled = False
814
+ # last, we send event to each item
815
+ eventHandled = False
816
816
 
817
- return keyUpHandled
817
+ for item in self.display.items:
818
+ keyUpHandled = item._event("keyUp", [key])
819
+ if keyUpHandled:
820
+ eventHandled = True # if the event got handled by any item, report it
821
+
822
+ return eventHandled
818
823
 
819
824
 
820
825
  def _findMousePosition(self, event):