music-melodicdevice 0.1.0__tar.gz → 0.1.2__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: music_melodicdevice
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Apply chromatic and diatonic transformations to music notes
5
5
  Author-email: Gene Boggs <gene.boggs@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -816,11 +816,52 @@ Return a list of three notes in place of the given `pitch` and `duration`.
816
816
  notes = device.slide(duration, from_pitch, to_pitch)
817
817
  ```
818
818
 
819
- Return a list of chromatic notes inclusively between the `from_pitch` and `to_pitch`, in place of the given `pitch` and `duration`.
819
+ Return a list of chromatic notes inclusively between the `from_pitch` and `to_pitch`, in place of the given `duration`.
820
820
 
821
821
  ## MUSICAL EXAMPLES
822
822
  ```python
823
- # TODO
823
+ from music21 import duration, note, stream
824
+ from music_melodicdevice import Device
825
+
826
+ device = Device(notes=['C4', 'E4', 'D4', 'G4'])
827
+ notes = device.invert('C5')
828
+
829
+ s = stream.Stream()
830
+ p = stream.Part()
831
+
832
+ for i in device.notes + notes:
833
+ n = note.Note(i)
834
+ n.duration = duration.Duration(1)
835
+ p.append(n)
836
+
837
+ s.append(p)
838
+ s.show()
839
+ ```
840
+ ```python
841
+ notes = ['C4', 'E4', 'D4', 'G4']
842
+
843
+ device = Device(scale_name='major')
844
+ device.notes = notes
845
+ device.notes = device.invert('C5')
846
+ device.notes = device.transpose(-5)
847
+
848
+ s = stream.Stream()
849
+ p = stream.Part()
850
+
851
+ for i,j in enumerate(notes + device.notes):
852
+ if (i + 1) % 4 == 0:
853
+ turn = device.turn(1, j)
854
+ for t in turn:
855
+ m = note.Note(t[1])
856
+ m.duration = duration.Duration(t[0])
857
+ p.append(m)
858
+ else:
859
+ n = note.Note(j)
860
+ n.duration = duration.Duration(1)
861
+ p.append(n)
862
+
863
+ s.append(p)
864
+ s.show()
824
865
  ```
825
866
 
826
867
  # SEE ALSO
@@ -121,11 +121,52 @@ Return a list of three notes in place of the given `pitch` and `duration`.
121
121
  notes = device.slide(duration, from_pitch, to_pitch)
122
122
  ```
123
123
 
124
- Return a list of chromatic notes inclusively between the `from_pitch` and `to_pitch`, in place of the given `pitch` and `duration`.
124
+ Return a list of chromatic notes inclusively between the `from_pitch` and `to_pitch`, in place of the given `duration`.
125
125
 
126
126
  ## MUSICAL EXAMPLES
127
127
  ```python
128
- # TODO
128
+ from music21 import duration, note, stream
129
+ from music_melodicdevice import Device
130
+
131
+ device = Device(notes=['C4', 'E4', 'D4', 'G4'])
132
+ notes = device.invert('C5')
133
+
134
+ s = stream.Stream()
135
+ p = stream.Part()
136
+
137
+ for i in device.notes + notes:
138
+ n = note.Note(i)
139
+ n.duration = duration.Duration(1)
140
+ p.append(n)
141
+
142
+ s.append(p)
143
+ s.show()
144
+ ```
145
+ ```python
146
+ notes = ['C4', 'E4', 'D4', 'G4']
147
+
148
+ device = Device(scale_name='major')
149
+ device.notes = notes
150
+ device.notes = device.invert('C5')
151
+ device.notes = device.transpose(-5)
152
+
153
+ s = stream.Stream()
154
+ p = stream.Part()
155
+
156
+ for i,j in enumerate(notes + device.notes):
157
+ if (i + 1) % 4 == 0:
158
+ turn = device.turn(1, j)
159
+ for t in turn:
160
+ m = note.Note(t[1])
161
+ m.duration = duration.Duration(t[0])
162
+ p.append(m)
163
+ else:
164
+ n = note.Note(j)
165
+ n.duration = duration.Duration(1)
166
+ p.append(n)
167
+
168
+ s.append(p)
169
+ s.show()
129
170
  ```
130
171
 
131
172
  # SEE ALSO
@@ -1,4 +1,4 @@
1
1
  # The root of the entire project
2
2
  from music_melodicdevice.music_melodicdevice import Device
3
3
 
4
- __version__ = "0.1.0"
4
+ __version__ = "0.1.2"
@@ -1,10 +1,6 @@
1
1
  import sys
2
2
  sys.path.append('./src')
3
3
  import music_melodicdevice.musical_scales as musical_scales
4
- from typing import List, Tuple, Optional, Union
5
-
6
- # TICKS = 96
7
- # OCTAVES = 10
8
4
 
9
5
  class Device:
10
6
  def __init__(self, scale_note='C', scale_name='chromatic', notes=[], verbose=0):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: music_melodicdevice
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Apply chromatic and diatonic transformations to music notes
5
5
  Author-email: Gene Boggs <gene.boggs@gmail.com>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -816,11 +816,52 @@ Return a list of three notes in place of the given `pitch` and `duration`.
816
816
  notes = device.slide(duration, from_pitch, to_pitch)
817
817
  ```
818
818
 
819
- Return a list of chromatic notes inclusively between the `from_pitch` and `to_pitch`, in place of the given `pitch` and `duration`.
819
+ Return a list of chromatic notes inclusively between the `from_pitch` and `to_pitch`, in place of the given `duration`.
820
820
 
821
821
  ## MUSICAL EXAMPLES
822
822
  ```python
823
- # TODO
823
+ from music21 import duration, note, stream
824
+ from music_melodicdevice import Device
825
+
826
+ device = Device(notes=['C4', 'E4', 'D4', 'G4'])
827
+ notes = device.invert('C5')
828
+
829
+ s = stream.Stream()
830
+ p = stream.Part()
831
+
832
+ for i in device.notes + notes:
833
+ n = note.Note(i)
834
+ n.duration = duration.Duration(1)
835
+ p.append(n)
836
+
837
+ s.append(p)
838
+ s.show()
839
+ ```
840
+ ```python
841
+ notes = ['C4', 'E4', 'D4', 'G4']
842
+
843
+ device = Device(scale_name='major')
844
+ device.notes = notes
845
+ device.notes = device.invert('C5')
846
+ device.notes = device.transpose(-5)
847
+
848
+ s = stream.Stream()
849
+ p = stream.Part()
850
+
851
+ for i,j in enumerate(notes + device.notes):
852
+ if (i + 1) % 4 == 0:
853
+ turn = device.turn(1, j)
854
+ for t in turn:
855
+ m = note.Note(t[1])
856
+ m.duration = duration.Duration(t[0])
857
+ p.append(m)
858
+ else:
859
+ n = note.Note(j)
860
+ n.duration = duration.Duration(1)
861
+ p.append(n)
862
+
863
+ s.append(p)
864
+ s.show()
824
865
  ```
825
866
 
826
867
  # SEE ALSO