Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
ejconlon committed Dec 18, 2024
1 parent 592cb96 commit 0a537c9
Show file tree
Hide file tree
Showing 15 changed files with 149 additions and 167 deletions.
10 changes: 5 additions & 5 deletions minipat-dirt/minipat-dirt.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.36.0.
-- This file has been generated from package.yaml by hpack version 0.37.0.
--
-- see: https://github.com/sol/hpack

Expand Down Expand Up @@ -66,13 +66,13 @@ library
async ==2.2.*
, base >=4.12 && <5
, containers ==0.6.*
, dahdit-midi >=0.5.5 && <0.6
, dahdit-network >=0.5.2 && <0.6
, dahdit-midi ==0.7.*
, dahdit-network ==0.7.*
, data-default ==0.7.*
, minipat ==0.1.*
, minipat-live ==0.1.*
, nanotime >=0.3.2 && <0.4
, network ==3.1.*
, network >=3.1 && <3.3
, stm ==2.5.*
, text ==2.0.*
, text >=2.0 && <2.2
default-language: GHC2021
8 changes: 4 additions & 4 deletions minipat-dirt/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ dependencies:
- base >= 4.12 && < 5
- async >= 2.2 && < 2.3
- containers >= 0.6 && < 0.7
- dahdit-midi >= 0.5.5 && < 0.6
- dahdit-network >= 0.5.2 && < 0.6
- dahdit-midi >= 0.7 && < 0.8
- dahdit-network >= 0.7 && < 0.8
- data-default >= 0.7 && < 0.8
- minipat >= 0.1 && < 0.2
- minipat-live >= 0.1 && < 0.2
- nanotime >= 0.3.2 && < 0.4
- network >= 3.1 && < 3.2
- text >= 2.0 && < 2.1
- network >= 3.1 && < 3.3
- text >= 2.0 && < 2.2
- stm >= 2.5 && < 2.6

library:
Expand Down
23 changes: 11 additions & 12 deletions minipat-live/minipat-live.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@ library
async ==2.2.*
, base >=4.12 && <5
, containers ==0.6.*
, dahdit-midi >=0.5.5 && <0.6
, dahdit-midi ==0.7.*
, data-default ==0.7.*
, exceptions ==0.10.*
, heaps ==0.4.*
, little-logger ==1.0.*
, looksee >=0.6.0 && <0.7
, little-logger ==3.0.*
, looksee ==0.8.*
, minipat ==0.1.*
, mtl ==2.3.*
, nanotime >=0.3.2 && <0.4
, prettyprinter ==1.7.*
, resourcet ==1.3.*
, stm ==2.5.*
, template-haskell ==2.20.*
, text ==2.0.*
, template-haskell >=2.20 && <2.22
, text >=2.0 && <2.2
default-language: GHC2021

test-suite minipat-live-test
Expand Down Expand Up @@ -138,21 +138,20 @@ test-suite minipat-live-test
async ==2.2.*
, base >=4.12 && <5
, containers ==0.6.*
, dahdit-midi >=0.5.5 && <0.6
, dahdit-midi ==0.7.*
, data-default ==0.7.*
, exceptions ==0.10.*
, heaps ==0.4.*
, little-logger ==1.0.*
, looksee >=0.6.0 && <0.7
, little-logger ==3.0.*
, looksee ==0.8.*
, minipat ==0.1.*
, minipat-live
, mtl ==2.3.*
, nanotime >=0.3.2 && <0.4
, prettyprinter ==1.7.*
, prop-unit >=1.0.1 && <1.1
, resourcet ==1.3.*
, stm ==2.5.*
, tasty ==1.4.*
, tasty-hunit ==0.10.*
, template-haskell ==2.20.*
, text ==2.0.*
, template-haskell >=2.20 && <2.22
, text >=2.0 && <2.2
default-language: GHC2021
13 changes: 6 additions & 7 deletions minipat-live/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ dependencies:
- base >= 4.12 && < 5
- async >= 2.2 && < 2.3
- containers >= 0.6 && < 0.7
- dahdit-midi >= 0.5.5 && < 0.6
- dahdit-midi >= 0.7 && < 0.8
- data-default >= 0.7 && < 0.8
- exceptions >= 0.10 && < 0.11
- heaps >= 0.4 && < 0.5
- little-logger >= 1.0 && < 1.1
- looksee >= 0.6.0 && < 0.7
- little-logger >= 3.0 && < 3.1
- looksee >= 0.8 && < 0.9
- minipat >= 0.1 && < 0.2
- mtl >= 2.3 && < 2.4
- nanotime >= 0.3.2 && < 0.4
- prettyprinter >= 1.7 && < 1.8
- resourcet >= 1.3 && < 1.4
- stm >= 2.5 && < 2.6
- template-haskell >= 2.20 && < 2.21
- text >= 2.0 && < 2.1
- template-haskell >= 2.20 && < 2.22
- text >= 2.0 && < 2.2

