scd/snd_lines.scd

master
Nova deViator 2015-09-09 16:41:44 +02:00
parent 75d1d3f952
commit 4a2538c647
1 changed files with 23 additions and 23 deletions

View File

@ -10,9 +10,9 @@
********************************************************** */
(
// function procLines: process lines and store/return List
postln("~~~ function ~procLinesFunc ...");
~procLinesFunc = { // process lines, return na array
arg location = PathName(thisProcess.nowExecutingPath).pathOnly +/+ "../dev/silicon_lines.txt";
var siLines = FileReader.read(path: location, skipBlanks:true, skipEmptyLines:true);
@ -36,6 +36,7 @@
siLinesData = List.newClear(0);
processItem = { |item, i, reverse=false, layer=0, tscale=1, toffset=0|
if((item[1].asInt > threshold) && (item[0].asInt < 6741) && (item[0].asInt > 3950), {
@ -116,6 +117,7 @@
};
// process lines, store to a List
postln("~~~ process lines, store to a list: ~siLinesData, sort ...");
~siLinesData = ~procLinesFunc.value;
// sort 2D
@ -125,31 +127,24 @@
// FUNCTION: display linesData list in a view/window
postln("~~~ function ~viewLinesFunc ...");
~viewLinesFunc = {
arg siLinesData = ~siLinesData; // all we need is a List of data
var intensity, minutes, seconds, freq1, freq2, midi1, midi2, red, green, blue;
var layer, alpha;
// some drawing variables
var intensity, layer, alpha, peny, penx, color, time, swin;
var threshold = 0;
var linewidth = 3;
var spectrumheight = 750;
var colorpenlen = 40;
var alphamin = 10;
var peny, penx;
var color;
var time, time_end = 60*37+5;
var time_end = 60*37+5;
// View/Window starts here
var w = Window("TempSpectre", Rect(600, 5, width:560, height:spectrumheight));
postln(~siLinesData);
swin = Window("TempSpectre", Rect(600, 5, width:560, height:spectrumheight));
w.view.background_(Color.black);
w.drawFunc = {
swin.view.background_(Color.black);
swin.drawFunc = {
Pen.smoothing_(false);
Pen.translate(0,0);
@ -182,16 +177,16 @@
}); // end of siLinesData.do
}; // end of drawFunc{}
w.refresh;
w.front;
swin.refresh;
swin.front;
}; // end of viewLines function
)
/*
( // DEBUG/test:
// display table of all data to post window
~siLinesData.do({ |item, i|
@ -206,7 +201,7 @@
post("\n");
});
)
*/
@ -214,7 +209,7 @@
// or ideally expanded to an animated timeline
// and included in main window...:
// show a window/view with lines - score
~viewLinesFunc.value;
// ~viewLinesFunc.value;
@ -261,12 +256,17 @@ SynthDef(\siliconSynth, { |freq = 440, amp = 0.2, attack = 1, release = 1|
postln("~~~ loading mainTimeline routine");
post(" ");
~mainTimeline = Routine({
var delta, playhead, frequency, amp, step=0,
nextdelta, nextplayhead, nextfrequency, nextamp,
frequency_alt, nextfrequency_alt;
frequency_alt, nextfrequency_alt, siLines;
siLines = ~siLinesData;
postln(siLines);
postln("debug");
while {