Coder Social home page Coder Social logo

tidalcycles / tidal-vis Goto Github PK

View Code? Open in Web Editor NEW
60.0 13.0 7.0 113 KB

Tidal is a domain specific language for live coding pattern. This package allows colour patterns to be rendered as PDF or SVG files.

Home Page: http://tidalcycles.org

License: GNU General Public License v3.0

Haskell 100.00%
tidalcycles visualisation live-coding music

tidal-vis's Introduction

tidal-vis

Tidal is a domain specific language for live coding pattern. This package allows several things:

  1. OSC messages sent to SC to be dynamicly rendered in realtime with at separate window. Demo of realtime visualisation.
  2. Colour patterns to be rendered as PDF or SVG files. See Examples.hs module for more help.
  3. Colour patterns to be rendered to be rendered dynamicly in separate window. See CycleAnimation.hs for more. Demo.

(1) Realtime animation during livecoding

  1. Add following lines to BootTidal.hs

     -- OSCTarget for pattern visualizing.
     patternTarget = OSCTarget { oName = "Pattern handler", oAddress = "127.0.0.1", oPort = 5050, oPath = "/trigger/something", oShape = Nothing, oLatency = 0.02, oPreamble = [], oTimestamp = BundleStamp }
    
     -- OSCTarget for play music via SuperCollider.
     musicTarget = superdirtTarget { oLatency = 0.1, oAddress = "127.0.0.1", oPort = 57120 }
    
     config = defaultConfig {cFrameTimespan = 1/20}
    
     -- Send pattern as osc both to SC and to tidal-vis
     tidal <- startMulti [musicTarget, patternTarget] config
    
     -- Send pattern as osc to SC only
     -- tidal <- startTidal musicTarget config
    
  2. Comment tidal <- startTidal... and uncomment tidal <- startMulti...

  3. Build tidal-vis and run

     cd /tidal-vis
     stack build
     stack exec tidal-vis
    
  4. Eval your tidal code.

  5. Profit.

(2) Render SVG or PDF

For exanple, when pattern is

density 16 $ every 2 rev $ every 3 (superimpose (iter 4)) $ rev "[black blue darkblue, grey lightblue]"

Output image is

0

(3) Animate one pattern

To animate pattern (not good performance):

cd ./tidal-vis/
stack repl ./src/CycleAnimation.hs
:set -XOverloadedStrings
ah <- run
swapMVar ah $ degradeBy 0.3 $ every 3 (fast 3) $  Params.s "[red, white, [purple orange green]]"

Look at CycleAnimation.hs for more information. Look at looping function to change animation form.

Tutorial

tidal-vis installation tutorial by Kindohm

Hackage

https://hackage.haskell.org/package/tidal-vis

Misc

For more information: tidalcycles

tidal-vis's People

Contributors

jarmitage avatar kindohm avatar rlafuente avatar willbasky avatar yaxu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tidal-vis's Issues

Error: cabal: Failed to build SDL-0.6.7.0

Hi there,

I'm a little new to haskell, so any pointers on how to debug this is much appreciated. Let me know if I can provide any additional info?

I'm running this on a Mac M1

(base) [tidal] cabal install tidal-vis
Resolving dependencies...
Build profile: -w ghc-9.2.8 -O1
In order, the following will be built (use -v for more details):
 - SDL-0.6.7.0 (lib:SDL) (requires build)
 - gloss-rendering-1.13.1.2 (lib) (requires build)
 - SDL-ttf-0.6.3.0 (lib:SDL-ttf) (requires build)
 - SDL-image-0.6.2.0 (lib:SDL-image) (requires build)
 - SDL-gfx-0.7.0.0 (lib:SDL-gfx) (requires build)
 - gloss-1.13.2.2 (lib) (requires build)
 - tidal-vis-1.0.14 (lib) (requires build)
 - tidal-vis-1.0.14 (exe:tidal-vis) (requires build)
Starting     gloss-rendering-1.13.1.2 (lib)
Starting     SDL-0.6.7.0 (all, legacy fallback)
Building     gloss-rendering-1.13.1.2 (lib)
Installing   gloss-rendering-1.13.1.2 (lib)
Completed    gloss-rendering-1.13.1.2 (lib)

Failed to build SDL-0.6.7.0. The failure occurred during the configure step.
Build log (
/Users/frederiquelemieux/.cabal/logs/ghc-9.2.8/SDL-0.6.7.0-d957863a.log ):
[1 of 1] Compiling Main             ( /var/folders/v7/4y8lr3w901b9p9n5gqp18lf40000gn/T/cabal-install.-70471/dist-newstyle/tmp/src-70471/SDL-0.6.7.0/dist/setup/setup.hs, /var/folders/v7/4y8lr3w901b9p9n5gqp18lf40000gn/T/cabal-install.-70471/dist-newstyle/tmp/src-70471/SDL-0.6.7.0/dist/setup/Main.o )
Linking /var/folders/v7/4y8lr3w901b9p9n5gqp18lf40000gn/T/cabal-install.-70471/dist-newstyle/tmp/src-70471/SDL-0.6.7.0/dist/setup/setup ...
Warning: SDL.cabal:32:30: version operators used. To use version operators the
package needs to specify at least 'cabal-version: >= 1.8'.
Warning: SDL.cabal:28:37: version operators used. To use version operators the
package needs to specify at least 'cabal-version: >= 1.8'.
Configuring SDL-0.6.7.0...
configure: WARNING: unrecognized options: --with-compiler
checking for sdl-config... no
checking for sdl11-config... no
configure: error: *** SDL not found! Get SDL from www.libsdl.org.
If you already installed it, check it's in the path. If problem remains,
please send a mail to the address that appears in ./configure --version
indicating your platform, the version of configure script and the problem.
Error: cabal: Failed to build SDL-0.6.7.0 (which is required by exe:tidal-vis
from tidal-vis-1.0.14). See the build log above for details.

