Plot / PlotBasic

Basic . Blep

Right-click to copy examples to your workspace


// minimal signal plot example, no audio thread required
let plotId = 0;  // choose a plot surface
let chanId = 0;  // choose a channel on that surface
let data = [];
data.length = 512;
for(let i=0; i<data.length; i++)
{
    data[i] = Math.sin(3*i/511*Math.PI*2); 
}
PlotSignal(plotId, chanId, data, "3 cycles of sine");

plotId = 1;
data.length = 1024;
chanId = 0;
for(let i=0;i<data.length;i++)
{
    data[i] = .4*Math.sin(3.1*i/1023*Math.PI*2);
}
PlotSignal(plotId, chanId, data,  "3.1 cycles of sine");

Produces this:

home .. topics .. interface .. reference .. examples .. tipjar