Willkommen auf dem Dart-Forum der Nachteulen 1 Dart Forum - mHrgQvQZwm fKCqzpRJg (Gast)
| | HHIS I soulhd have thought of that! | | | | UIqRrdTGqRYOLxffY (Gast)
| | Now you can start to get into physics-based sound ssihteyns. A simple place to start is the Karplus-Strong algorithm which can be very compactly encoded into Haskell. Here's a simple program that can be used like yours.{-# LANGUAGE NoMonomorphismRestriction #-}import qualified Data.ByteString.Lazy as BSimport System.RandomsamplingRate = 44100ks freq noise = s where s = take (samplingRate `div` freq) noise ++ loPass sloPass (x:y s) = 0.5*(x+y):loPass (y s) toByteString = BS.pack . map (fromIntegral . floor . (255 *))main = do g |
Antworten:
Themen gesamt: 2 Posts gesamt: 5 Benutzer gesamt: 1
|