Broken dependency - unagi-chan

The newish unagi-chan dependency is not compatible with the latest version of the primitive library (0.7 and up). Tidal will install the latest version via one of its dependencies, making tidal-vis unbuildable.

If you explicitly unregister that and install primitive-0.6.4 instead, then reinstall tidal, tidal-vis will install.

cabal install fails

I've tried with most recent git as well as uploaded versions.

My haskell is very rusty so I have no idea what those errors mean:

(standard)friedel@orion:~/git/tidal-vis> cabal install
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Resolving dependencies...
Starting     tidal-vis-1.0.15
Building     tidal-vis-1.0.15
Failed to install tidal-vis-1.0.15
Build log ( /home/friedel/.cabal/logs/ghc-8.6.5/tidal-vis-1.0.15-3nb0VS5neMsLc9YbaPVilJ.log ):
cabal: Entering directory '.'
Configuring tidal-vis-1.0.15...
Preprocessing library for tidal-vis-1.0.15..
Building library for tidal-vis-1.0.15..
[ 1 of 10] Compiling Common
src/Common.hs:51:7: error:
 The constructor Event should have 4 arguments, but has been given 3
 In the pattern: Event _ part' _
In an equation for fits’:
fits (Event _ part' _) events
= not $ any (\ Event {..} -> isJust $ subArc part' part) events
|
51 | fits (Event _ part' _) events = not $ any (\Event{..} -> isJust $ subArc part' part) events
|       ^^^^^^^^^^^^^^^

src/Common.hs:82:18: error:
 The constructor Event should have 4 arguments, but has been given 3
 In the pattern: Event _ (Arc start' stop') _
In the first argument of filter, namely
(\ (Event _ (Arc start' stop') _)
  -> start' < stop && stop' > start)
In the expression:
filter
(\ (Event _ (Arc start' stop') _)
 -> start' < stop && stop' > start)
|
82 |     -> filter (\(Event _ (Arc start' stop') _) -> start' < stop && stop' > start)
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Common.hs:91:14: error:
     The constructor Event should have 4 arguments, but has been given 3
     In the pattern: Event whole Arc {..} value
      In the pattern: ev@(Event whole Arc {..} value) : es
      In an equation for split’:
          split t (ev@(Event whole Arc {..} value) : es)
            | t > start && t < stop
            = Event whole (Arc start t) value
                : Event whole (Arc t stop) value : split t es
            | otherwise = ev : split t es
   |
91 | split t (ev@(Event whole Arc{..} value):es)
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^

src/Common.hs:98:9: error:
     The constructor Event should have 4 arguments, but has been given 3
     In the pattern: Event _ Arc {..} _
      In the pattern: Event _ Arc {..} _ : es
      In an equation for points’:
          points (Event _ Arc {..} _ : es) = start : stop : points es
   |
98 | points (Event _ Arc{..} _ : es) = start : stop : points es
   |         ^^^^^^^^^^^^^^^^^

src/Common.hs:104:42: error:
     Couldn't match expected type EventF a1 [b]
                  with actual type b0 -> EventF [b] b0
     In the expression:
        Event whole part $ map (\ Event {value} -> value) evs
      In an equation for merge’:
          merge evs@(Event {whole, part} : _)
            = Event whole part $ map (\ Event {value} -> value) evs
      In an equation for groupByTime’:
          groupByTime es
            = map merge $ groupBy ((==) `on` part) $ sortOn (stop . part) es
            where
                merge :: [EventF a b] -> EventF a [b]
                merge evs@(Event {whole, part} : _)
                  = Event whole part $ map (\ Event {value} -> value) evs
                merge _ = error "groupByTime"
     Relevant bindings include
        part :: a1 (bound at src/Common.hs:104:29)
        whole :: Maybe a1 (bound at src/Common.hs:104:22)
        evs :: [EventF a1 b] (bound at src/Common.hs:104:11)
        merge :: [EventF a1 b] -> EventF a1 [b]
          (bound at src/Common.hs:104:5)
    |
104 |     merge evs@(Event{whole, part} : _) = Event whole part $ map (\Event{value} -> value) evs
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Common.hs:104:48: error:
     Couldn't match expected type Context
                  with actual type Maybe a1
     In the first argument of Event, namely whole
      In the expression: Event whole part
      In the expression:
        Event whole part $ map (\ Event {value} -> value) evs
     Relevant bindings include
        part :: a1 (bound at src/Common.hs:104:29)
        whole :: Maybe a1 (bound at src/Common.hs:104:22)
        evs :: [EventF a1 b] (bound at src/Common.hs:104:11)
        merge :: [EventF a1 b] -> EventF a1 [b]
          (bound at src/Common.hs:104:5)
    |
104 |     merge evs@(Event{whole, part} : _) = Event whole part $ map (\Event{value} -> value) evs
    |                                                ^^^^^
cabal: Leaving directory '.'
cabal: Error: some packages failed to install:
tidal-vis-1.0.15-3nb0VS5neMsLc9YbaPVilJ failed during the building phase. The
exception was:
ExitFailure 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.