Skip to content

Commit c4a6b1d

Browse files
introduce hackWildJumps
1 parent e534ad5 commit c4a6b1d

File tree

6 files changed

+130
-87
lines changed

6 files changed

+130
-87
lines changed

Parthenopea/Music/Passage.lhs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ _Overall_ =
137137
> final :: Music1 MekNote Music1
138138
> final music mek =
139139
> music :+: case mek.mPrimitive of
140-
> Note durI pitchI
141-
> note durI (pitchI, Dynamics fName_ : (makeNas . deJust fName) mek.mParams)
140+
> Note durI pitchI mangleNote durI pitchI
142141
> Rest durI rest durI
143142
> where
144143
> fName = "final"
@@ -153,6 +152,8 @@ _Overall_ =
153152
> average :: VB.Vector Double Velocity
154153
> average directive = round $ VB.sum directive / (fromIntegral . VB.length) directive
155154
>
155+
> mangleNote dM pM = note dM (pM, Dynamics fName_ : (makeNas . deJust fName) mek.mParams)
156+
>
156157
> -- evolve enriched note/rest (MekNote) list
157158
> rawMeks, withEvents, withOveralls, seeded, enriched
158159
> :: VB.Vector MekNote

Parthenopea/Repro/Smashing.lhs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ cache and custom-index it by the three coordinates.
3232

3333
The winning Zone(s) drive the note synthesis.
3434

35-
This source file implements a generalization of that setup. See computeInstSmashup. We must know all the "subspaces"
36-
(range specifications) up front which we "smash" together to populate the flat vector.
35+
This source file implements a generalization of above definition. See computeInstSmashup. We must know all the
36+
"subspaces" (range specifications) up front which we "smash" together to populate the flat vector.
3737

3838
> data Smashing i =
3939
> Smashing {
@@ -96,10 +96,10 @@ You see there is some overlap between Zone 1 and Zone 2.
9696
> let
9797
> enumAssocs :: [(Int, (i, i))]
9898
> enumAssocs =
99-
> profess
100-
> (0 <= mag && mag <= 32_768 && all (uncurry validRange) (zip dims rngs))
101-
> (unwords [fName, "range violation", tag, show mag, show dims, show spaces])
102-
> (map (, (spaceId, 1)) is)
99+
> profess
100+
> (0 <= mag && mag <= 32_768 && all (uncurry validRange) (zip dims rngs))
101+
> (unwords [fName, "range violation", tag, show mag, show dims, show spaces])
102+
> (map (, (spaceId, 1)) is)
103103
> where
104104
> fName = "enumAssocs"
105105
>
@@ -150,10 +150,13 @@ as a zipper to carry out the you-know-what (smashing, stupid!)
150150
> validCoords :: i . (Integral i, Ix i, VU.Unbox i) [i] Smashing i Bool
151151
> validCoords coords Smashing{ .. }
152152
> = and $ zipWith inZRange coords smashDims
153-
>
154-
> getLeafCells :: i . (Integral i, Show i, VU.Unbox i) [i] Smashing i VU.Vector (i, i)
155-
> getLeafCells coords Smashing{ .. }
153+
154+
Navigation ============================================================================================================
155+
156+
> getLeafCells :: i . (Integral i, Ix i, Show i, VU.Unbox i) [i] Smashing i VU.Vector (i, i)
157+
> getLeafCells coords smashup@Smashing{ .. }
156158
> | traceNot trace_GLC False = undefined
159+
> | not (validCoords coords smashup) = error $ unwords [fName, "invalid coords"]
157160
> | otherwise = VU.slice cellix leafDim smashVec
158161
> where
159162
> fName = "getLeafCells"

0 commit comments

Comments
 (0)