Bill Schottstaedt | 10 May 17:35 2015
Picon

Snd 15.6

Snd 15.6:

add int-vector? int-vector make-int-vector

changed s7_copy arg interpretation (it's now a normal s7_function).

checked: gtk 3.16.1|2 3.17.1, FC 22 (gcc 5), Ruby 2.2, sbcl 1.2.11

Thanks!: Tito Latini (found and fixed many bugs), 
         Donny Ward (MS Visual Studio 2013)
James Hearon | 29 Apr 19:55 2015
Picon

Scheme, outa and reverb

Scheme, Outa, and reverb

To: cmdist-Q5CBQdYaXkCc7tA/mXsYdg@public.gmane.orgd.EDU
Hi,
I might have figured out a way to add the reverberator using outa and *reverb* in the definstrument, and calling it using a scheme process.  It may not be the best way but it seems to work...which is setting the *clm-reverb* global.  (Now I need to figure out how to unset it.)  TX.  Jim

(if (not (provided? 'jcrev.scm))
      (load "jcrev.scm"))

 (set! *clm-reverb* jc-reverb)

(definstrument (myexamp start-time duration frequency amplitude sampling-rate
      (reverb-amount 0.01))
  (let* ((beg (floor (* start-time sampling-rate)))
     (end (+ beg (floor (* duration sampling-rate))))
     (sine-wave (make-oscil :frequency frequency)))
     (do ((i beg (+ i 1)))
         ((= i end)) 
(outa i (* (* (* amplitude (oscil sine-wave))) reverb-amount)  *reverb*)
(outb i (* (* (* amplitude (oscil sine-wave))) reverb-amount)  *reverb*)   )))

(with-sound (:output "test.wav" :srate 48000 :channels 2
                     :data-format mus-lshort
                     :header-type  mus-riff
                     :reverb jc-reverb)
(myexamp 0 1 440.0 0.5 48000 :reverb-amount 0.15))

;---------------------------------
;using a process
(define (call_myexamp n r d flb fub amp sr)
(process 
  for freq = (between flb fub)
  repeat n do
 (send "myexamp" (elapsed) d freq amp sr  :reverb-amount 0.15)
 (wait r) ))
 
(sprout(call_myexamp 40 .15 .10 500 2000 0.5 48000) "mytest.wav")
_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
James Hearon | 29 Apr 01:53 2015
Picon

Scheme, Outa, and reverb

Hi,
I'm getting myself confused about the following info below from the manual about outa and *reverb*.  If I'm understanding correctly then, *reverb* is not a reverberator and you still have to supply one, such as jc-rev, which I think I did below using with-sound.

But I'm stuck trying to figure out how to use a reverberator with a scheme process instead of with-sound.  I know I can include the the reverb-amount etc. on the "send" line in the process, but I can't seem to figure out how to to include the jc-reverberator with the process or define.

Do I include the reverberator in the definstrument perhaps for calling it with a process?  I know using reverb from a scheme process is much easier if I use locsig instead of outa, but I was hoping I might understand if will work or not.

Thank You,
Jim
------
*reverb*
The reverb instrument has to send to the *reverb* output stream an
appropriately scaled version of its main output, something like:
 
(outa i (* sample reverb-amount) *reverb*)
 
What clm does is, after with-sound processes the whole "note list" that 
is its body, it runs the reverb instrument that you supply over the 
reverb soundfile that it generated as part of running the body and then 
merges the output of that instrument run into the main soundfile generated.
--------
(if (not (provided? 'jcrev.scm))
      (load "jcrev.scm"))

(definstrument (myexamp start-time duration frequency amplitude sampling-rate
      (reverb-amount 0.01))
  (let* ((beg (floor (* start-time sampling-rate)))
     (end (+ beg (floor (* duration sampling-rate))))
     (sine-wave (make-oscil :frequency frequency)))
     (do ((i beg (+ i 1)))
         ((= i end)) 
(outa i (* (* (* amplitude (oscil sine-wave))) reverb-amount)  *reverb*)
(outb i (* (* (* amplitude (oscil sine-wave))) reverb-amount)  *reverb*)   )))

(with-sound (:output "test.wav" :srate 48000 :channels 2
                     :data-format mus-lshort
                     :header-type  mus-riff
                     :reverb jc-reverb)
(myexamp 0 1 440.0 0.5 48000 :reverb-amount 0.15))

;---------------------------------
;using a process
(define (call_myexamp n r d flb fub amp sr)
(process 
  for freq = (between flb fub)
  repeat n do
 (send "myexamp" (elapsed) d freq amp sr )
 (wait r) ))
 
(sprout(call_myexamp 40 .15 .10 500 2000 0.5 48000) "mytest.wav")

_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
Bill Schottstaedt | 3 Apr 23:09 2015
Picon

Snd 15.5

Snd 15.5:

repl.scm to replace use of readline in various cases.  The main one is
  Snd without a GUI.  In this case, you need to tell Snd where to find
  repl.scm.  In my ~/.snd_s7 file, I have:

  (set! *load-path* (cons "/home/bil/cl" *load-path*))

  I think you can build this into Snd by using the SCRIPTS_DIR flag
  in the makefile.

checked: sbcl 1.2.9|10, gtk 3.15.10|11|12, 3.16.0

Thanks!: Mike Scholz, Tito Latini
Tito Latini | 3 Apr 14:27 2015
Picon

Snd: no tracking-cursor if one sound is stopped

I have another patch to fix a graphic problem when two or more sounds
are playing and with-tracking-cursor is not #f (or we start to play
the sounds with [Ctrl][Play]).

Example:

- (set! *with-tracking-cursor* #t)

- open and play two sounds

- stop one sound

  (the cursor of the other sound is motionless)
diff -ur snd-15~/snd-dac.c snd-15/snd-dac.c
--- snd-15~/snd-dac.c	2015-04-03 13:56:30.423019828 +0200
+++ snd-15/snd-dac.c	2015-04-03 13:56:40.722890341 +0200
 <at>  <at>  -611,6 +611,16  <at>  <at> 
 }

 
+static bool something_is_playing(void)
+{
+  int i;
+  if (play_list)
+    for (i = 0; i < dac_max_sounds; i++)
+      if (play_list[i]) return(true);
+  return(false);
+}
+
+
 static void reflect_play_stop(snd_info *sp) 
 {
 #if (!USE_NO_GUI)
 <at>  <at>  -620,7 +630,8  <at>  <at> 
 #if (!USE_NO_GUI)
   view_files_unplay();
 #endif
-  ss->tracking = false;
+  if (!(something_is_playing()))
+    ss->tracking = false;
 }

 
 <at>  <at>  -902,16 +913,6  <at>  <at> 
 }

 
-static bool something_is_playing(void)
-{
-  int i;
-  if (play_list)
-    for (i = 0; i < dac_max_sounds; i++)
-      if (play_list[i]) return(true);
-  return(false);
-}
-
-
 /* -------------------------------- play (add to play-list) -------------------------------- */

 static int find_slot_to_play(void)
_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
Tito Latini | 3 Apr 00:13 2015
Picon

Snd: save-mix segfault

Hi, if a mix doesn't exist, Snd crashes after save-mix.

Example I

(define mix7 (integer->mix 7))
=> #<mix 7>

(mix? mix7)
=> #f

(save-mix mix7 "bye.snd")
-- segfault

Example II

- open-sound
- add a mix
- (define mix0 (caaar (mixes)))
- save-sound
- (save-mix mix0 "crash.snd")

The null pointer (returned by md_from_id) is in save_mix (snd-mix.c:3681),
called only by copy_mix and g_save_mix. copy_mix is safe because

  md = md_from_id(id);
  if (!md) return(-1);

save_mix returns a io_error_t and there is not a value suitable
for a mix, so the attached patch fixes the bug in g_save_mix.
diff -ur snd-15~/snd-mix.c snd-15/snd-mix.c
--- snd-15~/snd-mix.c	2015-04-02 23:49:25.463887691 +0200
+++ snd-15/snd-mix.c	2015-04-02 23:49:37.209740026 +0200
 <at>  <at>  -3788,12 +3788,15  <at>  <at> 
 static Xen g_save_mix(Xen m, Xen file)
 {
   #define H_save_mix "(" S_save_mix " mix filename) saves mix's samples in the file 'filename'"
-
+  int id;
   Xen_check_type(xen_is_mix(m), m, 1, S_save_mix, "a mix");
-  Xen_check_type(Xen_is_string(file), file, 2, S_save_mix, "a filename");
-
-  save_mix(Xen_mix_to_C_int(m), Xen_string_to_C_string(file), MUS_NEXT, MUS_OUT_SAMPLE_TYPE);
-  return(m);
+  id = Xen_mix_to_C_int(m);
+  if (mix_is_active(id)) {
+    Xen_check_type(Xen_is_string(file), file, 2, S_save_mix, "a filename");
+    save_mix(id, Xen_string_to_C_string(file), MUS_NEXT, MUS_OUT_SAMPLE_TYPE);
+    return(m);
+  }
+  return(snd_no_such_mix_error(S_save_mix, m));
 }

 
_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
Orm Finnendahl | 1 Apr 17:43 2015

[Snd] playback from marks

Hi,

 I just compiled latest snd-15 with motif and that seems to resolve
the issue. Sorry for the noise...

--
Orm

_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
Orm Finnendahl | 1 Apr 15:34 2015

[Snd] playback from marks

Hi,

 I'm having the following problem trying to play a sound with mouse
interaction starting at a mark:

Hovering over the red triangle of the mark, the mouse cursor changes
into a right arrow. Clicking once locates the playback cursor to the
beginning of the sound (sample 0). Clicking a second time makes
the playpack cursor jump to the mark and start playback.

As the sound is rather long it's impossible to work like that if I
need to zoom in to a position where the beginning of the sound is not
visible.

Am I doing something wrong or is there a workaround?

The only customization from the standard I did is

(set! (with-tracking-cursor) #t)

I'm using snd 13.8

Any help appreciated!

--
Orm
Tito Latini | 27 Mar 19:38 2015
Picon

Snd: region's peak_envs not updated after editing

Hello, you can see this bug with the follow steps:

  - make a region, no too short otherwise `peak_env_usable' returns
    "false" and the waveform is correct

  - edit the created region

  - from Regions view, move the slider to right. During the sliding,
    when `peak_env_usable' returns "true" in snd-chn.c:1797, it starts
    to display the old waveform.

The attached patch is a possible solution.
diff -ur snd-15~/snd-region.c snd-15/snd-region.c
--- snd-15~/snd-region.c	2015-03-27 19:33:23.042250004 +0100
+++ snd-15/snd-region.c	2015-03-27 19:33:29.200172589 +0100
 <at>  <at>  -1246,9 +1246,13  <at>  <at> 

   for (i = 0; i < sp->nchans; i++)
     {
+      chan_info *cp;
       mus_float_t val;
       val = channel_maxamp(sp->chans[i], AT_CURRENT_EDIT_POSITION);
       if (val > r->maxamp) r->maxamp = val;
+
+      if ((cp = sp->chans[i]))
+        r->peak_envs[i] = copy_peak_env_info(cp->edits[0]->peak_env, false);
     }

   /* make new region temp file */
_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
Bill Schottstaedt | 24 Mar 16:44 2015
Picon

ccrma history

Andrew J Nelson's book about ccrma is available now:
"The Sound of Innovation: Stanford and the Computer
Music Revolution", about $30 at Amazon.  I certainly
enjoyed reading it, but I'm biased.  It's hard to believe
it was 46 years ago that I wandered into the Bay Area.
James Hearon | 22 Mar 20:32 2015
Picon

gtk mapped without transient parent

Hi,
On f21 I'm getting an error thru the Grace editor.    Wondering if anyone else has this problem and might know the problem?  I did grep a bit and GTK part seems throughout Sndlib in CM, but I can't be sure that's the issue.

Save File:
GtkDialog mapped without a transient parent...File not saved.

On f21 I have a gtk2 and dev files, and a gtk3 with dev files.  I tried rebuilding Grace, but the problem persists.

Regards,
Jim
_______________________________________________
Cmdist mailing list
Cmdist@...
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist

Gmane