Commit 615a27dd by PLN (Algolia)

feat: DPV working!

parent 6f90f7d2
......@@ -2,13 +2,36 @@
:set prompt ""
import Sound.Tidal.Context
import System.IO (hSetEncoding, stdout, utf8)
hSetEncoding stdout utf8
-- total latency = oLatency + cFrameTimespan
tidal <- startTidal (superdirtTarget {oLatency = 0.2, oAddress = "127.0.0.1", oPort = 57120}) (defaultConfig {cFrameTimespan = 1/20})
-- DPV setup
:{
let targetdpv = Target {oName = "didacticpatternvisualizer",
oAddress = "127.0.0.1",
oPort = 1818,
oLatency = 0.2,
oWindow = Nothing,
oSchedule = Live,
oBusPort = Nothing,
oHandshake = False
}
formatsdpv = [OSC "/delivery" Named {requiredArgs = []} ]
:}
-- SuperDirt target
:{
let superdirtTarget' = superdirtTarget {oLatency = 0.1, oAddress = "127.0.0.1", oPort = 57120}
:}
:{
-- Set up targets for both SuperDirt and DPV
let oscmapdpv = [(targetdpv, formatsdpv),
(superdirtTarget', [superdirtShape])
]
:}
-- Initialize TidalCycles with both targets
tidal <- startStream defaultConfig {cFrameTimespan = 1/20} oscmapdpv
:{
let p = streamReplace tidal
......@@ -69,7 +92,18 @@ let setI = streamSetI tidal
:}
:{
let modIndex = pF "modIndex"
let -- DPV specific parameters
grid = pS "grid"
connectionN = pI "connectionN"
connectionMax = pI "connectionMax"
speedSequenser = pF "speedSequenser"
clear = pI "clear"
sizeMin = pF "sizeMin"
sizeMax = pF "sizeMax"
figure = pS "figure"
color = pS "color"
-- Other parameters
modIndex = pF "modIndex"
mix = pF "mix"
vibrato = pF "vibrato"
chorus = pF "chorus"
......
import oscP5.*;
import netP5.*;
OscP5 osc;
ArrayList<Sound> sounds = new ArrayList<Sound>();
ArrayList<Cycle> cycles = new ArrayList<Cycle>();
float alturaBar;
float offsetSubdivision = 40;
int connectionTotal = 4; // set total tracks (Number of Tidal connections to represent)
float movSequenser= 2; // set grid speed (higher speed makes time wider)
void setup() {
osc = new OscP5(this, 1818);
size(1280,360);
//fullScreen(P3D, 2);
alturaBar = height/connectionTotal;
noStroke();
fill(0);
textSize(18);
}
void draw() {
background(0);
fill(255);
rectMode(CORNER);
rect(0,0,width,height);
fill(228);
noStroke();
for(int y=0; y<(connectionTotal*0.5); y++ ) {
rect(0, y*alturaBar*2, width, alturaBar);
}
for(int i=0; i<sounds.size() ; i++) {
if ( sounds.get(i)!= null) { sounds.get(i).draw(); }
}
for(int i=0; i<cycles.size() ; i++) {
if ( cycles.get(i)!= null) { cycles.get(i).draw(); }
}
}
-- EX1 Initialize DPV with 2 connections at speed 4
do asap $ connectionMax 2 # speedSequenser 4
d5 $ grid "1 0!7" -- Set grid pattern
-- Play a pattern with visualization
d1 $ s "bd(3,8)" # connectionN 1
d2 $ s "hh(6,8)" # connectionN 2
-- EX2 Initialize DPV
do asap $ connectionMax 3 # speedSequenser 4
d5 $ grid "1 0!15"
-- Play a pattern with visualization
d1 $ s "bd(3,8)" # connectionN 1 # sizeMin 12 # sizeMax 60 # figure "rect" # color "0519f5"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment