Something audible! (in "lists.tidal")

This commit is contained in:
2024-02-05 03:22:06 +01:00
parent ac2cc81ce1
commit 6acdc72db1
4 changed files with 16 additions and 5 deletions

1
BootTidal.hs Symbolic link
View File

@ -0,0 +1 @@
scratchpads/BootTidal.hs

View File

@ -1,5 +1,6 @@
:set -XOverloadedStrings :set -XOverloadedStrings
:set prompt "" :set prompt ""
:cd /home/phillip/Projekte/HTWK/Computermusik/data-composition/scratchpads
import Sound.Tidal.Context import Sound.Tidal.Context
@ -7,9 +8,7 @@ import System.IO (hSetEncoding, stdout, utf8)
hSetEncoding stdout utf8 hSetEncoding stdout utf8
-- Load Data -- Load Data
:l TemperatureData :l TemperatureData HumidityData BatteryData
-- :l HumidityData
-- :l BatteryData
tidal <- startTidal (superdirtTarget {oLatency = 0.05, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20}) tidal <- startTidal (superdirtTarget {oLatency = 0.05, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20})

View File

@ -1,5 +1,16 @@
import Text.Read
import Data.Maybe
import TemperatureData
import HumidityData
import BatteryData
d1 $ s "bd" d1 $ s "bd"
-- Yes, i know this is not optimal...
getFloat x = maybe 0.0 id (readMaybe x :: Maybe Float)
map snd $ take 10 $ temperaturedata -- Do something audible with the temperature data for the first time ever
d1 $ fast 10 $ n (fromList (map (\x -> fromInteger (round ((getFloat x)*10))) (map (\x -> snd x) (take 100 temperaturedata)))) # s "jvbass" # room 0.5 # delay 0.7
d2 $ fast 10 $ n (fromList (map (\x -> fromInteger (round ((getFloat x)*5))) (map (\x -> snd x) (take 100 humiditydata)))) # s "arpy" # room 0.5 # delay 0.7

View File

@ -1,3 +1,3 @@
#!/bin/sh #!/bin/sh
ghci -ghci-script "$(ghc -e 'import Paths_tidal' -e 'getDataDir>>=putStr')/BootTidal.hs" ghci -ghci-script ../scratchpads/BootTidal.hs