hsc3-sf 0.14 → 0.15
raw patch · 4 files changed
+22/−8 lines, 4 filesdep ~hoscPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: hosc
API changes (from Hackage documentation)
Files
- README +1/−1
- Sound/File/Decode.hs +11/−1
- Sound/File/Encode.hs +5/−1
- hsc3-sf.cabal +5/−5
README view
@@ -12,7 +12,7 @@ [hsc3-sf]: http://rd.slavepianos.org/?t=hsc3-sf [hsf]: http://code.haskell.org/hsndfile -© [rohan drape][rd], 2006-2012, [gpl]+© [rohan drape][rd], 2006-2013, [gpl] [rd]: http://rd.slavepianos.org/ [gpl]: http://gnu.org/copyleft/
Sound/File/Decode.hs view
@@ -36,6 +36,12 @@ decodef32 :: (Real n,Floating n) => Int -> B.ByteString -> [[n]] decodef32 n = deinterleave n . map (realToFrac . decode_f32) . bSetsOf 4 +decodef64 :: (Real n,Floating n) => Int -> B.ByteString -> [[n]]+decodef64 n = deinterleave n . map (realToFrac . decode_f64) . bSetsOf 8++decodei32 :: Int -> B.ByteString -> [[Int]]+decodei32 n = deinterleave n . map decode_i32 . bSetsOf 4+ decodei16 :: Int -> B.ByteString -> [[Int]] decodei16 n = deinterleave n . map decode_i16 . bSetsOf 2 @@ -48,6 +54,9 @@ i16_f :: (Real n,Floating n) => [Int] -> [n] i16_f = map ((/ 32768.0) . fromIntegral) +i32_f :: (Real n,Floating n) => [Int] -> [n]+i32_f = map ((/ 2147483648.0) . fromIntegral)+ -- | Given an 'Encoding' and the number of channels, decode -- a 'B.ByteString' to set of 'deinterleave'd channels. decode :: (Real n,Floating n) => Encoding -> Int -> B.ByteString -> [[n]]@@ -55,5 +64,6 @@ case enc of Linear8 -> map i8_f (decodei8 nc b) Linear16 -> map i16_f (decodei16 nc b)+ Linear32 -> map i32_f (decodei32 nc b) Float -> decodef32 nc b- _ -> undefined+ Double -> decodef64 nc b
Sound/File/Encode.hs view
@@ -16,10 +16,14 @@ encodef32 :: (Real n,Floating n) => [[n]] -> B.ByteString encodef32 = B.concat . map (encode_f32 . realToFrac) . interleave +encodef64 :: (Real n,Floating n) => [[n]] -> B.ByteString+encodef64 = B.concat . map (encode_f64 . realToFrac) . interleave+ -- | Given 'Encoding' and a set of channels, 'interleave' and encode -- as 'B.ByteString'. encode :: (Real n,Floating n) => Encoding -> [[n]] -> B.ByteString encode enc d = case enc of Float -> encodef32 d- _ -> undefined+ Double -> encodef64 d+ _ -> error "hsc3-sf: encode"
hsc3-sf.cabal view
@@ -1,5 +1,5 @@ Name: hsc3-sf-Version: 0.14+Version: 0.15 Synopsis: Haskell SuperCollider SoundFile Description: Trivial @NeXT@ sound file input and output. The main module is "Sound.File.NeXT".@@ -8,12 +8,12 @@ <http://hackage.haskell.org/package/hsndfile>. License: GPL Category: Sound-Copyright: (c) Rohan Drape, 2006-2013+Copyright: (c) Rohan Drape, 2006-2014 Author: Rohan Drape Maintainer: rd@slavepianos.org Stability: Experimental-Homepage: http://rd.slavepianos.org/?t=hsc3-sf-Tested-With: GHC == 7.6.1+Homepage: http://rd.slavepianos.org/t/hsc3-sf+Tested-With: GHC == 7.8.2 Build-Type: Simple Cabal-Version: >= 1.8 @@ -24,7 +24,7 @@ Library Build-Depends: base == 4.*, bytestring,- hosc == 0.14.*+ hosc == 0.15.* GHC-Options: -Wall -fwarn-tabs Exposed-modules: Sound.File.NeXT Sound.File.Decode