library:
source-dirs: src
Expand All @@ -45,5 +45,4 @@ tests:
- -with-rtsopts=-N
dependencies:
- minipat-live
- tasty >= 1.4 && < 1.5
- tasty-hunit >= 0.10 && < 0.11
- prop-unit >= 1.0.1 && < 1.1
14 changes: 7 additions & 7 deletions minipat-live/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module Main
)
where

import Control.Monad.IO.Class (liftIO)
import Dahdit.Midi.Osc (Datum (..))
import Data.Default (def)
import Data.Ratio ((%))
Expand All @@ -15,8 +16,7 @@ import Minipat.Live.Core (Env (..), mergeRecord, setOrbit)
import Minipat.Live.Extra (parseSound)
import Minipat.Time (arcStart, bpmToCps)
import Nanotime (PosixTime, addTime, timeDeltaFromFracSecs)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.HUnit (testCase, (@?=))
import PropUnit (TestTree, testGroup, testMain, testUnit, (===))

data R a = R !Integer !PosixTime !a
deriving stock (Eq, Ord, Show)
Expand All @@ -27,7 +27,7 @@ projectR (WithPlayMeta pm a) = R (pmOrbit pm) (arcStart (pmRealArc pm)) a
testRecordCase :: (Integer, Integer) -> TestTree
testRecordCase (tempo, gpc) =
let cps = bpmToCps 4 (fromInteger tempo)
in testCase (show tempo ++ " " ++ show gpc) $ do
in testUnit (show tempo ++ " " ++ show gpc) $ do
let env = def {envCps = cps, envGpc = gpc}
cycStart = 0
cycEnd = 2
Expand All @@ -43,11 +43,11 @@ testRecordCase (tempo, gpc) =
, R 1 (time (3 % 2)) (attrsSingleton "sound" (DatumString "sd"))
]
expectedEnd = addTime (time (fromInteger cycEnd)) (negate ahead)
(actualEvs, actualEnd) <- mergeRecord env cycStart cycEnd realStart $ \st ->
(actualEvs, actualEnd) <- liftIO $ mergeRecord env cycStart cycEnd realStart $ \st ->
setOrbit st 1 (parseSound "bd sd")
let actualEvs' = fmap projectR actualEvs
actualEvs' @?= expectedEvs
actualEnd @?= expectedEnd
actualEvs' === expectedEvs
actualEnd === expectedEnd

testRecord :: TestTree
testRecord =
Expand All @@ -61,7 +61,7 @@ testRecord =

