Skip to content

Commit

Permalink
sonification: add 1 sec silence after loop
Browse files Browse the repository at this point in the history
  • Loading branch information
engek authored and alex-rind committed Sep 21, 2023
1 parent 222eb8a commit 89f83f6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
22 changes: 12 additions & 10 deletions examples/SoniScope-Graz.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -276,25 +276,27 @@
" # dlist = filtered.cnt.to_numpy()\n",
" if dlist.size > 0:\n",
" dlist = scn.midicps(scn.linlin(dlist, soni_dim_min, soni_dim_max, midi_min, midi_max))\n",
" #dlist = [dlist np.zeros(20)]\n",
" np.append(dlist , [0,0,0,0,0,0,0,0,0,0])\n",
"\n",
"\n",
" num_onsets = len(dlist) - 1 # -1 might be wrong, test by listening\n",
" scanduration = duration.value / 13\n",
" decay = 1\n",
" \n",
" # convert list to pattern\n",
" sc.lang.cmd(r\"\"\"\n",
" p = Pseq(^dlist, inf); //p = Pn(Pshuf(^dlist, 1), inf);\n",
" // old version with random sorting of auditory marks: \n",
" // p = Pn(Pshuf(^dlist, 1), inf);\n",
" \n",
" // new version with regular sorting of auditory marks:\n",
" p = Pseq(^dlist, inf); \n",
" \"\"\")\n",
"\n",
" # use the existing slidersand parameters of the interface nd synth\n",
" scanduration = duration.value / 10\n",
" decay = 2\n",
"\n",
" ## setting up the pbind (basically a pattern player - the pattern is set as \"p\" above)\n",
" sc.lang.cmd(r\"\"\"\n",
" k = Pbind(\n",
" \\instrument, \\Lens_Synth,\n",
" \\freq, p,\n",
" \\dur, Pseq([^scanduration], inf), // Pwhite(0.02, 0.1, inf), // alternatively use regular onsets: Pseq([^scanduration], inf)\n",
" // \\dur, Pseq([^scanduration], inf),\n",
" // \\dur, Pwhite(0.02, 0.1, inf),\n",
" \\dur, Pseq([Pn(^scanduration,^num_onsets),1],inf),\n",
" \\decayscale, ^decay,\n",
" ).play;\n",
" \"\"\")\n",
Expand Down
24 changes: 13 additions & 11 deletions examples/SoniScope.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -318,28 +318,30 @@
" # dlist = filtered.cnt.to_numpy()\n",
" if dlist.size > 0:\n",
" dlist = scn.midicps(scn.linlin(dlist, soni_dim_min, soni_dim_max, midi_min, midi_max))\n",
" #dlist = [dlist np.zeros(20)]\n",
" np.append(dlist , [0,0,0,0,0,0,0,0,0,0])\n",
"\n",
"\n",
" num_onsets = len(dlist) - 1 # -1 might be wrong, test by listening\n",
" scanduration = duration.value / 13\n",
" decay = 1\n",
" \n",
" # convert list to pattern\n",
" sc.lang.cmd(r\"\"\"\n",
" p = Pseq(^dlist, inf); //p = Pn(Pshuf(^dlist, 1), inf);\n",
" // old version with random sorting of auditory marks: \n",
" // p = Pn(Pshuf(^dlist, 1), inf);\n",
" \n",
" // new version with regular sorting of auditory marks:\n",
" p = Pseq(^dlist, inf); \n",
" \"\"\")\n",
"\n",
" # use the existing slidersand parameters of the interface nd synth\n",
" scanduration = duration.value / 10\n",
" decay = 2\n",
"\n",
" ## setting up the pbind (basically a pattern player - the pattern is set as \"p\" above)\n",
" sc.lang.cmd(r\"\"\"\n",
" k = Pbind(\n",
" \\instrument, \\Lens_Synth,\n",
" \\freq, p,\n",
" \\dur, Pseq([^scanduration], inf), // Pwhite(0.02, 0.1, inf), // alternatively use regular onsets: Pseq([^scanduration], inf)\n",
" // \\dur, Pseq([^scanduration], inf),\n",
" // \\dur, Pwhite(0.02, 0.1, inf),\n",
" \\dur, Pseq([Pn(^scanduration,^num_onsets),1],inf),\n",
" \\decayscale, ^decay,\n",
" ).play;\n",
" \"\"\")\n",
" \"\"\") \n",
" \n",
" elif loop == 0:\n",
" # the \"sonifyer\" will be applied to all the datapoints in the \"filtered\" dataframe.\n",
Expand Down

0 comments on commit 89f83f6

Please sign in to comment.