mirror of
https://gitlab.dit.htwk-leipzig.de/computermusik-ws23/data-composition.git
synced 2025-07-04 03:01:49 +02:00
Something audible! (in "lists.tidal")
This commit is contained in:
1
BootTidal.hs
Symbolic link
1
BootTidal.hs
Symbolic link
@ -0,0 +1 @@
|
||||
scratchpads/BootTidal.hs
|
@ -1,5 +1,6 @@
|
||||
:set -XOverloadedStrings
|
||||
:set prompt ""
|
||||
:cd /home/phillip/Projekte/HTWK/Computermusik/data-composition/scratchpads
|
||||
|
||||
import Sound.Tidal.Context
|
||||
|
||||
@ -7,9 +8,7 @@ import System.IO (hSetEncoding, stdout, utf8)
|
||||
hSetEncoding stdout utf8
|
||||
|
||||
-- Load Data
|
||||
:l TemperatureData
|
||||
-- :l HumidityData
|
||||
-- :l BatteryData
|
||||
:l TemperatureData HumidityData BatteryData
|
||||
|
||||
tidal <- startTidal (superdirtTarget {oLatency = 0.05, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cVerbose = True, cFrameTimespan = 1/20})
|
||||
|
||||
|
@ -1,5 +1,16 @@
|
||||
import Text.Read
|
||||
import Data.Maybe
|
||||
import TemperatureData
|
||||
import HumidityData
|
||||
import BatteryData
|
||||
|
||||
|
||||
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
|
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
ghci -ghci-script "$(ghc -e 'import Paths_tidal' -e 'getDataDir>>=putStr')/BootTidal.hs"
|
||||
ghci -ghci-script ../scratchpads/BootTidal.hs
|
||||
|
||||
|
Reference in New Issue
Block a user