packages feed

dobutokO2 0.8.0.1 → 0.8.1.0

raw patch · 3 files changed

+13/−4 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -76,3 +76,7 @@ ## 0.8.0.1 -- 2020-03-12  * Eigth version revised A. Added the new functions to the exporting by the library.++## 0.8.1.0 -- 2020-03-12++* Eigth version revised B. Changed the sofisticated mechanism to provide real obertones in the 'oberSoXSynth2FDN' function.
DobutokO/Sound.hs view
@@ -68,7 +68,7 @@ import Numeric import Control.Exception (onException) import System.Environment (getArgs)-import Data.List (isPrefixOf,sort)+import Data.List (isPrefixOf,sort,sortBy) import Data.Maybe (isJust,isNothing,fromJust) import Data.Char (isDigit) import qualified Data.Vector as V@@ -309,14 +309,19 @@  -- | Similar to 'oberSoXSynth2DN' but instead of 'oberTones' function, it uses volatile function @f::Double -> V.Vector (Double, Double)@ with -- somewhat sofisticated mechanism to normalize the resulting 'V.Vector' elements @(Double, Double)@. The last one is experimental feature, so--- it is your responsibility to provide a function so that it does not lead to clipping.+-- it is your responsibility to provide a function so that it does not lead to clipping. In such a case, the result of application of the+-- 'convertToProperUkrainian' to the 'String' parameter must not be 'V.empty'. oberSoXSynth2FDN :: (Double -> V.Vector (Double, Double)) -> Double -> Double -> String -> IO () oberSoXSynth2FDN f x y zs  | V.null . convertToProperUkrainian $ zs = oberSoXSynth x  | otherwise = do     let note0 = closestNote x         note1 = dNote (V.unsafeIndex (intervalsFromString zs) 0) note0-        g     = V.map (\(noteX, amplX) -> (closestNote noteX, abs (amplX - (fromIntegral . truncate $ amplX)))) . f+        g0    = V.fromList . sortBy (\(x1,_) (x2,_) -> compare x1 x2) . V.toList . V.map (\(noteX, amplX) -> (closestNote noteX, abs (amplX - (fromIntegral .+           truncate $ amplX)))) . f+        g k   = if V.null (g0 k) then V.empty+                else V.takeWhile (\w -> compare (fst w) (V.unsafeIndex notes 107) /= GT && compare (snd w) 0.001 == GT) . V.imap (\i (noteY,z0) ->+                  (fromIntegral (i + 1) * (fst . V.unsafeIndex (g0 k) $ 0), z0)) . g0 $ k         v0    = g note0         v1    = if isNothing note1 then V.empty                 else g . fromJust $ note1
dobutokO2.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/  name:                dobutokO2-version:             0.8.0.1+version:             0.8.1.0 synopsis:            A program and a library to create experimental music from a mono audio and a Ukrainian text description:         It can also create a timbre for the notes homepage:            https://hackage.haskell.org/package/dobutokO2