aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--thesoundofpeople.scd50
1 files changed, 50 insertions, 0 deletions
diff --git a/thesoundofpeople.scd b/thesoundofpeople.scd
new file mode 100644
index 0000000..f9fc5e1
--- /dev/null
+++ b/thesoundofpeople.scd
@@ -0,0 +1,50 @@
+// This file is here to show you how to start The Sound of People.
+// At some point in the future this file can - hopefully - just be run with sclang and The Sound Of People will be managable by GUI completely
+// Go to https://opensnp.org/genotypes and download the file you'd like to use. So far only the parsing of 23andme files has been implemented (sorry).
+// The instructions below show an example on how to use the file
+
+// Parse a file, write a new one to disk (after this you should recompile your class library/ restart sclang)
+(
+// parse a new file from opensnp.org
+~parser = SNPParser.new("/tmp/1.23andme.9");
+// get a SNPDict
+~dictionary = ~parser.readFile;
+// write the SNPDict to file
+~file = SNPFile("/tmp/1.tsop.snp");
+~file.writeFile(~dictionary);
+)
+
+// Starting the SuperCollider server and reading the file
+(
+s.waitForBoot({
+ // set the file to read from
+ ~file = SNPFile("/tmp/1.tsop.snp");
+ // read the file
+ ~dictionary = ~file.readFile;
+ // this is the number of positions you'll be able to play
+ ~dictionary.positions;
+ // shown meter and server window
+ s.meter;
+ s.makeWindow;
+ // create 8 channel audio setup with 2 hour playtime from the dictionary of SNP objects
+ ~audio = SNPAudio.new(~dictionary, 8, 2, true, []);
+ // show the GUI
+ ~audio.spawnView;
+});
+)
+
+// play from position 0 to the end
+~audio.playFromTo(0);
+
+// play from position 0 to position 200000
+~audio.playFromTo(0, 200000);
+
+// pause audio at current position (please wait at least 3 seconds for this to settle!)
+~audio.pausePlay;
+
+// resume audio from the current position (after pause)
+~audio.resumePlay;
+
+// show current time and position relative to their maximum values
+~audio.queryTimeAndPosition;//get current position and time
+