main :: IO ()
main =
defaultMain $
testMain $ \_ ->
testGroup
"minipat-Live"
[ testRecord
Expand Down
23 changes: 11 additions & 12 deletions minipat-midi/minipat-midi.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ library
build-depends:
async ==2.2.*
, base >=4.12 && <5
, bytestring ==0.11.*
, bytestring >=0.11 && <0.13
, containers ==0.6.*
, dahdit >=0.5.1 && <0.6
, dahdit-midi >=0.5.5 && <0.6
, dahdit ==0.7.*
, dahdit-midi ==0.7.*
, data-default ==0.7.*
, exceptions >=0.10.7 && <0.11
, heaps ==0.4.*
, libremidi >=0.1.0 && <0.2.0
, libremidi ==0.4.*
, minipat ==0.1.*
, minipat-live ==0.1.*
, mtl >=2.3.1 && <2.4
, nanotime >=0.3.2 && <0.4
, prettyprinter >=1.7.1 && <1.8
, resourcet ==1.3.*
, stm ==2.5.*
, text ==2.0.*
, text >=2.0 && <2.2
, vector ==0.13.*
default-language: GHC2021

Expand Down Expand Up @@ -130,24 +130,23 @@ test-suite minipat-midi-test
build-depends:
async ==2.2.*
, base >=4.12 && <5
, bytestring ==0.11.*
, bytestring >=0.11 && <0.13
, containers ==0.6.*
, dahdit >=0.5.1 && <0.6
, dahdit-midi >=0.5.5 && <0.6
, dahdit ==0.7.*
, dahdit-midi ==0.7.*
, data-default ==0.7.*
, exceptions >=0.10.7 && <0.11
, heaps ==0.4.*
, libremidi >=0.1.0 && <0.2.0
, libremidi ==0.4.*
, minipat ==0.1.*
, minipat-live ==0.1.*
, minipat-midi
, mtl >=2.3.1 && <2.4
, nanotime >=0.3.2 && <0.4
, prettyprinter >=1.7.1 && <1.8
, prop-unit >=1.0.1 && <1.1
, resourcet ==1.3.*
, stm ==2.5.*
, tasty ==1.4.*
, tasty-hunit ==0.10.*
, text ==2.0.*
, text >=2.0 && <2.2
, vector ==0.13.*
default-language: GHC2021
13 changes: 6 additions & 7 deletions minipat-midi/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ defaults:
dependencies:
- base >= 4.12 && < 5
- async >= 2.2 && < 2.3
- bytestring >= 0.11 && < 0.12
- bytestring >= 0.11 && < 0.13
- containers >= 0.6 && < 0.7
- dahdit >= 0.5.1 && < 0.6
- dahdit-midi >= 0.5.5 && < 0.6
- dahdit >= 0.7 && < 0.8
- dahdit-midi >= 0.7 && < 0.8
- data-default >= 0.7 && < 0.8
- heaps >= 0.4 && < 0.5
- minipat >= 0.1 && < 0.2
- minipat-live >= 0.1 && < 0.2
- nanotime >= 0.3.2 && < 0.4
- resourcet >= 1.3 && < 1.4
- stm >= 2.5 && < 2.6
- text >= 2.0 && < 2.1
- text >= 2.0 && < 2.2
- vector >= 0.13 && < 0.14
- libremidi >= 0.1.0 && < 0.2.0
- libremidi >= 0.4 && < 0.5
- mtl >= 2.3.1 && < 2.4
- exceptions >= 0.10.7 && < 0.11
- prettyprinter >= 1.7.1 && < 1.8
Expand All @@ -47,5 +47,4 @@ tests:
- -with-rtsopts=-N
dependencies:
- minipat-midi
- tasty >= 1.4 && < 1.5
- tasty-hunit >= 0.10 && < 0.11
- prop-unit >= 1.0.1 && < 1.1
22 changes: 11 additions & 11 deletions minipat-midi/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Main
where

import Control.Exception (throwIO)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.ST (runST)
import Dahdit qualified as D
import Data.Bits (Bits (..))
Expand All @@ -15,8 +16,7 @@ import Data.ByteString.Internal qualified as BSI
import Data.ByteString.Short qualified as BSS
import Data.Char (digitToInt)
import Minipat.Midi.Mpk
import Test.Tasty (TestTree, defaultMain, testGroup)
import Test.Tasty.HUnit (testCase, (@?=))
import PropUnit (TestTree, testGroup, testMain, testUnit, (===))

-- TODO clean up the hex bytes stuff and put it in dahdit-test

Expand All @@ -40,25 +40,25 @@ readHexBytes = go mempty . BSS.unpack . BSS.filter (/= 0x20)
hexChar = fromIntegral . digitToInt . BSI.w2c

testMpkRequest :: TestTree
testMpkRequest = testCase "mpk manual" $ do
testMpkRequest = testUnit "mpk manual" $ do
let expected = "f0 47 7f 49 66 00 01 01 f7"
actual = showHexBytes (runST (D.encode (requestProgConfig (ProgBank 0))))
actual @?= expected
actual === expected

testMpkSend :: TestTree
testMpkSend = testCase "mpk send" $ do
D.staticByteSize @ProgConfig undefined @?= 245
testMpkSend = testUnit "mpk send" $ do
D.staticByteSize @ProgConfig undefined === 245
let expectedStr =
"f0 47 7f 49 64 01 76 01 50 47 4d 3a 4d 50 43 00 00 00 00 00 00 00 00 00 09 01 00 04 00 00 04 00 00 00 03 00 78 00 00 00 00 02 01 01 24 00 10 25 01 11 26 02 12 27 03 13 28 04 14 29 05 15 2a 06 16 2b 07 17 2c 08 18 2d 09 19 2e 0a 1a 2f 0b 1b 30 0c 1c 31 0d 1d 32 0e 1e 33 0f 1f 00 46 00 7f 51 4c 49 4e 4b 35 00 00 00 00 00 00 00 00 00 00 00 47 00 7f 51 4c 49 4e 4b 36 00 00 00 00 00 00 00 00 00 00 00 48 00 7f 51 4c 49 4e 4b 37 00 00 00 00 00 00 00 00 00 00 00 49 00 7f 51 4c 49 4e 4b 38 00 00 00 00 00 00 00 00 00 00 00 4a 00 7f 51 4c 49 4e 4b 31 00 00 00 00 00 00 00 00 00 00 00 4b 00 7f 51 4c 49 4e 4b 32 00 00 00 00 00 00 00 00 00 00 00 4c 00 7f 51 4c 49 4e 4b 33 00 00 00 00 00 00 00 00 00 00 00 4d 00 7f 51 4c 49 4e 4b 34 00 00 00 00 00 00 00 00 00 00 0c f7"
expectedBs = readHexBytes expectedStr
showHexBytes expectedBs @?= expectedStr
showHexBytes expectedBs === expectedStr
let payloadBs = BSS.take 245 (BSS.drop 8 expectedBs)
result = runST (D.decode @ProgConfig payloadBs)
cfg <- either throwIO pure (fst result)
cfg <- liftIO (either throwIO pure (fst result))
let encodedBs = runST (D.encode cfg)
encodedBs @?= payloadBs
encodedBs === payloadBs
let finalStr = showHexBytes (runST (D.encode (sendProgConfig (ProgBank 0) cfg)))
finalStr @?= expectedStr
finalStr === expectedStr

testMpk :: TestTree
testMpk =
Expand All @@ -70,7 +70,7 @@ testMpk =

main :: IO ()
main =
defaultMain $
testMain $ \_ ->
testGroup
"minipat-midi"
[ testMpk
Expand Down
10 changes: 5 additions & 5 deletions minipat-rns/minipat-rns.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ library
build-depends:
async ==2.2.*
, base >=4.12 && <5
, bytestring ==0.11.*
, bytestring >=0.11 && <0.13
, containers ==0.6.*
, dahdit >=0.5.1 && <0.6
, dahdit-midi >=0.5.5 && <0.6
, dahdit ==0.7.*
, dahdit-midi ==0.7.*
, data-default ==0.7.*
, exceptions >=0.10.7 && <0.11
, heaps ==0.4.*
, libremidi >=0.1.0 && <0.2.0
, libremidi ==0.4.*
, minipat ==0.1.*
, minipat-live ==0.1.*
, mtl >=2.3.1 && <2.4
, nanotime >=0.3.2 && <0.4
, prettyprinter >=1.7.1 && <1.8
, resourcet ==1.3.*
, stm ==2.5.*
, text ==2.0.*
, text >=2.0 && <2.2
, vector ==0.13.*
default-language: GHC2021
10 changes: 5 additions & 5 deletions minipat-rns/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ defaults:
dependencies:
- base >= 4.12 && < 5
- async >= 2.2 && < 2.3
- bytestring >= 0.11 && < 0.12
- bytestring >= 0.11 && < 0.13
- containers >= 0.6 && < 0.7
- dahdit >= 0.5.1 && < 0.6
- dahdit-midi >= 0.5.5 && < 0.6
- dahdit >= 0.7 && < 0.8
- dahdit-midi >= 0.7 && < 0.8
- data-default >= 0.7 && < 0.8
- heaps >= 0.4 && < 0.5
- minipat >= 0.1 && < 0.2
- minipat-live >= 0.1 && < 0.2
- nanotime >= 0.3.2 && < 0.4
- resourcet >= 1.3 && < 1.4
- stm >= 2.5 && < 2.6
- text >= 2.0 && < 2.1
- text >= 2.0 && < 2.2
- vector >= 0.13 && < 0.14
- libremidi >= 0.1.0 && < 0.2.0
- libremidi >= 0.4 && < 0.5
- mtl >= 2.3.1 && < 2.4
- exceptions >= 0.10.7 && < 0.11
- prettyprinter >= 1.7.1 && < 1.8
Expand Down
Loading

0 comments on commit 0a537c9

Please sign in to comment.