[CM] ring-modulate

2024-06-04 Thread James Hearon
Hi,
I'm getting confused over ring-modulate ex. in manual vs. ring-modulate code in 
new-effects.scm.

Manual: ring-modulate in1 in2; returns (* in1 in2)

And new-effects.scm seems to show map-channel using frequency and radians:
(rm-effect rm-frequency #f)) ;(list 0 0 1 (hz->radians rm-radians))

I'm trying to use a reader and apply ring-modulate to the snd.

(with-sound (:play #t)
  (let ((reader (make-readin "mywave.wav")))
(do ((i 0 (+ i 1)))
((= i 602866))
(let* ((mysnd (readin reader)))
  (outa i (* 0.5 (ring-modulate xxx xxx)) ;not sure what it wants here?

But whatever I use as input to ring-modulate I'm not getting close to the 
new-effects.scm application of Ring modulation which uses frequency and radians.

Wondering where I'm getting confused.

Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] select color

2024-01-12 Thread James Hearon
Hi,
re: select-color

Geez.   Wayland was the problem.  That was bothering me for a couple weeks.  
Somehow the f39 login setting for Gnome became set to Wayland instead of Xorg.

At least now I have a better understanding of how colors work under motif in 
Snd.

Thank you,
Jim


From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Thursday, January 11, 2024 10:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 188, Issue 3

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. select color (James Hearon)
   2. Re: select color (b...@ccrma.stanford.edu)


--

Message: 1
Date: Thu, 11 Jan 2024 17:55:38 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] select color
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

 Hi,
I'm still trying to trouble shoot the buggered select color in Snd.  Not having 
much luck.
I reinstalled all dep libraries, went thru prefs, and snd prefs file, 
downloaded and reconfigured Snd several times.
I also installed another motif app, Grace (not R. Taube's Grace) and the motif 
colors seem fine on the system.
I have some qt5 and qt6 but there's not much, it seems, going on for qt in Snd 
except the webserver.  Cleaned and updated fedora.  I can't think of anything 
short of a complete clean install of fedora to try to solve it, but it just 
seems to affect only Snd, and only the selected color.  All the other Snd 
colors and prefs are working okay.

I'm wondering if there are other command line methods to get feedback on the 
selection color to see what might have gone wrong?  something like 
(select-data-color?) perhaps.

Thank you,
Jim

fedora 39
Snd version 24.1
s7: 10.8 (11-Jan-2024), Xen: 4.3
ALSA 1.2.10
Sndlib 24.8 (5-Oct-21)
CLM 6.19 (17-Nov-18)
Motif 2.3.4 X11R6
Xpm 3.4.11
Compiled Jan 10 2024 07:39:00
C: gcc 13.2
Linux 6.6.9-200.fc39.x86_64 x86_64
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20240111/a5e91031/attachment-0001.html>

--

Message: 2
Date: Thu, 11 Jan 2024 10:08:33 -0800
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] select color
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

I do not know what the problem is; that code has not
changed in many years.  Perhaps you're running Wayland
and it is mixing colors (via a sort of transparency
effect I guess, like happens on a Mac).



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 188, Issue 3
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] select color

2024-01-11 Thread James Hearon
 Hi,
I'm still trying to trouble shoot the buggered select color in Snd.  Not having 
much luck.
I reinstalled all dep libraries, went thru prefs, and snd prefs file, 
downloaded and reconfigured Snd several times.
I also installed another motif app, Grace (not R. Taube's Grace) and the motif 
colors seem fine on the system.
I have some qt5 and qt6 but there's not much, it seems, going on for qt in Snd 
except the webserver.  Cleaned and updated fedora.  I can't think of anything 
short of a complete clean install of fedora to try to solve it, but it just 
seems to affect only Snd, and only the selected color.  All the other Snd 
colors and prefs are working okay.

I'm wondering if there are other command line methods to get feedback on the 
selection color to see what might have gone wrong?  something like 
(select-data-color?) perhaps.

Thank you,
Jim

fedora 39
Snd version 24.1
s7: 10.8 (11-Jan-2024), Xen: 4.3
ALSA 1.2.10
Sndlib 24.8 (5-Oct-21)
CLM 6.19 (17-Nov-18)
Motif 2.3.4 X11R6
Xpm 3.4.11
Compiled Jan 10 2024 07:39:00
C: gcc 13.2
Linux 6.6.9-200.fc39.x86_64 x86_64
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] edit selection color

2023-12-29 Thread James Hearon
Hi,
This is a bit odd, but I'm posting in case someone might have a suggestion.
I'm on fc39, Snd 23.9, using motif, no gl.
I've recompiled Snd a few times recently trying to solve a wacked color problem 
with the edit selection color.  When I select an area to edit, the color is 
yellow with a red tinge looking something like overlay or spectrum instead of 
the default lightsteelblue1. I've defined using make-color and set 
selection-color to change the color from the listener a few times but the edit 
color just gets worse.  I tweaked colors in preferences, and checked nothing is 
odd in my ./snd prefs file.  In the preferences color panel other colors seem 
okay.  Seems to only affect the selection-color.

I upgraded my ram from 8gb to 16gb recently and I'm thinking maybe the wacked 
edit colors have something to do with rgb and ram?  I also changed the laptop's 
color profile a few times using Genome's Settings for Colors, but no joy there 
either.  Stranger still if i select and area for editing, leave it selected, 
and open any other menu (ex. reverbs), and close that menu, part of the reverbs 
menu is showing up faintly in the edit area of the waveform.  That's very odd 
but gets me thinking about screen refresh and memory issues.  Maybe the ram was 
bad, but strange it only seems to affect the edit area for color.

Thanks,
Jim




___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-sampler vs. open

2023-12-08 Thread James Hearon
Hi,
Yes.  Snd's make-square-wave works great.
I took another look at my code and figured out the problem was not reading from 
make-sampler, but my trying to get the maxval of the sampler's output to see 
what was going wrong.

I was using (set! maxval (float-vector-max (float-vector-abs! im))) and didn't 
realize float-vector-abs! was setting all the values to absolute value.  I 
thought it was just getting the abs value.  So for a square wave that's deadly.

My fault.
Thank you,
Jim


From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Thursday, December 7, 2023 10:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 187, Issue 1

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. make-sampler vs. open (James Hearon)


--

Message: 1
Date: Thu, 7 Dec 2023 18:12:56 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] make-sampler vs. open
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
I was trying to use make-sampler, but having a problem opening (read-sample) a 
non-bandlimited square wav effectively.  Snd's Open menu function works fine, 
but the make-sampler approach gives a max'd out flat line which seems like it 
might be an aliasing problem? I tried low-pass filtering with make-sample 
without much success.

Instead I was tweaking this code below from spectrum as an fft filter for file 
based bandlimiting.  Reason being most of what I was doing is outside the 
editor, or file-based manipulation before the sound gets opened in the editor.  
The result is better than before but I'm still not seeing anything resembling a 
square wav yet with make-sampler and read-sample.  I also tried some peak 
limiting on amplitudes, but still no joy.

I'm wondering what might be the difference with Snd's file Open and why it 
works so well vs. the lower level approach of make-sampler, and read-sample, or 
what might be a better way to approach those pesky non-bandlimited snds?

(let* ((len (mus-sound-framples "oboe.snd"))
   (fsize (expt 2 (ceiling (log len 2
   (rdata (make-float-vector fsize))
   (idata (make-float-vector fsize)))
  (file->array "oboe.snd" 0 0 len rdata)
  (mus-fft rdata idata fsize 1)
  (let ((fsize2 (/ fsize 2))
(cutoff (round (/ fsize 10
(do ((i cutoff (+ i 1))
 (j (- fsize 1) (- j 1)))
((= i fsize2))
  (set! (rdata i) 0.0)
  (set! (idata i) 0.0)
  (set! (rdata j) 0.0)
  (set! (idata j) 0.0)))
  (mus-fft rdata idata fsize -1)
  (array->file "test.snd"
   (float-vector-scale! rdata (/ 1.0 fsize))
   len
   (srate "oboe.snd")
   1)
  (let ((previous-case (find-sound "test.snd")))
(if (sound? previous-case)
(close-sound previous-case)))
  (open-sound "test.snd"))

Regards,
Jim
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20231207/c01c70b0/attachment-0001.html>

--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 187, Issue 1
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-sampler vs. open

2023-12-07 Thread James Hearon
Hi,
I was trying to use make-sampler, but having a problem opening (read-sample) a 
non-bandlimited square wav effectively.  Snd's Open menu function works fine, 
but the make-sampler approach gives a max'd out flat line which seems like it 
might be an aliasing problem? I tried low-pass filtering with make-sample 
without much success.

Instead I was tweaking this code below from spectrum as an fft filter for file 
based bandlimiting.  Reason being most of what I was doing is outside the 
editor, or file-based manipulation before the sound gets opened in the editor.  
The result is better than before but I'm still not seeing anything resembling a 
square wav yet with make-sampler and read-sample.  I also tried some peak 
limiting on amplitudes, but still no joy.

I'm wondering what might be the difference with Snd's file Open and why it 
works so well vs. the lower level approach of make-sampler, and read-sample, or 
what might be a better way to approach those pesky non-bandlimited snds?

(let* ((len (mus-sound-framples "oboe.snd"))
   (fsize (expt 2 (ceiling (log len 2
   (rdata (make-float-vector fsize))
   (idata (make-float-vector fsize)))
  (file->array "oboe.snd" 0 0 len rdata)
  (mus-fft rdata idata fsize 1)
  (let ((fsize2 (/ fsize 2))
(cutoff (round (/ fsize 10
(do ((i cutoff (+ i 1))
 (j (- fsize 1) (- j 1)))
((= i fsize2))
  (set! (rdata i) 0.0)
  (set! (idata i) 0.0)
  (set! (rdata j) 0.0)
  (set! (idata j) 0.0)))
  (mus-fft rdata idata fsize -1)
  (array->file "test.snd"
   (float-vector-scale! rdata (/ 1.0 fsize))
   len
   (srate "oboe.snd")
   1)
  (let ((previous-case (find-sound "test.snd")))
(if (sound? previous-case)
(close-sound previous-case)))
  (open-sound "test.snd"))

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] cons value for float vector

2023-09-08 Thread James Hearon
Hi,
Thank you for that info.  I didn't realize you can have multidimensional 
float-vectors, nor knew how to go about that.  This helps.
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Thursday, September 7, 2023 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 184, Issue 1

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. cons value for float vector (James Hearon)


--

Message: 1
Date: Thu, 7 Sep 2023 17:47:11 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] cons value for float vector
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"


Hi,
I'm having a difficult time trying to create two columns of data (or three or 
four etc.) in a float vector.
A list works fine, but the vector gives an error that the data is a pair but 
should
be a real.  I could use make-env for this probably, but seems like I should
be able to get the vector to cooperate.  I'm wondering what I'm 
misunderstanding or if there's
a better way to think of this such as individual vectors then zip them together?
Thanks,
Jim

;float vector XXX
(let* ((fsize 10)
   (im (make-float-vector fsize))
   (x 1)
   (y 1.0)
   )
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (im k) (cons x y)) ;XXX is a pair but should be a real?
;(float-vector-set! im k (cons x y))
(format #t "~% ~A ~A" k (im k) )
(set! x (1+ x))
(set! y (1+ y))
))

;list OK
(let* ((fsize 10)
   (mylist (make-list fsize))
   (x 1)
   (y 1.0)
   )
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (list-ref mylist k) (cons x y))
(format #t "~% ~A ~A" k (list-ref mylist k))
(set! x (1+ x))
(set! y (1+ y))
))
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20230907/2168650d/attachment-0001.html>

--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 184, Issue 1
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] cons value for float vector

2023-09-07 Thread James Hearon

Hi,
I'm having a difficult time trying to create two columns of data (or three or 
four etc.) in a float vector.
A list works fine, but the vector gives an error that the data is a pair but 
should
be a real.  I could use make-env for this probably, but seems like I should
be able to get the vector to cooperate.  I'm wondering what I'm 
misunderstanding or if there's
a better way to think of this such as individual vectors then zip them together?
Thanks,
Jim

;float vector XXX
(let* ((fsize 10)
   (im (make-float-vector fsize))
   (x 1)
   (y 1.0)
   )
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (im k) (cons x y)) ;XXX is a pair but should be a real?
;(float-vector-set! im k (cons x y))
(format #t "~% ~A ~A" k (im k) )
(set! x (1+ x))
(set! y (1+ y))
))

;list OK
(let* ((fsize 10)
   (mylist (make-list fsize))
   (x 1)
   (y 1.0)
   )
(do ((k 0 (+ k 1)))
((>= k fsize))
(set! (list-ref mylist k) (cons x y))
(format #t "~% ~A ~A" k (list-ref mylist k))
(set! x (1+ x))
(set! y (1+ y))
))
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] OT music

2023-06-26 Thread James Hearon
Hi Michael,
re: code ex.

There was no overarching algorithm or AI.  (I wish there were...things could be 
easier).  Just using Bill's great variety of insts and gens to create sounds 
derived from the manual, and then mixing them.  Also using Michael Scholz's 
inf-snd.el and emacs as editor. Here's an example.

Best Regards,
Jim

;instrument to create sounds
(define (pulsed-envtest beg dur amp)
  (let ((start (seconds->samples beg))
  (stop (seconds->samples (+ beg dur)))
(rnd1 (abs(mus-random 5)))
(e (make-pulsed-env '(0 1 1 1 2 0) .01 1))
(frq (make-env '(0 1 1 0) :duration dur :scaler (hz->radians 70)))
  (ampf (make-env '(0 0 .1 1 20 1 20.1 0) :duration dur :scaler amp))
  (gen1 (make-polywave 300 '(1 0.8 2 .07 3 .13)))
  (rnd2 (make-rand-interp 150 (hz->radians 20)))
)
  (do ((i start (+ i 1)))
  ((= i stop))
  (outa i (* (env ampf)
 (pulsed-env e (*(env frq)rnd1 ) )
 (polywave gen1 (rand-interp rnd2)))

 (with-sound (:play #t) (pulsed-envtest 0 6 .95))

; then mixes...

;;/
;;/
;;STEREO vers.
;show files from a folder. load a file from the list.
;add a number of mixes at random times.
;render, getting ready to save file.
;;/
;;/
;the list of files
(sound-files-in-directory "/opt/snd-23/test/")

;prints the list
(let* ((mylist (sound-files-in-directory "/opt/snd-23/test/")))mylist)

;get the length of the list
(let* (( mylist (sound-files-in-directory "/opt/snd-23/test/")) ;declare a list
)
(length mylist)
)
;---
;sets all mixes to blue
(set! (mix-color) (make-color 0 0 1))
;---
;; OPEN A STEREO SOUND for inspection, if needed.
(begin
(open-sound "/opt/snd-23/test/mywave.wav")
)

(play)

(close-sound #t)
;--
;displays the path, first filename, and opens the first file in the list
;then ADDS MIXES
(let* (( mypath "/opt/snd-23/test/")
   ( mylist (sound-files-in-directory "/opt/snd-23/test/")) ;declare a list
   ( myframples 0)
   ( ranframples 0)
   ( startnum 1)  ;*starting mix number*
   ( nummixes 5)  ;*number of mixes (nummixes - startnum)
   )
(format #t " ~A\n" mypath)
(format #t " ~A\n" (list-ref mylist 0))
(string-append mypath (list-ref mylist 0))
(open-sound (string-append mypath (list-ref mylist 9 ))) ;first opened snd
(set! myframples (framples *snd-opened-sound*))
(format #t "~A\n" myframples )
  (do ((i startnum (+ i 1)))
   ((>= i (+ startnum nummixes)))
(set! ranframples (random myframples))
(normalized-mix (string-append mypath(list-ref mylist i)) ranframples  #t 0 0)  
;note #t for stereo
))
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] OT music

2023-06-20 Thread James Hearon


https://www.ed6673.com/music/

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] OT music

2023-06-20 Thread James Hearon

Hi,
I'm enjoying working with the instruments, synthesis gens, and making some of 
my own insts in Snd.

I've posted a few pieces from the last couple of years made with Snd.

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] loading libc_s7.so

2023-01-11 Thread James Hearon
Ah yes.

Adding (define stderr-buffered #t) in repl.scm, was what I was missing.
I'll make a note this time so's not to forget.

My searches couldn't seem to come up with that important bit of info for 
upgrades.

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] loading libc_s7.so

2023-01-10 Thread James Hearon
Hi,
I upgraded to f37, Snd23 but I've lost track of what I am supposed to do for 
the hung loading libc_s7.so problem.

> ./snd
loading libc_s7.so
...

Could someone kindly remind me what makes this load again?

Thank you,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Snd command line

2022-09-01 Thread James Hearon
Yay.  (define stderr-buffered #t) at top of repl.com helps load the lib_s7.so.

Thank you.  It's been a while since I used Snd with no gui.

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] snd command line

2022-09-01 Thread James Hearon
Hi,
I've upgraded to f36, snd 22.6 and tried configuring and running Snd with no 
gui.

It writes libc_s7.c, and lib_s7.so, but doesn't load lib_s7.so.  I recall some 
pipewire weirdness previously.  I'm wondering what the status or workaround 
might be, if any at all?

No harm.  Still enjoying using Snd from emacs.

Thank you,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-bandpass

2022-07-01 Thread James Hearon
Yes. Understood.  That's very helpful information.  I see I can use mus-xcoeffs 
with make-bandpass.  I think I wasn't indexing it properly too.

If I might continue to ask, what are the numbers ouput from the generator, ex. 
(bandpass b)?

I know the xcoeffs are the filter magnitudes but when nothing is passing thru 
the filter yet, as it would be if one were to call (outa i  (b (* amp (oscil 
os,  what do the output numbers of the generator represent before the 
filter is applied to a source?  Are they random sample amplitudes, for ex.?

(let* ((b (make-bandpass (hz->radians 500.0) (hz->radians 2000.0) 3))
   (v (make-float-vector 3))
   )
   (do ((l 0 (+ l 1)))
   ((= l 3))
;(float-vector-set! v l (bandpass b l)) ;what is output here?
(float-vector-set! v l ((mus-xcoeffs b) l)) ;filter magnitudes
(format #t "~%l: ~F v: ~0,6F" l (v l))
)
   (do ((l 0 (+ l 1)))
   ((= l 3))
(format #t "~%j: ~F  v: ~0,6F" l (v l))
)
)

...also (sorry this long-winded) when I see a lambda func adding the two 
bandpass filters, ex.

(flt3 (lambda (y) (+ (bandpass flt1 y) (bandpass flt2 y

I cannot get the mus-xcoeffs of flt3 then, because it's now a lambda function.
So my purpose was to prove to myself that the lambda func was indeed the same 
as adding two vectors of mus-xcoeffs.
(float-vector-add! v1 v2).
In other words trying to see the numbers to verify the lambda function is 
indeed adding the xcoeffs, not the generator outputs.
I hope that makes sense.  But I'm still failing in my proof.

Regards,
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Thursday, June 30, 2022 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 169, Issue 9

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. Re: make-bandpass xcoeffs (b...@ccrma.stanford.edu)


--

Message: 1
Date: Wed, 29 Jun 2022 12:04:42 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] make-bandpass xcoeffs
Message-ID: <4bc1a174e5c876e81b11ac36a0886...@ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

make-bandpass is a wrapper around make-fir-filter, returning
an fir-filter generator, so mus-xcoeffs does work with it;
there's an example in snd-test.scm around line 7706.
make-bandpass is not itself a generator; it returns one.
If you look at the code in dsp.scm you'll see
(define bandpass fir-filter) -- this says the
bandpass generator is an fir-filter.  In the
first case, I think you're setting a vector to the
output of the bandpass generator, and in the second
it looks like you've copied the make-bandpass code
to set the vector, so you're setting the vector to
two different things.



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 169, Issue 9
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-bandpass xcoeffs

2022-06-29 Thread James Hearon
Hi,
It seems make-bandpass doesn't have the mus-xcoeffs feature as general 
make-filter does, but I was trying to get the numbers to do some comparisons 
all in one definstrument, define, or let.  It seems calling the make-bandpass 
function as a generator and trying to place the output into a vector is the 
wrong approach, or maybe I have the inp variable wrong?  Also it seems one can 
use a bandpass or fir-filter call interchangeably?

How can I best get accurate xcoeffs numbers in-line, so to speak, from the 
make-bandpass gen?

(define (gentest amp flo1 fhi1 order)
 (let ((flt1 (make-bandpass (hz->radians flo1) (hz->radians fhi1) order)) 
;flow, fhigh, order
 (v (make-float-vector order))
 )
   (do ((l 0 (+ l 1)))
   ((= l order))
(float-vector-set! v l (bandpass flt1 l))  ;or (fir-filter flt1 l)
(format #t "~%l: ~F bandpass: ~0,6F v: ~0,6F" l (bandpass flt1 l) (v l))
) ))

(with-sound (:srate 48000 :channels 2 :header-type mus-riff )
   (gentest .5 200 400 3 )
)

As a test, I modified make-bandpass from dsp.scm to be able to print the coeffs 
which makes me believe the float-vector-set! approach above doesn't give the 
coeffs I was hoping to see.

(define (mymake-bandpass flo fhi order)
   (let* (
  (len order)
  (arrlen (+ 1 (* 2 len)))
  (arr (make-float-vector arrlen))
  )
(do ((i (- len) (+ i 1))) ;-len to +len
   ((= i len)
(make-fir-filter arrlen arr)) ;order xcoeffs
 (let* ((k (+ i len))
(denom (* pi i))
(num (- (sin (* fhi i)) (sin (* flo i)
   (set! (arr k)
 (if (= i 0)
 (/ (- fhi flo) pi)
 (* (/ num denom)
(+ .54 (* .46 (cos (/ (* i pi) len)
   (do ((l 0 (+ l 1)))
   ((= l arrlen))
(format #t "~%l: ~F  xcoeffs: ~0,6F" l (arr l))
)) )

(mymake-bandpass (hz->radians 200)  (hz->radians 400) 3)


Thank you for any suggestions,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] out

2022-06-16 Thread James Hearon

Hi,
I think I've had a basic misunderstanding re: re stereo and using out such as 
outa, outb, outc, outd. It seems to sum rather than provide discrete outs?  I'm 
just checking I'm not going bonkers looking at the fft of the output signal.  I 
know locsig works differently

ex.1 results in 880 hz on a and b, but would expect 440 on a and 440 on b.
(with-sound (:play #f :channels 2)
  (let ((gen (make-oscil 440.0)))
(do ((i 0 (+ i 1)))
((= i 48000))
  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen)))
  )))

ex.2 but to have have the same signal on both channels I need to use 2 gens?
(with-sound (:play #f :channels 2)
  (let ((gen (make-oscil 440.0))
  (gen2 (make-oscil 440.0)))
(do ((i 0 (+ i 1)))
((= i 48000))
  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen2)))
  )))

Or how do you best do stereo using out?
This seems to sum as well.

(with-sound (:play #f :channels 2)
  (let* ((gen (make-oscil 440.0))
 (gen2 gen))
(do ((i 0 (+ i 1)))
((= i 48000))
  (outa i (* 0.5 (oscil gen)))
  (outb i (* 0.5 (oscil gen2)))
  )))


Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] portamento

2022-05-11 Thread James Hearon
Hi,
I'm still pondering how best to accomplish this.  I tried a couple of exs 
below, one adding filters.

I thought bandpass was best to try but couldn't get good high cutoff results 
with just one filter so I went to two overlapping bandpass filters.  But I've 
buggered the freqs by an octave somehow.  That could have been in using 
hz->radians as cutoffs.

I think my experiments still sound too glissy overall.

I'm wondering if there are other suggestions?

Thank you,
Jim

;no portamento.
(definstrument (noport start-time duration frequency (amp-env '(0 0 1 1 2 1 3 
0)) sampling-rate)
  (let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate
(sine-wave (make-oscil :frequency frequency))
(ampf (make-env amp-env :duration duration :scaler 1.0))
 )
 (do ((i beg (+ i 1)))
 ((= i end))
 (outa i (* (env ampf) (oscil sine-wave )))
 (outb i (* (env ampf) (oscil sine-wave )))
 )))

;portamento. no filter.
(definstrument (myport start-time duration frequency start-freq end-freq 
(amp-env '(0 0 1 1 2 1 3 0)) sampling-rate)
  (let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate
(sine-wave (make-oscil :frequency frequency))
(ampf (make-env amp-env :duration duration :scaler 1.0))
(frqf (make-env '(0 0 1 1) :scaler (hz->radians (- end-freq start-freq)) 
:duration duration :base 0.67))
 )
 (do ((i beg (+ i 1)))
 ((= i end))
 (outa i (* (env ampf) (oscil sine-wave (env frqf) )))
 (outb i (* (env ampf) (oscil sine-wave (env frqf) )))
 )))

(with-sound (:srate 48000 :channels 2 :header-type mus-riff  :play #t)
  (myport 0 1 300 300 400 '(0 .3 .5 .1  1 .09) 48000)
  (noport 1.1 .9 400 '(0 .01 1 .1) 48000)

  (myport 2 1 400 400 500 '(0 .2 .5 .1  1 .09) 48000)
  (noport 3.1 .9 500 '(0 .01 1 .1) 48000)

  (noport 4 .3 500 '(0 .19 .3 .001) 48000)
  (myport 4.2 .6 500 500 300 '(0 .001 .5 .1 1 .3) 48000)
  (noport 5 1 300 '(0 .08 .3 .001) 48000)
)

;portamento adding filters.
(definstrument (myportfilt start-time duration frequency start-freq end-freq 
(glissamp-env '(0 0 1 1 2 0)) (amp-env '(0 0 1 1 2 1 3 0)) sampling-rate order1 
flow1 fhigh1 order2 flow2 fhigh2)
  (let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate
(sine-wave (make-oscil :frequency frequency)) ;sine osc
(ampf (make-env amp-env :duration duration :scaler 1.0)) ;overall amp env
(frqf (make-env '(0 0 1 1) :scaler (hz->radians (- end-freq start-freq)) 
:duration duration :base 0.67)) ;gliss
(gliss_amp (make-env glissamp-env :duration duration :scaler 1.0)) ;another amp 
env for the gliss
(flt1 (make-butterworth-bandpass order1 (hz->radians flow1)  (hz->radians 
fhigh1)))
(flt2 (make-butterworth-bandpass order2 (hz->radians flow2)  (hz->radians 
fhigh2)))
)
 (do ((i beg (+ i 1)))
 ((= i end))
(outa i (* (env ampf) (+  (* (env gliss_amp)(flt1 (oscil sine-wave  (env 
frqf (* (env gliss_amp)(flt2 (oscil sine-wave  (env frqf)))
(outb i (* (env ampf) (+  (* (env gliss_amp)(flt1 (oscil sine-wave  (env 
frqf (* (env gliss_amp)(flt2 (oscil sine-wave  (env frqf)))
 )))

(with-sound (:srate 48000 :channels 2 :header-type mus-riff  :play #t)
  (noport 0 .55 400 '(0 .03 1 .01) 48000)
  (myportfilt .5 .4 200 200 400 '(0 .3 .4 .1) '(0 0.03 .9 0.06) 
48000 8 100 150 8 100 200)
  (noport .5 .5 800 '(0 .01 1 .01) 48000)

 (noport 1 .55 800 '(0 .03 1 .01) 48000)
  (myportfilt 1.5 .4 400 400 200 '(0 .3 .4 .01) '(0 0.03 .9 0.06) 
48000 8 100 150 8 100 200)
  (noport 1.5 .5 400 '(0 .01 1 .01) 48000)

  (noport 3 1.1 400 '(0 .03 1 .01) 48000)
  (myportfilt 4 .9 200 200 400 '(0 .3 .9 .1) '(0 0.03 .9 0.06) 
48000 8 100 150 8 100 200)
  (noport 5 1 800 '(0 .02 1 .1) 48000)
  )
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 167, Issue 4

2022-04-20 Thread James Hearon
re: portamento

Thanks.  I had experimented with amp envs, and overshoots and undershoots for 
durs but hadn't considered timbre or spectral changes.  I'll think about that.
Regards,
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Tuesday, April 19, 2022 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 167, Issue 4

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. portamento (James Hearon)
   2. Re: portamento (b...@ccrma.stanford.edu)


--

Message: 1
Date: Tue, 19 Apr 2022 18:02:57 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] portamento
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"


Hi,
I'm trying to come up with an approach to portamento note phrasing.  Best I've 
been able to do is work with gliss.  I'm wondering if this is on the right 
track for how this is usually handled?

Regards,
Jim

(definstrument (myport start-time duration frequency start-freq end-freq 
(amp-env '(0 0 1 1 2 1 3 0)) sampling-rate)
  (let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate
(sine-wave (make-oscil :frequency frequency))
(ampf (make-env amp-env :duration duration :scaler 1.0))
(frqf (make-env '(0 0 1 1) :scaler (hz->radians (- end-freq start-freq)) 
:duration duration :base 0.67))
 )
 (do ((i beg (+ i 1)))
 ((= i end))
 (outa i (* (env ampf) (oscil sine-wave (env frqf) )))
 (outb i (* (env ampf) (oscil sine-wave (env frqf) )))
 )))

(with-sound (:srate 48000 :channels 2 :header-type mus-riff  :play #t)
  (myport 0 1 300 300 400 '(0 1 1 .3) 48000)
  (myport 2 1.5 400 400 300 '(0 .3 1 .3) 48000)
)
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20220419/d9797a0a/attachment-0001.html>

--

Message: 2
Date: Tue, 19 Apr 2022 11:33:08 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] portamento
Message-ID: <6d4807c522ab6c39450fd9c424e81...@ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

I think in the context of sound synthesis, portamento
is a glissando between two notes.  It would be interesting
to get a vocal or violin recording of someone using
portamento, and try to imitate it -- I think you'll
also need an amplitude envelope.  Seashore wrote about
it, saying something like "it starts below the first
note and overshoots its target", if I remember right.
You might also need to change the timbre en route.



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 167, Issue 4
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] portamento

2022-04-19 Thread James Hearon

Hi,
I'm trying to come up with an approach to portamento note phrasing.  Best I've 
been able to do is work with gliss.  I'm wondering if this is on the right 
track for how this is usually handled?

Regards,
Jim

(definstrument (myport start-time duration frequency start-freq end-freq 
(amp-env '(0 0 1 1 2 1 3 0)) sampling-rate)
  (let* ((beg (floor (* start-time sampling-rate)))
(end (+ beg (floor (* duration sampling-rate
(sine-wave (make-oscil :frequency frequency))
(ampf (make-env amp-env :duration duration :scaler 1.0))
(frqf (make-env '(0 0 1 1) :scaler (hz->radians (- end-freq start-freq)) 
:duration duration :base 0.67))
 )
 (do ((i beg (+ i 1)))
 ((= i end))
 (outa i (* (env ampf) (oscil sine-wave (env frqf) )))
 (outb i (* (env ampf) (oscil sine-wave (env frqf) )))
 )))

(with-sound (:srate 48000 :channels 2 :header-type mus-riff  :play #t)
  (myport 0 1 300 300 400 '(0 1 1 .3) 48000)
  (myport 2 1.5 400 400 300 '(0 .3 1 .3) 48000)
)
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] mus-chebyshev-u-sum

2021-11-18 Thread James Hearon
re: mus-chebyshev-u-sum takes a list of partial (harmonic)
amplitudes:

(with-sound (:srate 48000 :channels 1 :play #t)
   (let* ((dur 1.0)
 (samps (seconds->samples dur))
 (coeffs (float-vector 0 1 0 1/3 0 1/5 0 1/7 0 1/9))
 (incr (hz->radians 200.0)))
 (do ((i 0 (+ i 1))
 (x 0.0 (+ x incr)))
((= i samps))
   (outa i (* 0.1 (mus-chebyshev-u-sum x coeffs))


Sorry, I had not replied "thank you" for this info re: the input format of the 
float-vector.  I was able to dig deeper and get a better understanding of the 
output values for mus-chebyshev-u-sum by looking carefully at clm.c.  From what 
I gather, the sum result simply sets the amp level of each sample in the 
timedomain.  I'm still not completely clear on the role phase plays per sample, 
but I'll keep thinking about that.  I'm amazed at how much chebyshev there is 
in Snd.  I hadn't taken notice of that until recently. Polywave, Chebyshev 
sums, Chebyshev Coefficients, Chebyshev Filters etc.
regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] mus-chebyshev-u-sum

2021-11-05 Thread James Hearon

Hi,
I'm trying and failing to get my head around mus-chebyshev sums.  For 
predictability I was trying to achieve the square wave output but getting hung 
up.  The manual says mus-chebyshev-tu-sum and friends perform the same function 
as partials->polynomial, but it takes a coeffs vector too, so I'm confused 
about how you would perform additive synthesis (as square wave) with it?

I get the parts about phase, and ability to set individual partial amps etc., 
but can't quite figure what coeffs needs.  My three tries for the coeffs vector 
don't seem to work.  I guess I'm thinking phase and amps are not all that 
critical as long as the coeffs are correct, but I could be wrong.  But maybe 
it's the other way round where you can only do it thru phase and amps and the 
coeffs are not that critical.

(with-sound (:srate 48000 :channels 1 :play #t)
  (let* ((dur 1.0)
(samps (seconds->samples dur))
 (coeffs (partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9)  
mus-chebyshev-second-kind))
 ;(coeffs (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9))
;(coeffs #r(0.8349206349206351 0.0 -2.082539682539683 0.0 18.43809523809524 0.0 
-40.63492063492063 0.0 28.44 0.0))
(x 0.0)
(incr (hz->radians 200.0))
 )
(do ((i 0 (+ i 1)))
((= i samps))
  (outa i (* 0.01 (mus-chebyshev-u-sum x coeffs)))
  (set! x (+ x incr))
   )))

Thank you,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] poly questions

2021-10-28 Thread James Hearon
Hi,
I think I'm understanding better now.  In order to generate and utilize the 
correct Chebyshev coefficients with make-polyshape, one needs to specify the 
kind or type using partials->polynomial to first generate the coefficients.

(partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9)  
mus-chebyshev-second-kind)
;#r(0.8349206349206351 0.0 -2.082539682539683 0.0 18.43809523809524 0.0 
-40.63492063492063 0.0 28.44 0.0

(with-sound (:srate 48000 :channels 1 :play #t)
   (let ((gen (make-polyshape 100.0
  :coeffs #r(0.8349206349206351 0.0 -2.082539682539683 0.0 
18.43809523809524 0.0 -40.63492063492063 0.0 28.44 0.0)  :kind 
mus-chebyshev-second-kind)))
 (do ((i 0 (+ i 1)))
 ((= i 88200))
   (outa i (* .75 (polyshape gen 1.0))


Fantastic.  partials-->polynomial is a nice tool.  There's not that much around 
that allows one to view the coefficents being used in the synthesis.

...I'll move on and try to get some understanding of the sums.

mus-chebyshev-tu-sum x t-coeffs u-coeffs
mus-chebyshev-t-sum x t-coeffs
mus-chebyshev-u-sum x u-coeffs

thanks,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] poly questions

2021-10-27 Thread James Hearon

Hi,
Thank you for the example re: polyshape , square wave. I am surprised to see 
that fractions vs. decimals for amps in the float-vector makes a difference in 
the chebyshev coefficients.

(partials->polynomial (float-vector 1 1 3 1/3 5 1/5 7 1/7 9 1/9 ))
;(0.0 1.0 0.0 -7.999 0.0 35.2 0.0 -54.85714285714286 0.0 
28.44)

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :coeffs #r(0.0 1.0 0.0 -7.999 
0.0 35.2 0.0 -54.85714285714286 0.0 28.44) ))
   )
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .75 (polyshape gen 1.0 ))

When trying to plug the coefficents back into make-polyshape, I get a different 
wave shape, which looks more like a triangle-ish wave instead of the square:
^^
I believe this is where I'm stuck, trying to empirically understand how the 
chebyshev coefficient numbers work for additive synthesis. I thought the 
problem might be normalization or order of coefficients?  Still not sure where 
I'm going wrong.

Any help, advice much appreciated.

Regards,
Jim


From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Tuesday, October 26, 2021 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 161, Issue 11

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. poly questions (James Hearon)


--

Message: 1
Date: Tue, 26 Oct 2021 17:40:43 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] poly questions
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
Trying to get an understanding of all the interesting aspects of polywave in 
snd, and chebyshev polynomials, coefficients etc.  I was trying to get a 
squarish wave from the coefficients but failing.
Also tried partials->polynomial, and normalize-partials with same result.  
Wondering what I'm misunderstanding about how you would employ the coefficients 
for a typical float-vector of partials, and amps for say a square wave?

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :coeffs (partials->polynomial (float-vector 
1 1 3 .33 5 .2 7 .142 9 0.111)) ))
   )
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .75 (polyshape gen 1.0 ))

Also, if I can ask more than one question per email, how do you go about using 
the generators:

mus-chebyshev-tu-sum x t-coeffs u-coeffs
mus-chebyshev-t-sum x t-coeffs
mus-chebyshev-u-sum x u-coeffs

I couldn't seem to locate an ex. for those, but I did see the c code in clm.c 
which is interesting.
Thank you,
Regards,
Jim

-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20211026/e9ebab85/attachment-0001.html>

--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 161, Issue 11
***
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] poly questions

2021-10-26 Thread James Hearon
Hi,
Trying to get an understanding of all the interesting aspects of polywave in 
snd, and chebyshev polynomials, coefficients etc.  I was trying to get a 
squarish wave from the coefficients but failing.
Also tried partials->polynomial, and normalize-partials with same result.  
Wondering what I'm misunderstanding about how you would employ the coefficients 
for a typical float-vector of partials, and amps for say a square wave?

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :coeffs (partials->polynomial (float-vector 
1 1 3 .33 5 .2 7 .142 9 0.111)) ))
   )
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .75 (polyshape gen 1.0 ))

Also, if I can ask more than one question per email, how do you go about using 
the generators:

mus-chebyshev-tu-sum x t-coeffs u-coeffs
mus-chebyshev-t-sum x t-coeffs
mus-chebyshev-u-sum x u-coeffs

I couldn't seem to locate an ex. for those, but I did see the c code in clm.c 
which is interesting.
Thank you,
Regards,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 161, Issue 2

2021-10-03 Thread James Hearon

Hi Bill,

re: polyooid-partial-amps-and-phases gen

Thank you.  I see the sndscm.html#peakphasesdoc now, and that helps explain 
what the obsolete polyoid-partial-amps-and-phases gen was doing in the phase 
parameter of an oscillator.

Polywave is certainly a deep and fascinating area of Snd for synthesis.

Regards,
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Saturday, October 2, 2021 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 161, Issue 2

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. Re: polyoid-partial-amps-and-phases gen (b...@ccrma.stanford.edu)


--

Message: 1
Date: Fri, 01 Oct 2021 13:01:13 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] polyoid-partial-amps-and-phases gen
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

Thanks for the bug report.  That example is obsolete;
polyoid is now a wrapper around polywave.  I didn't
notice it because it is commented out.  noid and polyoid
play games with initial phases -- they were part
of the minimum-peak-amplitude project (see
sndscm.html#peakphasesdoc).



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 161, Issue 2
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] polyoid-partial-amps-and-phases gen

2021-10-01 Thread James Hearon
Hi,
I was looking at "other generators" in generators.scm, and became confused a 
bit by the example:

(with-sound (:clipped #f :channels 2)
  (let* ((samps 44100)
(n 10)
(gen (make-noid 1.0 n 'min-peak))
(gen2 (make-oscil n ((polyoid-partial-amps-and-phases gen) (- (length 
(polyoid-partial-amps-and-phases gen)) 1)
(do ((i 0 (+ i 1)))
((= i samps))
  (outa i (noid gen))
  (outb i (oscil gen2)

I can do something like:
 (gen2 (make-oscil n 0.25)) )

to get an output, but seems like that polyoid-partial-amps-and-phases gen may 
be something old or no longer in use?  But the example seems interesting in 
terms of phase so was trying to unravel it to try to understand what it was 
meant to demonstrate.

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] OT a few pieces

2021-09-08 Thread James Hearon
Hi,
I have so enjoyed working with Snd to create instruments, and sounds.  I've 
found it very flexible and useful.  Also have enjoyed utilizing R. Taube's 
patterns too.
Posting a link to some older pieces I did using snd as an ex. of creative work 
using Snd.  I believe these were from 2019.  
https://5minutemasterpieces.com/steel/
Regards,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] loading libc_s7.c

2021-07-07 Thread James Hearon
Hi,
Thank you for the information.  The ./snd -noinit option seems to work best, so 
far for command-line approach.  My normal approach is to use snd thru emacs and 
I've not had the libc_s7 loading problem there.  So no worries, I can be 
patient until this gets sorted out.
Regards,
Jim


[jhearon@localhost snd-21]$ ./snd -noinit

> (new-sound "test.snd")
#
> (mix "oboe.snd")
#f
> (framples) 50828

;write argument 2, 50828, is an integer but should be an output port
;(if (do ((p lst (cdr p))) ((not (and...
;*stdout*, line 7, position: 789
; (if (do ((p lst (cdr p))) ((not (and (pai...


> (play)
#f
> (exit)
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] loading libc_s7.so

2021-07-04 Thread James Hearon
Hi,
I don't receive an error message.  I just run
> ./snd
then the cursor just hangs on loading libc_s7.so and doesn't progress to <1>

I tried different configurations for building:
These work okay and load libc_s7.so:
$ ./configure --with-s7 --without-audio --without-gui
$ ./configure --with-s7 --without-audio --with-gui

But this one fails to load libc_s7.so
$ ./configure --with-s7 --with-alsa --without-gui

So am thinking maybe something with alsa?

My alsa:

/proc/asound/version
Advanced Linux Sound Architecture Driver Version k5.12.13-300.fc34.x86_64.

$ grep VERSION_STR /usr/include/alsa/version.h
#define SND_LIB_VERSION_STR "1.2.5.1"

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] loading libc_s7.so

2021-07-03 Thread James Hearon
Hi,
I've been having a problem for a few builds with a non-gui build failing to 
load libc_s7.so.  When I run ./snd it writes libc_s7.so, but sticks on loading 
libc_s7.so.
Seems to work okay for gui build, --with-s7, --with-motif.  I don't do any make 
install.  Just make, then ./snd.

>ls -ld libc_s7.so
-rwxrwxr-x 1 jhearon jhearon 342000 Jul  3 14:29 libc_s7.so

but no joy getting ./snd to load it.

I'm wondering what might be the problem?

Regards,
Jim



[jhearon@localhost snd-21]$ ./configure  --with-s7 --with-gsl --with-alsa 
--without-gui CFLAGS=HAVE_COMPLEX_NUMBERS CFLAGS=HAVE_COMPLEX_TRIG
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking size of void *... 8
checking for pkg-config... /usr/bin/pkg-config
checking for fftw3... yes
checking for gsl... yes
checking for oggdec... no
checking for oggenc... no
checking for mpg123... /usr/bin/mpg123
checking for mpg321... no
checking for speexdec... no
checking for speexenc... no
checking for flac... no
checking for timidity... no
checking for wavpack... /usr/bin/wavpack
checking for wvunpack... /usr/bin/wvunpack
checking for audio system... ALSA
configure: creating ./config.status
config.status: creating makefile
config.status: creating mus-config.h

  Options selected
  -
  Snd version ...: 21.6
  CFLAGS : -O2 -I. -I/usr/include/linux/param.h
  LDFLAGS ...: -Wl,-export-dynamic
  LIBS...:  -lm -ldl
  prefix.: /usr/local
  extension language.: s7
  audio system...: ALSA
  graphics toolkit...: None
  optional libraries.: fftw-3.3.8 gsl-2.6
  random features:
  environs...: x86_64-pc-linux-gnu gcc
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 157, Issue 4

2021-06-24 Thread James Hearon
Hi Bill,
Yes, that's very helpful.  I believe I was confused about trying to add a list 
to the
make-pulsed-env dur or frequency component, which only takes a real num:
(e (make-pulsed-env '(0 0 1 1 2 0) 1.0  '(0 0 .5 .15 1 0) ))

versus applying an env. to the polyshape index or fm parameter:
(polyshape gen (* (pulsed-env e (env frq)))  0.1)

But I see how it should work now.

So this was the effect I was after. Morse Code?

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 400.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
 (e (make-pulsed-env '(0 0 1 1 2 0) 1.0 1)) ;w/ dur freq
 (frq (make-env '(0 0 .5 .15 1 0) :duration 1.0 :scaler (hz->radians 
50)))
)
(do ((i 0 (+ i 1)))
((= i 192000))
(outa i (* 5.95 (polyshape gen (* (pulsed-env e (env frq)))  0.1)  ))  ;w/ 
index, fm
  )))

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Wednesday, June 23, 2021 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 157, Issue 4

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. make-pulsed-env (James Hearon)
   2. Re: make-pulsed-env (b...@ccrma.stanford.edu)


--

Message: 1
Date: Wed, 23 Jun 2021 17:56:03 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] make-pulsed-env
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
I was trying to figure out how to use an env on the freq parameter of 
make-pulsed-env
(make-pulsed-env envelope duration frequency) but it wants a real, not a pair.  
I thought I'd look-see the code for make-pulsed-env, but I can't seem to locate 
it.  Wondering if there's a way to go about achieving the effect?  
make-freqpulsed-env?

I tried adding an amp to the pulsed-env but that's not the effect I was after.
(outa i (* 5.95 (polyshape gen (* (env ampenv) (pulsed-env jsenvel))  0.01) 
 ))
Also tried a vibrato type effect using an LFO, but still no joy.
Just trying to get make-pulsed-env to change frequency within the duration of 
the note.
Something like: <>,<  >,   < >, <>, <>,<>,<>

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 400.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
(jsenvel (make-pulsed-env '(0 0  .25  0.01  .5  0.2 1  0.0)  1.0  1.0)) 
 ;XXX
)
(do ((i 0 (+ i 1)))
((= i 96000))
(outa i (* 5.95 (polyshape gen  (pulsed-env jsenvel)  0.01)  ))
  )))

Regards,
Jim
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210623/5f62e957/attachment-0001.html>

--

Message: 2
Date: Wed, 23 Jun 2021 11:26:53 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] make-pulsed-env
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

The make-pulsed-env frequency parameter sets the
base frequency (it can be 0); you change the pulse
rate while running via the fm argument to the
pulsed-env generator.  For example:

(with-sound ()
   (let ((e (make-pulsed-env '(0 0 1 1 2 0) .01 1))
 (frq (make-env '(0 0 1 1) :duration 1.0 :scaler (hz->radians
50
 (do ((i 0 (+ i 1)))
 ((= i 44100))
   (outa i (* .5 (pulsed-env e (env frq)))



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 157, Issue 4
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-pulsed-env

2021-06-23 Thread James Hearon
Hi,
I was trying to figure out how to use an env on the freq parameter of 
make-pulsed-env
(make-pulsed-env envelope duration frequency) but it wants a real, not a pair.  
I thought I'd look-see the code for make-pulsed-env, but I can't seem to locate 
it.  Wondering if there's a way to go about achieving the effect?  
make-freqpulsed-env?

I tried adding an amp to the pulsed-env but that's not the effect I was after.
(outa i (* 5.95 (polyshape gen (* (env ampenv) (pulsed-env jsenvel))  0.01) 
 ))
Also tried a vibrato type effect using an LFO, but still no joy.
Just trying to get make-pulsed-env to change frequency within the duration of 
the note.
Something like: <>,<  >,   < >, <>, <>,<>,<>

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 400.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
(jsenvel (make-pulsed-env '(0 0  .25  0.01  .5  0.2 1  0.0)  1.0  1.0)) 
 ;XXX
)
(do ((i 0 (+ i 1)))
((= i 96000))
(outa i (* 5.95 (polyshape gen  (pulsed-env jsenvel)  0.01)  ))
  )))

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] snd21.4

2021-06-07 Thread James Hearon


Hi,

I'm having trouble identifying which package is the notcurses-core for f34.  
Which one was that?
I seem to only come up with the bigger one.

Thank you,
Jim


Snd 21.4:

nrepl: notcurses 2.1.6 or later is required now (notcurses got split
  into 2 libraries, notcurses-core and notcurses, and the APIs
  are not compatible.  notcurses-core is much smaller, so I'm
  using it).

checked: notcurses 2.3.0, Fedora 34, sbcl 2.1.4, Ubuntu 21.04
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 156, Issue 4

2021-05-12 Thread James Hearon
re: repeating envs
Thank you for the corrections.  I don't think I would have been able to figure 
out the part about deletion of lambda, map-channel in the strum definition.  
Working now.
Regards,
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Tuesday, May 11, 2021 9:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 156, Issue 4

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. repeating envs (James Hearon)
   2. Re: repeating envs (b...@ccrma.stanford.edu)


--

Message: 1
Date: Tue, 11 May 2021 17:46:52 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] repeating envs
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
The lambda function, from the manual, for repeating an env seems like a useful 
thing, but I cannot seem to find the magic to make it repeat.  I'm wondering 
how you would use it for the polyshape gen fm parameter? Or is that not how 
it's supposed to work?
Regards,
Jim

(define (strum e)
  (map-channel (lambda (y)
(if (> (mus-location e) (mus-length e)) ; mus-length = dur
(mus-reset e)) ; start env again (default is to stick at the last value)
(* y (env e)

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
(strum (make-env '(0 0  .25  0.01  .5  0.2 1  0.0) :scaler 1.0 :duration 1 
:base .53))
)
(do ((i 0 (+ i 1)))
((= i 96000))
  (outa i (* .5 (polyshape gen 0.95 (env strum
  )))


make-pulsed-env, and pulsed-env work fine, however.

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
(jsenvel (make-pulsed-env '(0 0  .25  0.01  .5  0.2 1  0.0)  1.0  1.0))
)
(do ((i 0 (+ i 1)))
((= i 96000))
  (outa i (* .5 (polyshape gen 0.95 (pulsed-env jsenvel
  )))

-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20210511/452cef39/attachment-0001.html>

--

Message: 2
Date: Tue, 11 May 2021 11:32:40 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] repeating envs
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

I think you're close -- this slightly edited version
seems to work:

(define (strum e)
   (if (> (mus-location e) (mus-length e))
   (mus-reset e))
   (env e))

(with-sound (:srate 48000 :channels 1 :play #t)
   (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125
4 .125)))
(strum-env (make-env '(0 0  .25  0.01  .5  0.2 1  0.0) :scaler 1.0
:duration 1 :base .53))
 )
 (do ((i 0 (+ i 1)))
 ((= i 96000))
   (outa i (* .5 (polyshape gen 0.95 (strum strum-env
   )))

In your code, you had two things named "strum", and
the map-channel wasn't needed.



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 156, Issue 4
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] repeating envs

2021-05-11 Thread James Hearon
Hi,
The lambda function, from the manual, for repeating an env seems like a useful 
thing, but I cannot seem to find the magic to make it repeat.  I'm wondering 
how you would use it for the polyshape gen fm parameter? Or is that not how 
it's supposed to work?
Regards,
Jim

(define (strum e)
  (map-channel (lambda (y)
(if (> (mus-location e) (mus-length e)) ; mus-length = dur
(mus-reset e)) ; start env again (default is to stick at the last value)
(* y (env e)

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
(strum (make-env '(0 0  .25  0.01  .5  0.2 1  0.0) :scaler 1.0 :duration 1 
:base .53))
)
(do ((i 0 (+ i 1)))
((= i 96000))
  (outa i (* .5 (polyshape gen 0.95 (env strum
  )))


make-pulsed-env, and pulsed-env work fine, however.

(with-sound (:srate 48000 :channels 1 :play #t)
  (let ((gen (make-polyshape 100.0 :partials (list 1 .5  2 .25  3 .125  4 
.125)))
(jsenvel (make-pulsed-env '(0 0  .25  0.01  .5  0.2 1  0.0)  1.0  1.0))
)
(do ((i 0 (+ i 1)))
((= i 96000))
  (outa i (* .5 (polyshape gen 0.95 (pulsed-env jsenvel
  )))

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] configure

2021-03-20 Thread James Hearon
Hi,
Thanks for Snd21.2.

For configure I've included:
CFLAGS="-I/usr/include/linux/param.h"

But I don't see param.h  in configure or Readme.snd any longer.  Is it still 
needed/useful?  Just seems to define HZ based on system clock, I think.

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 154, Issue 3

2021-03-05 Thread James Hearon
Here is a rough idea of what I was thinking.  Thank you for the info re:
   (vector-set! regs i (make-region beg end snd chn))) as a way to
increment a variable as region name.

I've got more to do, I know, but I'm also still a bit hung up on
var types at the insert-region line below where it wants a region id
instead of an unspecified object.

;;Open the sound and list samples
(begin
(open-sound "myfile.wav")
(mus-sound-samples  "myfile.wav")
)

(begin
   (do ((i 0 (+ i 1)))
   ((= i 3))
   (let* ((g (gaussian-distribution 10.0))
 (regs (make-vector 3))
 (mysamples (mus-sound-samples  "myfile.wav"))
 (myran 0.0)
 (regstart 0)
 (regend 0)
 (regdur 1000)
 (myreg 0)
 )
(set! myran (any-random (abs 10.0) g))
(set! regstart (round (* myran mysamples)))
(set! regend (round (+ regstart regdur)))
   (vector-set! regs i (make-region regstart regend 0 1))
   (set! myreg (vector-ref regs 0))
   (insert-region myreg   0 0 1)
   )))

Regards,
Jim


From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Wednesday, March 3, 2021 10:00 AM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 154, Issue 3

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. Re: dynamic variables (b...@ccrma.stanford.edu)


--

Message: 1
Date: Tue, 02 Mar 2021 12:10:45 -0800
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] dynamic variables
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

I can't tell what you're trying to do.  Is this related to
the region-play-list example in sndscm.html?  Please send
a more detailed description of the problem, or the code you
want to use.



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 154, Issue 3
**
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] dynamic variables

2021-03-02 Thread James Hearon
Hi,
I have been bashing on a problem trying to figure out the best way to create 
and use dynamic variables in scheme, such as reg0, reg1, reg2, etc. and 
stumbling a bit.  Wondering if there's a somewhat standard approach to doing 
that?

For ex. if I create a variable, say inside a do-loop, and want to increment the 
variable, in order to be able to access the particular regions later, what's 
the best way to think of that?

(xxx (make region beg end snd chn))

I tried the string-append approach, but doesn't seem be the best method since 
(type-of) shows the variable (xxx) as a c-object.  Is there perhaps a method to 
create and increment c-objects?

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-polyshape

2021-02-07 Thread James Hearon

Hi,
re: make-polyshape

Very cool.  At least three ways to get the coeffs parameter working.  I don't 
why I couldn't figure that out earlier.
Thanks
JIm


(with-sound ()
  (let ((gen (make-polyshape 400.0 :coeffs  (float-vector -1.0 -5.0 18.0 8.0 
-48.0 0.0 32.0))))
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .5 (polyshape gen 0.25))

(with-sound ()
  (let ((gen (make-polyshape 400.0 :coeffs #r(-1.0 -5.0 18.0 8.0 -48.0 0.0 
32.0))))
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .5 (polyshape gen 0.25))

(with-sound ()
  (let ((gen (make-polyshape 400.0 :coeffs (partials->polynomial '(1 1 3 2 6 1) 
mus-chebyshev-second-kind
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .5 (polyshape gen 0.25))



___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-polyshape

2021-02-06 Thread James Hearon
Hi,
I think I figured that out by locating an ex. in test.scm.

(partials->polynomial '(1 1 3 2 6 1))
;(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0)

instead of using the resulting eval of (partials->polynomial) as input to 
coeffs:

(set! gen1 (make-polyshape 440.0 :coeffs  '(-1.0 -5.0 18.0 8.0 -48.0 0.0 
32.0

It rather seems to want the whole function call:
(set! gen1 (make-polyshape 440.0 :coeffs (partials->polynomial '(1 1

or
(set! gen1 (make-polyshape 440.0 :coeffs (partials->polynomial '(1 1 3 2 6 1

nice.

Thanks,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] polyshape

2021-02-05 Thread James Hearon
Hi,

I'm getting confused on make-polyshape and partials->polynomial.

re: sndclm manual
partials->polynomial takes a list or float-vector of partial numbers and 
amplitudes and returns the Chebyshev polynomial coefficients that produce that 
spectrum. These coefficients can be passed to polyshape (the coeffs argument), 
or used directly by polynomial...

ex.
(partials->polynomial '(1 1 3 2 6 1))
;(-1.0 -5.0 18.0 8.0 -48.0 0.0 32.0)

I'm trying to figure out how to use the coefficients, but I get an "attempt 
to apply a real -1.0, etc. error" when I plugin the float vector to the coeffs 
parameter.

(with-sound ()
  (let ((gen (make-polyshape 400.0 :coeffs (-1.0 -5.0 18.0 8.0 -48.0 0.0 
32.0
(do ((i 0 (+ i 1)))
((= i 88200))
  (outa i (* .5 (polyshape gen 0.25))

How do you go about applying the partials->polynomial output to 
make-polyshape?  I couldn't seem to grep an example of that in the code.

Thank you,
Jim


___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] mix-home, etc.

2020-09-11 Thread James Hearon
Hi,
I'm getting hung up in mixes.  Trying something like the manual example, below, 
but
getting back an error that the argument is a pair, not a mix (object).

Wondering we're I might be going wrong?

Thank you,
Jim

-

mix-home mix


mix-home returns a list containing the mix's output sound and channel number, 
and the input original filename (if any), and input channel.

> (define mx (mix "pistol.snd" 1000))
#
> (mix-home mx)
(# 0 "/home/bil/cl/pistol.snd" 0)
;; (list output-sound-index output-channel input-filename input-channel)
> (set! mx (mix-float-vector (make-float-vector 100 .1) 2000))
#
> (mix-home mx)
(# 0 #f 0)
;;   #f: no input file

---

mine:

(begin (open-sound "oboe.snd"))
(define mx (mix "pistol.snd" 1000))
>(#)
(mix-home mx) ;XXX
>mix-home argument 1, (#), is a pair but should be a mix

...stuck on other calls too such as
(mix-maxamp mx)
(mix-name->id 0)
(set! (mix-amp mx) .05)

but
(find-mix 0 0 0)   ;works

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] O.T. compositions

2020-08-31 Thread James Hearon
Hi,

I'm wondering if there are any Schottstaedt compositions available someplace on 
the net for listening?

Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] unbound variable with CM_Patterns.scm

2020-06-19 Thread James Hearon
Hi,
I'm still having trouble with f32, and snd 20.4, s7 9.1, sndlib 24.7

open snd
$ ./snd

choose Show Listener

>(load "/opt/snd-20/CM_patterns.scm")
;unquote: no argument, 'unquote
; (list-values 'begin (list-values...
>(define aaa (make-cycle (list 1 2 3)))
;unbound variable make-cycle
;(list-value 'begin (list-values...

I see it writes a fresh libc_s7.c, and libc_s7.so when I load CM_Patterns.scm, 
but I still don't have something hooked up correctly yet.
Wondering where it might be going wrong?

Thank You,
Regards,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 145, Issue 5

2020-06-11 Thread James Hearon
NOENT (No such file or directory)
readlink("/proc/self/exe", "/opt/snd-20-command/snd", 99) = 23
openat(AT_FDCWD, "/home/jhearon/.pulse/client.conf", O_RDONLY|O_CLOEXEC) = -1 
ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/jhearon/.config/pulse/client.conf", O_RDONLY|O_CLOEXEC) 
= -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/pulse/client.conf", O_RDONLY|O_CLOEXEC) = 7
readlink("/proc/self/exe", "/opt/snd-20-command/snd", 99) = 23
openat(AT_FDCWD, "/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 8
openat(AT_FDCWD, "/etc/pulse/client.conf.d", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
openat(AT_FDCWD, "/dev/shm/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 7
openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 7
stat("/run/user/1000", {st_mode=S_IFDIR|0700, st_size=300, ...}) = 0
mkdir("/run/user/1000/pulse", 0700) = -1 EEXIST (File exists)
openat(AT_FDCWD, "/run/user/1000/pulse", 
O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 8
lstat("/run", {st_mode=S_IFDIR|0755, st_size=1320, ...}) = 0
lstat("/run/user", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
lstat("/run/user/1000", {st_mode=S_IFDIR|0700, st_size=300, ...}) = 0
lstat("/run/user/1000/pulse", {st_mode=S_IFDIR|0700, st_size=80, ...}) = 0
stat("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=9598, ...}) = 0
readlink("/proc/self/exe", "/opt/snd-20-command/snd", 99) = 23
openat(AT_FDCWD, "/home/jhearon/.pulse/client.conf", O_RDONLY|O_CLOEXEC) = -1 
ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/jhearon/.config/pulse/client.conf", O_RDONLY|O_CLOEXEC) 
= -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/pulse/client.conf", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/etc/pulse/client.conf.d", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
openat(AT_FDCWD, "/dev/shm/", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 7
openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_NOCTTY|O_CLOEXEC) = 7
stat("/run/user/1000", {st_mode=S_IFDIR|0700, st_size=300, ...}) = 0
mkdir("/run/user/1000/pulse", 0700) = -1 EEXIST (File exists)
openat(AT_FDCWD, "/run/user/1000/pulse", 
O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 8
lstat("/run", {st_mode=S_IFDIR|0755, st_size=1320, ...}) = 0
lstat("/run/user", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
lstat("/run/user/1000", {st_mode=S_IFDIR|0700, st_size=300, ...}) = 0
lstat("/run/user/1000/pulse", {st_mode=S_IFDIR|0700, st_size=80, ...}) = 0
getcwd("/opt/snd-20-command", 4096) = 20
access("/etc/snd_s7.conf", F_OK)= -1 ENOENT (No such file or directory)
access("/etc/snd.conf", F_OK)   = -1 ENOENT (No such file or directory)
access("/home/jhearon/.snd_prefs_s7", F_OK) = 0
stat("/home/jhearon/.snd_prefs_s7", {st_mode=S_IFREG|0777, st_size=1246, ...}) 
= 0
openat(AT_FDCWD, "/home/jhearon/.snd_prefs_s7", O_RDONLY) = 3
access("/home/jhearon/.snd_s7", F_OK)   = -1 ENOENT (No such file or directory)
access("/home/jhearon/.snd", F_OK)  = -1 ENOENT (No such file or directory)
stat("repl.scm", {st_mode=S_IFREG|0644, st_size=58629, ...}) = 0
openat(AT_FDCWD, "repl.scm", O_RDONLY)  = 3
stat("libc.scm", {st_mode=S_IFREG|0644, st_size=96351, ...}) = 0
openat(AT_FDCWD, "libc.scm", O_RDONLY)  = 3
stat("cload.scm", {st_mode=S_IFREG|0644, st_size=27703, ...}) = 0
openat(AT_FDCWD, "cload.scm", O_RDONLY) = 3
access("libc_s7.c", F_OK)   = 0
access("libc_s7.so", F_OK)  = 0
stat("libc_s7.so", {st_mode=S_IFREG|0775, st_size=317656, ...}) = 0
stat("libc_s7.c", {st_mode=S_IFREG|0664, st_size=396622, ...}) = 0
access("libc.scm", F_OK)= 0
stat("libc_s7.so", {st_mode=S_IFREG|0775, st_size=317656, ...}) = 0
stat("libc.scm", {st_mode=S_IFREG|0644, st_size=96351, ...}) = 0
loading libc_s7.so
stat("libc_s7.so", {st_mode=S_IFREG|0775, st_size=317656, ...}) = 0
access("/opt/snd-20/libc_s7.so", F_OK)  = -1 ENOENT (No such file or directory)
access("/home/jhearon/libc_s7.so", F_OK) = 0
openat(AT_FDCWD, "/home/jhearon/libc_s7.so", O_RDONLY|O_CLOEXEC) = 3
--- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

-

snd_prefs_s7

; Snd 17.0 (6-Dec-16) options saved Sat 17-Dec-2016 09:36 HST
(set! (default-output-chans) 2)
(set! (default-output-srate) 48000)
(set! (default-output-hea

[CM] snd 20.4, f32 segfault

2020-06-10 Thread James Hearon
Hi,
I'm having a strange problem after upgrading to f32 from f31.
I needed to rebuild snd because of a libgsl issue.

./snd: error while loading shared libraries: libgsl.so.23: cannot open shared 
object file: No such file or directory

Trying to rebuild with fresh srcs.

./configure  --with-s7 --with-gsl --with-alsa --without-gui

It builds, but when I try to run >./snd, I get a segfault.

[jhearon@dhcp-168-105-83-235 snd-20-command]$ ./snd
writing libc_s7.c
loading libc_s7.so
Segmentation fault (core dumped)

I'm not exactly sure what's going on.

I'm including a valgrind output, if that helps.

Regards,
Jim

[jhearon@dhcp-168-105-83-235 snd-20-command]$ valgrind ./snd
==11749== Memcheck, a memory error detector
==11749== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==11749== Using Valgrind-3.16.0 and LibVEX; rerun with -h for copyright info
==11749== Command: ./snd
==11749==
loading libc_s7.so
==11749== Invalid write of size 4
==11749==at 0x46D1A7: add_opt_func (s7.c:60763)
==11749==by 0x46D1A7: s7_set_i_ii_function (s7.c:60840)
==11749==by 0x6555990: libc_s7_init (in /home/jhearon/libc_s7.so)
==11749==by 0x4E2D61: load_shared_object (s7.c:30010)
==11749==by 0x4E2D61: load_shared_object (s7.c:29952)
==11749==by 0x4E319B: g_load (s7.c:30184)
==11749==by 0x47049E: op_c_ss (s7.c:91384)
==11749==by 0x47049E: eval.isra.0 (s7.c:93493)
==11749==by 0x4E385E: s7_load_with_environment (s7.c:30130)
==11749==by 0x4E3B2A: g_require (s7.c:30472)
==11749==by 0x487596: apply_c_macro (s7.c:86109)
==11749==by 0x46E172: eval.isra.0 (s7.c:94049)
==11749==by 0x4E385E: s7_load_with_environment (s7.c:30130)
==11749==by 0x6864A8: snd_doit (snd-nogui.c:724)
==11749==by 0x422699: main (snd.c:629)
==11749==  Address 0x180001c9 is not stack'd, malloc'd or (recently) free'd
==11749==
==11749==
==11749== Process terminating with default action of signal 11 (SIGSEGV): 
dumping core
==11749==  Access not within mapped region at address 0x180001C9
==11749==at 0x46D1A7: add_opt_func (s7.c:60763)
==11749==by 0x46D1A7: s7_set_i_ii_function (s7.c:60840)
==11749==by 0x6555990: libc_s7_init (in /home/jhearon/libc_s7.so)
==11749==by 0x4E2D61: load_shared_object (s7.c:30010)
==11749==by 0x4E2D61: load_shared_object (s7.c:29952)
==11749==by 0x4E319B: g_load (s7.c:30184)
==11749==by 0x47049E: op_c_ss (s7.c:91384)
==11749==by 0x47049E: eval.isra.0 (s7.c:93493)
==11749==by 0x4E385E: s7_load_with_environment (s7.c:30130)
==11749==by 0x4E3B2A: g_require (s7.c:30472)
==11749==by 0x487596: apply_c_macro (s7.c:86109)
==11749==by 0x46E172: eval.isra.0 (s7.c:94049)
==11749==by 0x4E385E: s7_load_with_environment (s7.c:30130)
==11749==by 0x6864A8: snd_doit (snd-nogui.c:724)
==11749==by 0x422699: main (snd.c:629)
==11749==  If you believe this happened as a result of a stack
==11749==  overflow in your program's main thread (unlikely but
==11749==  possible), you can try to increase the size of the
==11749==  main thread stack using the --main-stacksize= flag.
==11749==  The main thread stack size used in this run was 8388608.
==11749==
==11749== HEAP SUMMARY:
==11749== in use at exit: 11,644,308 bytes in 2,671 blocks
==11749==   total heap usage: 3,392 allocs, 721 frees, 11,951,327 bytes 
allocated
==11749==
==11749== LEAK SUMMARY:
==11749==definitely lost: 0 bytes in 0 blocks
==11749==indirectly lost: 0 bytes in 0 blocks
==11749==  possibly lost: 933,221 bytes in 1,939 blocks
==11749==still reachable: 10,711,087 bytes in 732 blocks
==11749== suppressed: 0 bytes in 0 blocks
==11749== Rerun with --leak-check=full to see details of leaked memory
==11749==
==11749== For lists of detected and suppressed errors, rerun with: -s
==11749== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)



___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 141, Issue 2

2020-02-23 Thread James Hearon
Re: CM, Grace, JUCE Fedora31

I rechecked my JUCE dependencies, thanks Frank Sergi, but all was ok.  I spent 
several days dialing around with different versions of juce and cm.  Still no 
joy.
I think the current problem on Fedora is with gcc/g++ 9.  It complains about 
the PixelRGB problem.  Guess I'll wait a bit for things to catch up with the 
compilers.
Regards,
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Saturday, February 22, 2020 8:00 PM
To: cmdist@ccrma.Stanford.EDU 
Subject: Cmdist Digest, Vol 141, Issue 2

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. cm grace 3.10.3 (James Hearon)


--

Message: 1
Date: Fri, 21 Feb 2020 22:12:12 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] cm grace 3.10.3
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
I'm wondering about compiling cm, grace on fedora31.  I'm having trouble 
getting thru the juce modules.

make[1]: *** [Grace.make:209: obj/Grace/Debug/juce_audio_processors.o] Error 1

I've tried using 3.10.3 srcs for deprecated juce calls, but still not able to 
get thru the compile.

Thank you,
Jim
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20200221/72b4d147/attachment-0001.html>

--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 141, Issue 2
**

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] cm grace 3.10.3

2020-02-21 Thread James Hearon
Hi,
I'm wondering about compiling cm, grace on fedora31.  I'm having trouble 
getting thru the juce modules.

make[1]: *** [Grace.make:209: obj/Grace/Debug/juce_audio_processors.o] Error 1

I've tried using 3.10.3 srcs for deprecated juce calls, but still not able to 
get thru the compile.

Thank you,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] snd 20.0

2020-01-08 Thread James Hearon
Hi,
I'm getting a new error on CM_patterns.scm I haven't seen before. I upgraded to 
f31, snd20.0 recently.
I could have missed something in all that and will double ck.
>define-record-type: unbound variable
"/opt/snd-20/CM_patterns.scm"[189]: (define-record-type)
  Regards,
  Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] Cmdist Digest, Vol 133, Issue 2

2019-06-10 Thread James Hearon
Hi,
re: Circular-Scanned bracket error.  It was my fault.  Sorry.
It's been a while since I've been in CLM-5, since mostly using scheme w/emacs.

I forgot from emacs the M - x, slime-compile-and-load-file command is only 
useful for .lisp file, not .ins file.
Although I can Ctrl -x Ctrl - f, load the .ins, it gives an unmatched bracket 
error (below) at  the beginning of definstrument if trying to run M - x, 
slime-compile-and-load-file.

I needed to rename the .ins to .lisp, then it goes thru fine.

...BTW, I have a small side project to try to convert that very cool .ins to 
scheme using the dotimes, and
setf! macros from Bill's scheme, but still getting hung up in the run loop 
which is quite tricky.  Be good sometime if it could make it over to a .scm 
file.  Be glad to share what I have so far.

Thank You folks,
Jim

-
Loading /opt/quicklisp/slime-helper.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading /opt/quicklisp/slime-helper.el (source)...done
Polling "/tmp/slime.3011" .. 1 (Abort with ‘M-x slime-abort-connection’.)
Polling "/tmp/slime.3011" .. 2 (Abort with ‘M-x slime-abort-connection’.)
Polling "/tmp/slime.3011" .. 3 (Abort with ‘M-x slime-abort-connection’.)
Polling "/tmp/slime.3011" .. 4 (Abort with ‘M-x slime-abort-connection’.)
Connecting to Swank on port 45805..
Connected. Let the hacking commence!
Mark set
user-error: Unmatched bracket or quote
mwheel-scroll: Beginning of buffer [3 times]
Mark set
---
(definstrument circular-scanned (start dur freq amp ...



From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Saturday, June 8, 2019 7:00 PM
To: cmdist@ccrma.Stanford.EDU
Subject: Cmdist Digest, Vol 133, Issue 2

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. Re: circular-scanned.ins (b...@ccrma.stanford.edu)
   2. Re: circular-scanned.ins (Juan I Reyes)


--

Message: 1
Date: Fri, 07 Jun 2019 12:10:33 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] circular-scanned.ins
Message-ID: <99004149c9b10e9a1fc102a560eb3...@ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

What lisp are you running?  In sbcl (in a terminal) it seems to be ok:

/home/bil/clm/ /home/bil/test/sbcl-1.5.3/src/runtime/sbcl --core
/home/bil/test/sbcl-1.5.3/output/sbcl.core
[...]
* (load "all.lisp")
;   using existing configuration file mus-config.h

;loading /home/bil/clm/clm-package.fasl
;loading /home/bil/clm/initmus.fasl
;loading /home/bil/clm/sndlib2clm.fasl
;loading /home/bil/clm/defaults.fasl
;loading /home/bil/clm/ffi.fasl
;loading /home/bil/clm/mus.fasl
;loading /home/bil/clm/run.fasl
;loading /home/bil/clm/sound.fasl
;loading /home/bil/clm/defins.fasl
;loading /home/bil/clm/env.fasl
;loading /home/bil/clm/export.fasl
;loading /home/bil/clm/clm1.fasl
T
* (compile-file "scanned.ins")
; Writing "/home/bil/clm/clm_SCANNED.c"
; Compiling "/home/bil/clm/clm_SCANNED.c"
; Creating shared object file "/home/bil/clm/clm_SCANNED.so"

; file: /home/bil/clm/scanned.ins
; [...]
; compilation unit finished
;   caught 6 STYLE-WARNING conditions
#P"/home/bil/clm/scanned.fasl"
T
NIL
* (load "scanned")
T
* (with-sound () (scanned 0 1 435 .01))
"test.snd"



--

Message: 2
Date: Fri, 07 Jun 2019 13:33:27 -0700
From: Juan I Reyes 
To: cmdist@ccrma.Stanford.EDU
Subject: Re: [CM] circular-scanned.ins
Message-ID: <9f1df445ef306ff20b445020e98a5...@ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

Hi James,

Same here. Just compiled and loaded  'circular-scanned.ins' on
sbcl-1.4.6-2 on FC-29 Linux. Also using slime. As far as indentation and
parens, I just use lisp-mode and font-lock-mode to toggle its use. My
CLM-5 tarball is from April 2019.


   -- Juan


CL-USER> (compile-file "/zap/circular-scanned.ins")
; compiling file "/zap/circular-scanned.ins" (written 07 JUN 2019
01:01:40 PM):
; compiling (DEFINSTRUMENT CIRCULAR-SCANNED ...)
; Writing "/zap/clm_CIRCULAR_SCANNED.c"
; Compiling "/zap/clm_CIRCULAR_SCANNED.c"
; Creating shared object file "/zap/clm_CIRCULAR_SCANNED.so"

; /zap/circular-scanned.fasl writ

[CM] Snd Edit envelope

2018-12-27 Thread James Hearon
Hi,

I haven't been able to view the waveform in Edit envelope for a while, and 
seems like I used to be able to see the waveform selection in the edit window.

I can see the breakpoint handles, and those are applied to the sound okay, but 
I'm just guessing a bit as to where the breakpoints should go without the 
visual feedback in the Edit envelope window.

I'm currently on Snd 18.9, fedora 29

...from Snd Help
s7: 7.6, Xen : 3.27
Alsa 1.1.6
Sndlib 24.7
CLM 6.19
GSL 2.4
Motif 2.3.4 X11R6
OpenGL 3.0 Mesa 18.2.6
Xpm 3.4.11

and my configure for building has been:
./configure  --with-s7 --with-gsl --with-motif --with-alsa

No GL in the configure statement.  I'm wondering if I need to add GL to see the 
waveform in Edit envelope?

Thank You,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] env->channel, and float-vector->channel

2018-09-07 Thread James Hearon
Hi,
Thank you for that info.  I understand now where I was getting confused re: 
float-vector->channel and see I need to adjust the vector size as I go.  Clear 
now.

Regards,
Jim

From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Thursday, September 6, 2018 7:00 PM
To: cmdist@ccrma.Stanford.EDU
Subject: Cmdist Digest, Vol 124, Issue 2

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. env->channel, and float-vector->channel (James Hearon)
   2. Re: env->channel, and float-vector->channel
  (b...@ccrma.stanford.edu)


--

Message: 1
Date: Thu, 6 Sep 2018 17:51:00 +
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] env->channel, and float-vector->channel
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
I'm having some confusion about successive edits using env->channel vs. 
float-vector->channel.  For example if I loop employing env-channel and a 
vector as an envelope, then I see the successive edits every 1k samples; but 
when I try to do that using float-vector->channel the spacing is squished.

Float-vector->channel works fine if I employ the vector as envelope across the 
whole snd., but I'm failing to understand how to employ it for successive 
back-to-back edits within the snd.

Thank you for Snd 18.7!

Regards,
Jim


(set! (mus-srate) 48000)

 (let*   ((mysize 8) ;size of vector for envelope pairs
 (fsize 48000) ;size of the snd
 (myvec (make-float-vector mysize))
 )
   (new-sound "test.snd" :size fsize)
(insert-silence 0 fsize)
 (map-channel (lambda (y) 0.5))

(float-vector-set! myvec 0 0.1);x1
(float-vector-set! myvec 1 0.5 );y1
(float-vector-set! myvec 2 0.5 );x2
(float-vector-set! myvec 3 1.0 );y2
(float-vector-set! myvec 4 0.75 );x3
(float-vector-set! myvec 5 -1.0 );y3
(float-vector-set! myvec 6 1.0 );x4
(float-vector-set! myvec 7 0.0 );y4

  (do ((i 0 (+ i 1000)))
((= i 24000))
(env-channel (make-env myvec :duration 0.015 :scaler 1.0) i 1000 0 0 )
;(float-vector->channel myvec i 1000 0) ;place float-vector in the editor ;XXX
))
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180906/c3da40cd/attachment-0001.html>

--

Message: 2
Date: Thu, 06 Sep 2018 11:30:10 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] env->channel, and float-vector->channel
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

You're talking about the length of each blip?  In the
env-channel case, the vector is treated as an envelope
and applied to .015 seconds of samples, but in the
float-vector->channel case, the vector itself is simply
copied into the file.  It only has 8 samples, so in the
float-vector->channel case, the blips are 8 samples wide,
rather than .015 * 48000 = 720 samples.

(By the way, I think you don't need the insert-silence
statement -- it just adds 48000 samples to the overall
file length).



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 124, Issue 2
**

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] env->channel, and float-vector->channel

2018-09-06 Thread James Hearon
Hi,
I'm having some confusion about successive edits using env->channel vs. 
float-vector->channel.  For example if I loop employing env-channel and a 
vector as an envelope, then I see the successive edits every 1k samples; but 
when I try to do that using float-vector->channel the spacing is squished.

Float-vector->channel works fine if I employ the vector as envelope across the 
whole snd., but I'm failing to understand how to employ it for successive 
back-to-back edits within the snd.

Thank you for Snd 18.7!

Regards,
Jim


(set! (mus-srate) 48000)

 (let*   ((mysize 8) ;size of vector for envelope pairs
 (fsize 48000) ;size of the snd
 (myvec (make-float-vector mysize))
 )
   (new-sound "test.snd" :size fsize)
(insert-silence 0 fsize)
 (map-channel (lambda (y) 0.5))

(float-vector-set! myvec 0 0.1);x1
(float-vector-set! myvec 1 0.5 );y1
(float-vector-set! myvec 2 0.5 );x2
(float-vector-set! myvec 3 1.0 );y2
(float-vector-set! myvec 4 0.75 );x3
(float-vector-set! myvec 5 -1.0 );y3
(float-vector-set! myvec 6 1.0 );x4
(float-vector-set! myvec 7 0.0 );y4

  (do ((i 0 (+ i 1000)))
((= i 24000))
(env-channel (make-env myvec :duration 0.015 :scaler 1.0) i 1000 0 0 )
;(float-vector->channel myvec i 1000 0) ;place float-vector in the editor ;XXX
))
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] set! samples

2018-06-20 Thread James Hearon


Hi,
Thank you.  I think I get it now.
I was thinking "i" was smarter about values while going thru the do  loop, or 
was was keeping track somehow of all values, not just the increment.  But it 
seems to only know about values of the increment.  I think I can fix it now.
Regards,
Jim


From: cmdist-boun...@ccrma.stanford.edu  on 
behalf of cmdist-requ...@ccrma.stanford.edu 
Sent: Tuesday, June 19, 2018 7:00 PM
To: cmdist@ccrma.Stanford.EDU
Subject: Cmdist Digest, Vol 122, Issue 1

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. set! samples (James Hearon)
   2. Re: set! samples (b...@ccrma.stanford.edu)


--

Message: 1
Date: Tue, 19 Jun 2018 18:02:31 +0000
From: James Hearon 
To: "cmdist@ccrma.Stanford.EDU" 
Subject: [CM] set! samples
Message-ID:



Content-Type: text/plain; charset="iso-8859-1"

Hi,
I get a crash that I cannot seem to understand with the following code.  In the 
do loop when I set the test to (= i 40400) I get a squarish-wave in the editor; 
but when I set it to 40500 or above  I get an endless loop and a crash.

I was trying to create a 2 sec. test.snd, then write the samples to the editor 
to fill out the 2 sec. or 44100 samples if sr is 22050, but I must be doing 
something wrong.


(set! *clm-srate* 22050)

  (let* ((dur (* *clm-srate* 2))
(ind (new-sound "test.snd" 1 *clm-srate* mus-ldouble mus-riff :size 
dur))
(v1 (make-float-vector 100 .75))
(v2 (make-float-vector 98 -.5))
)
  (do ((i 0 (+ i 200)))
  ((= i 40400))  ;xxx 40400 works, but 40500 crashes
   (set! (samples i (+ i 100)) v1)
   (set! (samples (+ i 101) (+ i 199)) v2)
  )
)
-- next part --
An HTML attachment was scrubbed...
URL: 
<https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180619/9abfc7c8/attachment-0001.html>

--

Message: 2
Date: Tue, 19 Jun 2018 11:21:30 -0700
From: b...@ccrma.stanford.edu
To: James Hearon 
Cc: "cmdist@ccrma.Stanford.EDU" 
Subject: Re: [CM] set! samples
Message-ID: 
Content-Type: text/plain; charset=US-ASCII; format=flowed

At first glance, "i" never equals 40500 -- you're
stepping by 200.  Use (>= i 40500) or (= i 40600).
Since the end test is never true, you probably
run out of memory eventually.



--

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 122, Issue 1
**

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] set! samples

2018-06-19 Thread James Hearon
Hi,
I get a crash that I cannot seem to understand with the following code.  In the 
do loop when I set the test to (= i 40400) I get a squarish-wave in the editor; 
but when I set it to 40500 or above  I get an endless loop and a crash.

I was trying to create a 2 sec. test.snd, then write the samples to the editor 
to fill out the 2 sec. or 44100 samples if sr is 22050, but I must be doing 
something wrong.


(set! *clm-srate* 22050)

  (let* ((dur (* *clm-srate* 2))
(ind (new-sound "test.snd" 1 *clm-srate* mus-ldouble mus-riff :size 
dur))
(v1 (make-float-vector 100 .75))
(v2 (make-float-vector 98 -.5))
)
  (do ((i 0 (+ i 200)))
  ((= i 40400))  ;xxx 40400 works, but 40500 crashes
   (set! (samples i (+ i 100)) v1)
   (set! (samples (+ i 101) (+ i 199)) v2)
  )
)
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] txt file I/O

2018-04-26 Thread James Hearon
  Hi,
I'm having trouble trying to figure out how to write samples as txt to a file.  
I have it working to the console, in emacs, but I can't seem to find the magic 
to save it to a file.  Hoping I could get some help.  Most of my efforts only 
result in saving .snd file to disk.  I'm trying to get just txt.
Thank You.

(let ((gen (make-file->sample "myMono.wav"))
  (v0 (make-float-vector 128)) )
  (do ((i 0 (+ i 1)))
  ((= i 128))
(set! (v0 i) (file->sample gen i) )
 (format #t "~%~F: file->sample output:  ~F" i (v0 i) ) ) )



___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] map-channel with dsp

2018-02-09 Thread James Hearon
Hi,

I'm really stuck on trying to use map-channel to replace a newly created snd 
file with a dsp modified version of it.  I've been looking at snd-test.scm for 
examples but still don't have it right yet and not sure how to craft the 
let/map-channel/lambda to make it work.  All I get is a flat line so far.

I'm trying to place values in a float-vector, then modify those values and 
output to the editor.  I know

(float-vector->channel im 0 fsize 0) works,

and I also tried sample (but very slow):

 (do ((i 0 (+ i 1)))

  ((= i fsize))

  (set! (sample i) (im i)))

Wondering if there's an example someplace I haven't found yet for how to 
dsp modify a vector of values and use map-channel to output to the editor?


Thank You,

Jim


I’ve been trying something like below…

but cannot seem to get the map-channel/let/lambda part right.



  (let*  ((fsize 22050)

 (increment (/ (* 440.0 2.0 pi) fsize))

 (im (make-float-vector fsize)) ;empy vector

 (current-phase 0.0)

 (val 0.0) );init var

  (new-sound "test.snd" :size fsize)  ;creates a new snd in editor

;place values in a vector

   (do ((i 0 (+ i 1)))

  ((= i fsize))

   (set! val (* .1 (sin current-phase)))

   (set! current-phase (+ current-phase increment))

   (set! (im i) val)

;(format #t "~%i: ~F  ~0,6F\t " i (im i) )

  )

  (map-channel (lambda (y)

  (do ((i 0 (+ i 1)))

  ((= i fsize))

  (* (amplitude-modulation 0.5) (im i0 fsize))

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] patterns snd-18

2018-01-17 Thread James Hearon
Hi,
Congratulations on Snd vers. 18.

I'm getting a load error on CM_patterns.scm, from emacs.

(load "/opt/snd-18/CM_patterns.scm")

>load: can't open "r7rs.scm"
"/opt/snd-18/CM_patterns.scm"[11]: (require r7rs.scm)

I've grepped around trying to see if I still have a snd-17 label stuck 
someplace but haven't found that yet.  Seems to load ok from listener however.  
It could just be me doing something wrong.

Regards,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] generators

2017-12-11 Thread James Hearon
Hi,
I've been using the generators in generators.scm for a while, and enjoy making 
sound with them, but for the life of me I cannot seem to understand how they 
work.  I'm confused about the lambda part and the use of fm.  What is fm doing? 
 I'd be grateful if someone could explain that.

Such as in nxycos, It seems like (set! angle (+ angle fm frequency)) is 
critical, but is (+ angle fm frequency), simply the sum of those variables, 
such as (+  3 1 2), > 6? Or does the fm part contribute to the radians value of 
angle in some other way in that bit of code.  I've tried using display and 
formatted output to look at output values such as x, y, den, angle in radians 
in lambda, but nothing is really making sense to me yet.  I've also 
experimented with input of different values and viewing the fft outputs to see 
the frequency in hz, ratio, n, and also angle or phase start in the waveform 
view of snd.

For ex. if I do something like:
 ...
   (outa i (* .5 (nxycos gen 0.1))
such as adding a value for fm, then the frequency really takes off, so I'm not 
sure I'm understanding what fm does in the generator or how it's supposed to be 
used.

Thank you,
Jim



(defgenerator (nxycos :make-wrapper convert-frequency)

  (frequency 0.0) (ratio 1.0) (n 1) (angle 0.0) fm)


(define nxycos


  (let ((+documentation+ "(make-nxycos frequency (ratio 1.0) (n 1)) creates an 
nxycos generator. (nxycos gen (fm 0.0))

returns n cosines from frequency spaced by frequency * ratio."))


(lambda* (gen (fm 0.0))

  (let-set! gen 'fm fm)

  (with-let gen

(let* ((x angle)

  (y (* x ratio))

  (den (sin (* y 0.5

  (set! angle (+ angle fm frequency))

  (if (< (abs den) nearly-zero)

  1.0

  (/ (* (cos (+ x (* 0.5 (- n 1) y)))

(sin (* 0.5 n y)))

(* n den ; n=normalization


#|

(with-sound (:clipped #f :statistics #t :play #t)

  (let ((gen (make-nxycos 300 1/3 3)))

 (do ((i 0 (+ i 1)))

((= i 2))

   (outa i (* .5 (nxycos gen))

|#


___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] sndplay, snd 17.6

2017-07-11 Thread James Hearon
Hi,

I haven't been able to 'make' sndplay for a little while.  Seems it's looking 
for sndlib or CLM headers.  Wondering if it's something I'm doing different?

Regards,

Jim



io.o: In function `mus_read_any_1':
io.c:(.text+0xfde): undefined reference to `mus_copy_floats'
io.c:(.text+0xffb): undefined reference to `mus_clear_floats'
io.c:(.text+0x1e9b): undefined reference to `mus_clear_floats'
io.c:(.text+0x1fce): undefined reference to `mus_copy_floats'
io.c:(.text+0x1fec): undefined reference to `mus_clear_floats'
io.o: In function `mus_file_read':
io.c:(.text+0x3af0): undefined reference to `mus_clear_floats'
io.o: In function `mus_file_read_chans':
io.c:(.text+0x3b77): undefined reference to `mus_clear_floats'
collect2: error: ld returned 1 exit status
makefile:155: recipe for target 'sndplay' failed
make: *** [sndplay] Error 1

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] make-pvocoder

2017-05-25 Thread James Hearon
Hi,

I'm working thru snd make-pvocoder, clm make-phase-vocoder trying to find more 
info on the analyze, edit, and synthesize methods, such as the one below the 
manual which shows a lambda func for the synthesis or resynthesis method.  Most 
of what I've been able to find is based on a gen from readin of a file or input 
samples to access spectral data.   I know this is a bit odd, but I was trying 
to create designer spectra, by filling empty vectors with various numbers etc, 
as opposed to getting the data from a readin generator.  So far mine just 
sounds like noise, so I don't have it quite right.  I'm wondering if I'm on the 
right track by using original vectors in the analyze, edit, and synthesize 
methods.  Or maybe I should just be creating sound files using something like 
infinite sums, for example, and sticking with the readin generator to analyze 
those sounds?  I've looked at at the moving-spectrum and pins insts too.


Thank you,

Jim

(with-sound (:srate 22050 :statistics #t)
  (let ((pv (make-phase-vocoder
 (make-readin "oboe.snd")
 512 4 128 1.0
 #f ; no change to analysis method
 #f ; no change to spectrum
 (lambda (gen) ; resynthesis function
   (float-vector-add! (phase-vocoder-amps gen) 
(phase-vocoder-amp-increments gen))
   (float-vector-add! (phase-vocoder-phase-increments gen) 
(phase-vocoder-freqs gen))
   (float-vector-add! (phase-vocoder-phases gen) 
(phase-vocoder-phase-increments gen))
   (let ((sum 0.0)
 (n (length (phase-vocoder-amps gen
 (do ((k 0 (+ k 1)))
 ((= k n))
   (set! sum (+ sum (* (float-vector-ref (phase-vocoder-amps 
gen) k)
   (sin (* 0.5 (float-vector-ref 
(phase-vocoder-phases gen) k)))
 sum)
(do ((i 0 (+ i 1)))
((= i 44100))
  (outa i (phase-vocoder pv)




(with-sound (:reverb nrev :srate 48000 :channels 2 :header-type  mus-riff 
:statistics #t :output "/myTest.wav" :play #t )
  (let* ((samps (* 2 (mus-sound-framples "/Sample1.wav")))
 (hop 512)
 (jsampvec (make-float-vector hop))  ;create empty vectors
 (jsampincvec (make-float-vector hop))
 (jsfreqvec (make-float-vector hop))
 (jsphasevec (make-float-vector hop))
 (jsphaseincvec (make-float-vector hop))
 (pv (make-phase-vocoder
 (make-readin "/Sample1.wav")
 512 4  128  1.75;fft-size, overlap, interp, pitch
  #f ; no change to analysis
 #f ; no change to edit
 (lambda (gen) ; *attempt resynthesis function*
  (do ((i 0 (+ i 1)))
  ((= i hop))
  (set! (jsampvec i) (mus-random .02) ) ;fill vectors with 
numbers
  (set! (jsampincvec i) (mus-random .05) )
  (set! (jsfreqvec i) (mus-random 500) )
  (set! (jsphasevec i) (mus-random 360) )
  (set! (jsphaseincvec i) (mus-random .02) )
  ) ;end do

   (float-vector-add! jsampvec jsampincvec)  ;add the vectors
   (float-vector-add! jsphaseincvec  jsfreqvec)
   (float-vector-add! jsphasevec  jsphaseincvec)

   (let ((sum 0.0)
 (n hop))
 (do ((k 0 (+ k 1)))
 ((= k n))
   (set! sum (+ sum (* (jsampvec k)(sin (* 0.5 (jsphasevec k)) ;create 
waveform
   )
 sum)
 )))
(do ((i 0 (+ i 1)))
   ((= i samps))
  (outa i (* 4 (phase-vocoder pv)))
  (outb i (* 4 (phase-vocoder pv)))
  )))

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] s7 wrap c function with scheme

2017-03-01 Thread James Hearon
Hi,
The wrapper example below works great.  Seems like -DWITH_MAIN, and -DUSE_SND=0 
adds some special help.  Thanks so much for that info.

I'm moving on also to look at cload.scm now, but confused about the s7 manual 
example compile lines which shows an "ex1.c".  I wasn't clear about what is 
ex1.c, or maybe my brain is just not reading the cload example correctly.

gcc -c s7.c -I.
gcc -o ex1 ex1.c s7.o -lm -I. -ldl -Wl,-export-dynamic
ex1
> (load "cload.scm")
...

Regards,
Jim
---
gcc -fpic -c add1.c
gcc -shared -Wl,-soname,libadd1.so -o libadd1.so add1.o -lm -lc
gcc s7.c -o repl -fpic -DWITH_MAIN -I. -ldl -lm -Wl,-export-dynamic -DUSE_SND=0

>./repl
   > (load "libadd1.so" (inlet 'init_func 'add1_init))
   > (add1 2)


#include 
#include "s7.h"

static s7_pointer add1(s7_scheme *sc, s7_pointer args)
{
   if (s7_is_integer(s7_car(args)))
 return(s7_make_integer(sc, 1 + s7_integer(s7_car(args;
   return(s7_wrong_type_arg_error(sc, "add1", 1, s7_car(args), "an integer"));
   }

void add1_init(s7_scheme *sc);
void add1_init(s7_scheme *sc)
{
   s7_define_function(sc, "add1", add1, 1, 0, false, "(add1 int) adds 1 to 
int");
   }

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] s7 wrap c func with scheme

2017-02-24 Thread James Hearon
Hi,

I had a question about wrapping a c func with scheme, s7.

I'm trying to understand how to wrap the declared function from the .h file 
with scheme in a .scm file (mywrapper.scm) so that it can be called from s7 and 
use the shared library.

> (load mywrapper.scm)
> (myfunction)
> (exit)


I have a .c file which includes a function (myfunction), and .h which declares 
that function.
I compile the .c file using -fpic into an obj. file, then create a shared 
library, ex. mylib.so.

I'm looking at SND files libc.scm and libgsl.scm which seem to be wrappers, but 
are quite complicated.  I'm also looking at the S7 manual example for "Load a 
shared library", but there are static s7_pointer functions in the example's c 
code which seem to be doing the wrapping on the c side as opposed to wrapping a 
c function in scheme using a .scm file.

I'm wondering if there's a simpler example somplace where I can get some ideas 
about how to go about wrapping a c function in scheme, or if the manual vers. 
is the preferred way to go, i.e. create a library using s7 functions from c, 
and then load the library into s7 to call the function?

Regards,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] starting cm2

2017-01-26 Thread James Hearon
Hi,

I'm having a devil of a time trying to start cm2 on f25, using SBCL and 
Quicklisp, and wondering if anyone might know where I'm going wrong.  Quicklisp 
has the asdf libraries.  CM2 top level dir shows a cm2.asd, so I'm confused 
what might be going wrong.


>From SBCL, I get an .asd file error.

> * (load "/opt/cm2/src/cm.lisp")

debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
#:
  Couldn't load #P"/opt/cm2/cm.asd": file does not exist.


I downloaded the cm2 branch using svn, and have the following in my .sbclrc 
file for starting sbcl.


;;; The following lines added by ql:add-to-init-file:
#-quicklisp
(let ((quicklisp-init #P"/opt/quicklisp/setup.lisp"))
  (when (probe-file quicklisp-init)
(load quicklisp-init)))

(require "asdf")

;;; Load Common Music.
(push "/opt/cm2/" asdf:*central-registry*)
(asdf:load-system :cm2)

This compiles and creates several cm2 .fasl files on startup of sbcl and puts 
them in the sbcl hidden .cache dir in /home.

Thank you,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] numerics

2016-12-05 Thread James Hearon
Hi,

Strange about delayed email.


Thank you for info on snd-test.scm re: legendre-polynomial.  I see now, first 
argument is a vector, so all is working now in numerics.scm


Regards,

Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] numerics.scm

2016-12-01 Thread James Hearon

Hi,

For numerics.scm, these seem useful.  Most of them I can evaluate, but the four 
polynomials (xxx) I cannot seem to figure what it wants.  Wondering if anyone 
might have success or ideas about those guys?


Thank You,

Jim

(load "snd-16/numerics.scm")

(factorial 6) -> 720
(binomial 4 2) -> 6
(n-choose-k 10 2) ->45
(plgndr 6 .2 -1) ->2.261952
(legendre-polynomial 1 4);XXX -> argument 1, #f, is boolean but should be a 
number
(legendre 3 4) ->154.0
(gegenbauer 3 4) -> 0.5625693058216614
(chebyshev-polynomial 2 4)  ;XXX -> argument 1, #f, is boolean but should be a 
number
(chebyshev 2 4) -> 31.0
hermite-polynomial 1 3)  ;XXX -> argument 1, #f, is boolean but should be a 
number
(hermite 1 3) ->6.0
(laguerre-polynomial 3 1)  ;XXX -> argument 1, #f, is boolean but should be a 
number
(laguerre 1 4 ) -> -3.0
(Si 10)->1.658347864640153
(Ci 10)->-0.04545628800337046
(sin-m*pi/n 1 9) ->(let ((ex (sqrt 3/4))) (/ (- (expt (+ (sqrt (- 1 (* ex ex))) 
(* 0+1i ex)) (/ 1 3)) (expt (- (sqrt (- 1 (* ex ex))) (* 0+1i ex)) (/ 1 3))) 
0+2i))
(show-digits-of-pi-starting-at-digit 2.0)->
 position = 2.00e+00
 fraction = 1.247719318987069
 hex digits =  "3F6A8885A3   "
" position = 2.00e+00
 fraction = 1.247719318987069
 hex digits =  \"3F6A8885A3   \"
"


___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


Re: [CM] s7, undefined reference errors

2016-09-20 Thread James Hearon
Hi,

snd configure...

./configure  --with-s7 --with-gsl --with-motif --with-gl --with-gmp --with-alsa 
CFLAGS=HAVE_COMPLEX_NUMBERS CFLAGS=HAVE_COMPLEX_TRIG 
CFLAGS="-I/usr/include/linux/param.h"


Oops, I guess I did compile with gimp.  I'm not sure why I did that.  Must have 
been something I was trying to see perhaps related to gl.  Thanks so much for 
pointing out that problem.


re: all my compile times are usually over a minute, but I've been using lots of 
lets set!, and patterns, so I figured that was it.  I'll recompile snd without 
gimp and see how that goes.


Regards,

Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] s7, undefined reference errors

2016-09-19 Thread James Hearon
Hi,

I was trying to get back to looking at s7 as interpreter but I'm failing to 
compile for some reason.


I have s7.o, s7.h, and snd is working ok.  But I'm getting undefined ref errors 
trying to compile below and a little stumped what might be going wrong?  Seems 
like it's not finding something it needs.


//gcc -o repel_test repel_test.c s7.o  -Wl,-export-dynamic -lm -I. -ldl
#include "/opt/snd-16/s7.h"
int main (int argc, char **argv)
{
s7_scheme *sc;
sc = s7_init();
s7_load(sc, "/opt/snd-16/repl.scm");
s7_eval_c_string(sc, "((*repl* 'run))");
return(0);
}

-

/opt/snd-16/s7.o: In function `sweep':
s7.c:(.text+0x1b40): undefined reference to `__gmpz_clear'
s7.c:(.text+0x1bdf): undefined reference to `__gmpq_clear'
s7.c:(.text+0x1c7e): undefined reference to `mpfr_clear'
s7.c:(.text+0x1d1d): undefined reference to `mpc_clear'
/opt/snd-16/s7.o: In function `s7_number_to_real_with_caller':
s7.c:(.text+0x1e272): undefined reference to `mpfr_get_d'
/opt/snd-16/s7.o: In function `s7_real':
s7.c:(.text+0x1e470): undefined reference to `mpfr_get_d'
/opt/snd-16/s7.o: In function `s7_is_negative':
s7.c:(.text+0x1e956): undefined reference to `mpfr_sgn'
/opt/snd-16/s7.o: In function `s7_is_positive':
s7.c:(.text+0x1ea20): undefined reference to `mpfr_sgn'
/opt/snd-16/s7.o: In function `s7_real_part':
...
/opt/snd-16/s7.o: In function `s7_random':
s7.c:(.text+0x12e539): undefined reference to `mpfr_get_d'
/opt/snd-16/s7.o: In function `s7_gmp_init':
s7.c:(.text+0x12f864): undefined reference to `mpfr_set_default_prec'
/opt/snd-16/s7.o: In function `s7_init':
s7.c:(.text+0x13efa2): undefined reference to `__gmpz_init_set_ui'
s7.c:(.text+0x13efb5): undefined reference to `__gmp_randinit_default'
s7.c:(.text+0x13efd2): undefined reference to `__gmp_randseed'
s7.c:(.text+0x13efe1): undefined reference to `__gmpz_clear'
collect2: error: ld returned 1 exit status


Regards,
Jim


___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] scheme, larger structures

2016-08-22 Thread James Hearon


anders wrote...

You can take the body of each of your two with-sound calls and place
within one single with-sound:

(let ((var '())
  (aaa (make-heap '(360 800.345 1200 600))) ;freq
  (bbb (make-cycle '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) ;dur
  (ccc (make-heap '(241 840.345 1000 960 500))) ;freq
  (ddd (make-cycle '(.2 1.25 .75 .25 .20 .15 .10 .10 .50 .10 .50))) ;dur
  )
  (with-sound (:reverb nrev :output "Test1.wav" :srate 48000 :channels 2
   :header-type mus-riff :statistics #t :play #t)

  ;; BODY OF CALL 1:

  (let ((i 0))
(do ((k 0 (+ k 1)))
((>= k 25))
  (let ((v (next bbb)))
(examp1 i v (next aaa) .3)
(set! i (+ (round-off i 2) v)

  ;; BODY OF CALL 2:

  (let ((j 1))
(do ((k 0 (+ k 1)))
((>= k 25))
  (let ((v (next ddd)))
(examp2 j v (next ccc) .1)
(set! j (+ (round-off j 2) v)))

I'm 100% sure what you want to do is possible.  If the above doesn't
come close, please try to be more explicit as to what you want to
achieve, perhaps detail in words.

Cheers,

-anders

--

Hi,
Yes, this is coming along better now.  Bill gave me a couple of pointers too.
I'm finding myself using Snd more for help with composing than audio editing 
these days,
but takes a while to get used to scheme.

Regards,
Jim

(load "/opt/snd-16/CM_patterns.scm")

(define (round-off z n)
  (let ((power (expt 10 n)))
(/ (round (* power z)) power)))

(definstrument (examp1 start-time duration frequency amplitude)
(let* ((beg (seconds->samples start-time))
(end (+ beg (seconds->samples duration)))
(sine-wave (make-oscil :frequency frequency)))
(do ((i beg (+ i 1)))
((= i end))
(let ((x (* amplitude (oscil sine-wave
(outa i x)
(outb i x)

(definstrument (examp2 start-time duration frequency amplitude)
(let* ((beg (seconds->samples start-time))
   (end (+ beg (seconds->samples duration)))
   (gen (make-polywave :frequency frequency :partials '(1 1.69 3 5
(do ((i beg (+ i 1)))
((= i end))
(let ((x (* amplitude (polywave gen
(outa i x)
(outb i x) 

(let ((aaa (make-heap '(360 800.345 1200 600))) ;freqs
  (bbb (make-cycle '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) ;durs
  (ccc (make-heap '(500 440 880 1620 591.23))) ;freqs
  (ddd '(600 700 800 900) ) ;just freqs, no pattern
  (eee (make-cycle '(.2 1.25 .75 .25 .20 .15 .10 .10 .50 .10 .50))) ;durs
   (var1 '() )
   (var2 '() )
   )
  (set! var1 (append (next aaa #t) (next ccc #t) ))
  (set! var2 (append var1 ddd) )
   (let ((var3 (make-heap var1))
 (var4 (make-heap var2))
  )
(with-sound (:reverb nrev :output "/home/test.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
(let ((i 0))
 (do ((k 0 (+ k 1)))
   ((>= k 4))
  (let ((v (next bbb)))
(examp1 i v (next var3) .3)
(set! i (+ (round-off i 2) v))
)))

(let ((j 4))
 (do ((k 0 (+ k 1)))
   ((>= k 15))
  (let ((v (next eee)))
  (examp2 j v (next var4) .05)
(set! j (+ (round-off j 2) v))
)))
)))  ;;end of with-sound




___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] scheme, larger structures

2016-08-11 Thread James Hearon
Hi,


I had written about a scheme method to do something similar to CLM's with-mix
for larger compositional structures using multiple instruments and Bill had 
replied...

"If you want to concatenate several with-sounds into one,
just concatenate the instrument calls, with some variable
holding the section's start time."

I tried several ways to concatenate definstrument calls and place those with the
body of with-sound, but nothing seems to work.  It seems like ws.scm just wants
a direct call to a definstrument in the body part.

I gave up and tried concatenating with-sound blocks instead, and it works after 
a fashion but the
creation of separate audio files means those still have to be stitched together 
at some point.
At least this is getting closer to what I was after.


regards,

Jim


(load "/opt/snd-16/CM_patterns.scm")

(define (round-off z n)
  (let ((power (expt 10 n)))
(/ (round (* power z)) power)))

(definstrument (examp1 start-time duration frequency amplitude)
(let* ((beg (seconds->samples start-time))
(end (+ beg (seconds->samples duration)))
(sine-wave (make-oscil :frequency frequency)))
(do ((i beg (+ i 1)))
((= i end))
(let ((x (* amplitude (oscil sine-wave
(outa i x)
(outb i x)

(definstrument (examp2 start-time duration frequency amplitude)
(let* ((beg (seconds->samples start-time))
   (end (+ beg (seconds->samples duration)))
   (gen (make-polywave :frequency frequency :partials '(1 1.69 3 5
(do ((i beg (+ i 1)))
((= i end))
(let ((x (* amplitude (polywave gen
(outa i x)
(outb i x) 

(let ((var '())
  (aaa (make-heap '(360 800.345 1200 600))) ;freq
  (bbb (make-cycle '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) ;dur
  (ccc (make-heap '(241 840.345 1000 960 500))) ;freq
  (ddd (make-cycle '(.2 1.25 .75 .25 .20 .15 .10 .10 .50 .10 .50))) ;dur
  )
 (set! var (cons
(with-sound (:reverb nrev :output "Test1.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
(let ((i 0))
 (do ((k 0 (+ k 1)))
   ((>= k 25))
  (let ((v (next bbb)))
(examp1 i v (next aaa) .3)
(set! i (+ (round-off i 2) v))
  ;;end of with-sound
(with-sound (:output "Test2.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
(let ((j 1))
 (do ((k 0 (+ k 1)))
   ((>= k 25))
  (let ((v (next ddd)))
 (examp2 j v (next ccc) .1)
(set! j (+ (round-off j 2) v))
  ;;end of with-sound
) ;end var
) ;end set!
  var
  ) ;end let

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] Scheme, larger structures

2016-07-22 Thread James Hearon

Hi,

I had written about a scheme method to do something similar to CLM's with-mix
for larger compositional structures using multiple instruments and Bill had 
replied...

"If you want to concatenate several with-sounds into one,
just concatenate the instrument calls, with some variable
holding the section's start time."

I'm not sure I'm off in the right direction, but I tried to implement what Bill 
was suggesting and got stuck getting the instruments to read in the body of 
with-sound.  I tried a cons, let, string, and a vector on the instrument calls 
and couldn't get those to play in with-sound so I just put them in a pattern.  
The instrument calls seem to be getting thru when I print, but for some reason 
with-sound is not recognizing them.

Maybe I'm off on the wrong design here.

Any help, comments appreciated.

Regards,
Jim


(load "/opt/snd-16/CM_patterns.scm")

(define (round-off z n)
  (let ((power (expt 10 n)))
(/ (round (* power z)) power)))

(definstrument (examp1 start-time duration frequency amplitude)
(let* ((beg (seconds->samples start-time))
(end (+ beg (seconds->samples duration)))
(sine-wave (make-oscil :frequency frequency)))
(do ((i beg (+ i 1)))
((= i end))
(let ((x (* amplitude (oscil sine-wave
(outa i x)
(outb i x)

(definstrument (examp2 start-time duration frequency amplitude)
(let* ((beg (seconds->samples start-time))
   (end (+ beg (seconds->samples duration)))
   (gen (make-polywave 440.0 :partials '(1 1.69 3 5
(do ((i beg (+ i 1)))
((= i end))
(let ((x (* amplitude (polywave gen
(outa i x)
(outb i x) 

;sanity check
(with-sound (:output "/home/myTest.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
  (examp1 0 .5  480 .75)
  (examp2 1 .5  580 .07)
  (examp1 2 .5  380 .75)
)

(let ((aaa (make-heap '(360 800.345 1200 600))) ;freq
  (bbb (make-cycle '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) ;dur
  (ccc (make-heap '((examp1 i v (next aaa) .2) (examp2 i v (next aaa) .2) 
)))
  )
(with-sound (:reverb nrev :output "/home/myTest.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
(let ((i 0))
 (do ((k 0 (+ k 1)))
   ((>= k 25))
  (let ((v (next bbb)))
  ;(examp1 i v (next aaa) .2) ;works fine
;(format #t "~%next ccc:  ")
;(display (next ccc))
(next ccc) ; xxx not working
(set! i (+ (round-off i 2) v))
)






















___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] s7 and c

2016-05-19 Thread James Hearon


re: gcc -o repel_test repel_test.c s7.o -Wl, -export-dynamic -lm -I. -ldl

I think your problem is that you have a space
after -Wl, -- it'a all one argument:
-Wl,-export-dynamic
---
Yes.  Great.  Thank you.  I was stumped, but am now off and compiling.

Regards,
Jim




___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



[CM] s7 with c

2016-05-18 Thread James Hearon

Hi,

I'm stuck on figuring out compiling a simple s7 repel test in c.  I'm on fedora 
23.  I've tried a few different things but not sure what /usr/bin/ld error is 
trying to tell me.



gcc error:

/usr/bin/ld: cannot find : No such file or directory

//gcc -o repel_test repel_test.c s7.o -Wl, -export-dynamic -lm -I. -ldl

#include "/opt/snd-16/s7.h"

int main (int argc, char **argv)
{
s7_scheme *sc;
sc = s7_init();
s7_load(sc, "/opt/snd-16/repl.scm");
s7_eval_c_string(sc, "((*repl* 'run))");
return(0);
}


Regards,

Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] scheme move-locsig

2016-05-05 Thread James Hearon

Hi,
I couldn't come up with the magic to get a pan-env working across a heap of 
notes with move-locsig.  But I made a solution below by just passing degree 
only to the inst and controlling degree over the total duration of the heap 
from with-sound.  Not elegant, but it pans across the whole heap of notes.


(provide 'snd-nrev.scm)

(if (provided? 'snd)
(require snd-ws.scm)
(require sndlib-ws.scm))

(load "/opt/snd-16/CM_patterns.scm")

(define (round-off z n)
  (let ((power (expt 10 n)))
(/ (round (* power z)) power)))

(definstrument (myinst start-time duration frequency amplitude sampling-rate 
revamt distance degree )
  (let* ((beg (floor (* start-time sampling-rate)))
 (end (+ beg (floor (* duration sampling-rate
 (loc (make-locsig :degree degree :distance distance :reverb revamt))
 (sine-wave (make-oscil :frequency frequency)))
 (do ((i beg (+ i 1)))
 ((= i end))
 (let ((x (* amplitude (oscil sine-wave
   (locsig loc i x)
   (move-locsig loc degree distance)
   

(let ((aaa (make-heap '(360 800.345 1200 600))) 
  (bbb (make-heap '(1 1 .75 .25 .20 .15 .10 .10 .10 .10))) )
(with-sound (:reverb nrev :output "/home/MyTest.wav" :srate 48000 :channels 2
 :header-type mus-riff :statistics #t :play #t)
  (let ((i 0))
(let ((mypanenv (make-env '(0 90 5 0) :length 70))) ;not sure 
why length  works here instead of duration
   (do ((k 0 (+ k 1)))
   ((>= k 40))
   (let ((v (next bbb))) 
(myinst  i v  (next aaa) .9 48000  0.01  1.0  (mypanenv k)  ) 
;send degree to inst
(set! i (+ (round-off i 2) v))
  ) )
   


___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



[CM] Snd inf-snd.el

2016-03-11 Thread James Hearon
Hi,
I finally got Snd working as an emacs subjob with help from Micahel Scholz.  
Some of it had to do with the way the .emacs file was being called, which meant 
the load-path variable was not being completed properly.

It's neat to be able to load a .scm script, edit it, and hear and see the 
results in the Snd motif gui by controlling the code from emacs.

I've tried reading all the Snd documentation to figure out how you might load a 
.scm file in the lisp listener, edit it in the lisp listener, and evaluate it 
in the lisp listener, but I haven't yet found how you would do something like 
the inf-snd.el snd-scheme-mode to bind the usual key commands for use within 
the Snd lisp listener without writing your own listener.  I must be missing 
something important, someplace.

Regards,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



[CM] inf-snd.el

2016-03-02 Thread James Hearon


Message: 2
Date: Tue, 01 Mar 2016 10:36:06 -0800
From: b...@ccrma.stanford.edu
To: James Hearon <j_hea...@hotmail.com>
Cc: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU>
Subject: Re: [CM] snd inf-snd.el
Message-ID: <caf316ebccc321a198852dfd2cb3d...@ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

s7 doesn't know how to communicate with slime (or geiser), and it's not
Common Lisp, so loading quicklisp code, or running sbcl has no effect.
Snd can communicate with emacs through s7, forth, or ruby,
and inf-snd.el has instructions.  I use the built-in repls (and a
separate emacs); in that case you load a file with (load "a-file.scm"),
and evaluate s7 code by typing it at the prompt, just as in any
other repl.


Hi,
Thank you.  This is a bit clearer now.  Since I don't need slime, quicklisp or 
sbcl, then maybe just a separate
.emacs file is best approach than trying to combine everything into one .emacs 
startup file?  Or maybe I'm getting confused about .emacs vs. .el files somehow?

I've read inf-snd.el , but not sure I understand it all yet.

For my .emacs, and just the scheme part,  I tried below using the snd 
customization and extension example from 
Bill's ~/.xemacs/init.el shown in the snd html manual for the inf-snd.el part, 
and then tried loading a .scm file from emacs but nothing is happening so I 
don't think I'm there yet.

(setq load-path
  (append (list 
"/opt/snd-16"
)
  load-path))

(autoload 'run-snd-scheme   "inf-snd" "Start inferior Snd-Scheme process" t)
(autoload 'snd-scheme-mode  "inf-snd" "Load snd-scheme-mode." t)
(setq inf-snd-scheme-program-name "/opt/snd-16/snd")
(setq inf-snd-working-directory "/opt/snd-16/")
(setq inf-snd-index-path "/opt/snd-16/")

Regards,
Jim

___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



[CM] snd inf-snd.el

2016-03-01 Thread James Hearon

Hi,
I trying to get inf-snd.el going for more REPL with .scm files.  I'm just 
trying to load , edit, and evaluate a .scm file, and couldn't seem to figure 
out how to do that using the snd listener.  I have clm working with fedora, 
quicklisp, emacs, and slime, but not sure how to get inf-snd.el working for 
more REPL with .scm in snd.

I tried this from .emacs, but it doesn't find any inf-snd key bindings such as 
C-c C-l   snd-load-file, for ex.

(load (expand-file-name "/opt/quicklisp/slime-helper.el"))
(load (expand-file-name "/opt/snd-16/inf-snd.el"))
(setq inferior-lisp-program "/usr/bin/sbcl")

I'm wondering if anyone has experience with this similar environment and knows 
how to get it to run?  

Thanks,
Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist



[CM] dlocsig

2015-12-21 Thread James Hearon
Hi,

Thanks for info on dlocsig.lisp.   I managed to get the move-sound.ins working, 
and also the sinewave example.


I just did not understand dlocsig.lisp needed to be compiled and loaded before 
using it.  I thought it was loaded with all.lisp.


Regards,

Jim
___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] dlocsig example

2015-12-15 Thread James Hearon
Hi,
Thanks for the info on move-sound and move-it.  I'm trying to figure out how 
those work, and didn't know there was a dlocsig ex in clm.  

For the sinewave ex. listed earlier using dlocsig, I'm using f23, sbcl, emacs, 
clm and slime, and the error below is about can't handle DLOCSIG etc.  
Admittedly I'm not totally proficient at understanding the slime-repl output, 
so this may not be what you need.

Thank You.
Jim

Execution of a form compiled with errors.
Form:
  (DEFINSTRUMENT SINEWAVE
(START-TIME DURATION FREQ AMP  (AMP-ENV '(0 1 1 1))
 (PATH (MAKE-PATH :PATH '(-10 10 0 5 10 10
  (MULTIPLE-VALUE-BIND (DLOC BEG END)
  (MAKE-DLOCSIG :START-TIME START-TIME :DURATION DURATION :PATH PATH)
(LET* ((OSC (MAKE-OSCIL :FREQUENCY FREQ))
   (AENV (MAKE-ENV :ENVELOPE AMP-ENV :SCALER AMP)))
  (RUN
   (LOOP FOR I FROM BEG BELOW
 END
 DO (DLOCSIG DLOC I (* (ENV AENV) (OSCIL OSC
Compile-time error:
  (during macroexpansion of (DEFINSTRUMENT SINEWAVE
...))
the run macro can't handle DLOCSIG in (DLOCSIG DLOC I
   (* (ENV AENV) (OSCIL OSC)))
   [Condition of type SB-INT:COMPILED-PROGRAM-ERROR]

Restarts:
 0: [*ABORT] Return to SLIME's top level.
 1: [ABORT] abort thread (#)

Backtrace:
  0: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM 
# 
:TABLE #(447 # SB-IMPL::%DEFUN # NIL NIL)
  2: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) # T)
  3: (LOAD #P"/opt/clm_stuff/jsdlocsig.fasl" :VERBOSE NIL :PRINT NIL 
:IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
 --more--

(definstrument sinewave (start-time duration freq amp 
 
 (amp-env '(0 1 1 1))
 (path (make-path :path '(-10 10 0 5 10 10
  (multiple-value-bind (dloc beg end)
  (make-dlocsig :start-time start-time
:duration duration
:path path)
(let* ((osc (make-oscil :frequency freq))
   (aenv (make-env :envelope amp-env :scaler amp)))
  (run
   (loop for i from beg below end do
 (dlocsig dloc i (* (env aenv)(oscil osc


From: cmdist-boun...@ccrma.stanford.edu <cmdist-boun...@ccrma.stanford.edu> on 
behalf of cmdist-requ...@ccrma.stanford.edu <cmdist-requ...@ccrma.stanford.edu>
Sent: Monday, December 14, 2015 8:00 PM
To: cmdist@ccrma.Stanford.EDU
Subject: Cmdist Digest, Vol 92, Issue 2

Send Cmdist mailing list submissions to
cmdist@ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
cmdist-requ...@ccrma.stanford.edu

You can reach the person managing the list at
cmdist-ow...@ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. dlocsig example (James Hearon)
   2. Re: dlocsig example (b...@ccrma.stanford.edu)


--

Message: 1
Date: Mon, 14 Dec 2015 18:03:02 +
From: James Hearon <j_hea...@hotmail.com>
To: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU>
Subject: [CM] dlocsig example
Message-ID:

<blupr10mb0836ad6cf2c42ace43e86969e5...@blupr10mb0836.namprd10.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"


Hi,
I'm getting myself all fouled up with trying to run a simple dlocsig example in 
clm.  I was using this one, from
https://ccrma.stanford.edu/~nando/clm/dlocsig/

(definstrument sinewave (start-time duration freq amp
 
 (amp-env '(0 1 1 1))
 (path (make-path :path '(-10 10 0 5 10 10
  (multiple-value-bind (dloc beg end)
  (make-dlocsig :start-time start-time
:duration duration
:path path)
(let* ((osc (make-oscil :frequency freq))
   (aenv (make-env :envelope amp-env :scaler amp)))
  (run
   (loop for i from beg below end do
 (dlocsig dloc i (* (env aenv)(oscil osc

-
I can move the samples in time using plain locsig and the run loop below, 
binding the variables start and end,
but dlocsig seems  to need the multiple-bind structure which I can't seem to to 
get to run.  I'm wondering if there's a better simple example someplace?  Thank 
You.

(definstrument sinewave (start-time duration freq amp deg dis
 
 (amp-env '(0 1 1 1)) )
(let* ((osc (make-oscil :frequency freq))
  (start (floor (* start-time *srate*)))
 (end (+ start (floor (* duration *srate*
   (aenv (make-env :envelope amp-env :duration duration :scaler amp))
 (loc (make-locsig :degree deg 

[CM] s7, cm_patterns

2015-07-02 Thread James Hearon
Hi,
I'm finding myself  s7 challenged, trying to do an example using 
CM_patterns.scm in Snd using the listener.  

Seems that Snd doesn't have process, sprout etc. which Grace allows for working 
with patterns, so trying to figure out how to set up a control loop in 
with-sound in Snd using the patterns, but getting a bit confused.

I understand with-sound can use do for a control structure
(with-sound ( )
(do ((k 0 (+ k 1)))
((= k 10))

But I'm confused about getting from the CM_patterns.scm prototype into a 
with-sound control loop.

 (define xxx '(100.0  22.345  3000.0  400))
 (define aaa (make-heap xxx))
 (next aaa #t)

I tried something like this just to test, but it prints everything, not just 
the heap pattern values.
(define (do-loop n)
 (do ((i 0 (+ i 1)))
  ((= i n))
 (next aaa #t)
  (display aaa))
(newline))

(for-each
(lambda (n) (do-loop n))
(list 10 20))

I'm wondering if anyone might have a simple working example to share?

Regards,
Jim
  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


[CM] Scheme, outa and reverb

2015-04-29 Thread James Hearon

  Scheme, Outa, and reverb  



 James Hearon   


4/28/15 



 To:  
cmdist@ccrma.Stanford.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@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] Scheme, Outa, and reverb

2015-04-28 Thread James Hearon
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@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] gtk mapped without transient parent

2015-03-22 Thread James Hearon
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@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] analog-filter.scm

2015-02-28 Thread James Hearon


 Date: Sat, 28 Feb 2015 11:51:43 -0800
 From: Bill Schottstaedt b...@ccrma.stanford.edu
 Subject: Re: [CM] analog-filter.scm
 To: James Hearon j_hea...@hotmail.com,  cmdist@ccrma.Stanford.EDU
   cmdist@ccrma.Stanford.EDU
 Message-ID: 20150228195009.m14...@ccrma.stanford.edu
 Content-Type: text/plain; charset=iso-8859-1
 
 They're in mus-config.h.  SNDLIB_CONFIG_path is very obsolete --
 it has no effect on anything.  I tried fc21 with all those settings
 and it worked fine.  I don't know what the problem is.

Hi,
Thanks Bill.  I tried this and it seems working now.

./configure  --with-s7 --with-gsl --with-motif --with-alsa 
CFLAGS=HAVE_COMPLEX_NUMBERS CFLAGS=HAVE_COMPLEX_TRIG 
CFLAGS=-I/usr/include/linux/param.h SNDLIB_CONFIG_path=/opt/sndlib

--
(load /opt/snd-15.4/analog-filter.scm)

(define (filter-sweep flt)
  (let ((phase 0.0)
(freq 0.0)
(incr (/ (* 2 pi) 144000.0))
(samps (seconds-samples 0.5)))
(do ((i 0 (+ i 1)))
((= i samps))
  (let ((sval (* .8 (sin phase
(set! phase (+ phase freq)) 
(set! freq (+ freq incr))
(outa i (flt sval)) 
(outb i (flt sval))  

(with-sound (:output test.wav :srate 48000 :channels 2
 :header-type  mus-riff)
  ;(filter-sweep (make-butterworth-lowpass 8 .1))
  (filter-sweep (make-bessel-lowpass 8 .2))
  ;(filter-sweep (make-chebyshev-lowpass 8 .1))
  ;(filter-sweep (make-inverse-chebyshev-lowpass 8 .1))
  ;(filter-sweep (make-elliptic-lowpass 8 .01))
  )




  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] analog-filter.scm

2015-02-27 Thread James Hearon
Hi,
Using Snd and getting unbound variable error on analog-filter.scm for line 309 
gsl-roots.

I configured Snd --with-gsl, and have gsl and gsl-devel on my machine.  I also 
compiled a simple
exampl.c in gsl using bessel functions and it compiles and runs o.k.

I'm wondering what might be going wrong or why it's not able to get to gsl?

Thank-you.
Jim

  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] defvar global list

2014-12-26 Thread James Hearon
Hi,

Working in CLM with a .clm file, getting confused with lisp, and I was hoping I 
could get some help from lisp experts here.

I'm confused why collecting into a global list is not available from the second 
loop, in ex. 1.  I'm wondering if I'm not understanding something about scope.  
Should the loops from ex. 1 be wrapped with something else like a let 
statement? 

I can access the global list by defining a function in ex. 2, but curious where 
I'm going wrong in ex. 1?

ex. 1

(defvar mylist '(0.5  100.0  200.25  4000.0  1.0  0.33))

(defvar *test* '(nil))

(loop
   for i from 0 to 10  by 1
   for xx in mylist collect (random-element mylist) into *test*
   finally (return *test*))
)

(loop
   for i from 0 to 10 by 1
   for yy in *test*  ;the randomized list above does not seem available as 
global here
   do
 (format t  ~A yy)
 )

--
ex. 2

(defvar mylist '(0.5  100.0  200.25  4000.0  1.0  0.33))

(defvar *test* '(nil))

(defun myfunc (somelist)
(loop
   for i from 0 to 10  by 1
   for xx in somelist collect (random-element somelist) into *test*
   finally (return *test*))
) 

(loop
   for i from 0 to 10 by 1
 for yy in (myfunc mylist)
   do
 (format t  ~A yy)
 )
  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] type double-float

2014-07-10 Thread James Hearon
Hi,
I'm trying to figure out how to solve a double-float undefined error for the 
mapcar statement in Fernando's moog.lisp instrument in sbcl, emacs, slime, clm.

Should I try to define the double-float type in moog.lisp or is it something I 
need to be doing from sbcl, or clm?


(defparameter moog-gaincoeffs
'(0.69 0.990082 0.980347 0.970764 0.961304 0.951996 0.94281 0.933777 
0.924866 0.916077 
  0.90741 0.898865 0.890442 0.882141  ... ))

(defparameter moog-gaintable
(make-double-float-array (length moog-gaincoeffs)  
 :initial-contents (mapcar #'double-float moog-gaincoeffs)))


  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] cl/clm mutliple combs

2014-06-24 Thread James Hearon
Hi,
I'm stuck on a bit of info from snd/clm manual re: summing combs. I was able to 
do it in snd/clm using comb-bank, but I'm stuck on cl/clm approach where you 
need to loop thru and sum the combs.  Hoping I can get some help with my code, 
below. I may have made a mess of it, but can't seem to figure out how to do it. 
 Thank you.

 (let ((sum 0.0)) 
  (do ((i 0 (+ i 1)))
  ((= i n) sum)
(set! sum (+ sum (comb (combs i) x)

can be replaced with:

(let ((cb (make-comb-bank combs)))
  ...
  (comb-bank cb x))


error:
The LET* binding spec (COMBS 1 (MAKE-COMB 1.0 600)) is malformed.

(definstrument mult-combs (beg dur freq amp)
  (let* ((start (floor (* beg *srate*)))
 (end (+ start (floor (* dur *srate*
 (os (make-oscil freq))
 (combs 1 (make-comb 1.0 600))
 (combs 2 (make-comb 2.0 300))
 (combs 3 (make-comb 3.0 100))
 (sum 0.0) ) 
(do ((i 0 (+ i 1))) 
((= i 3) sum)
(set! sum (+ sum (comb (combs i) 0.02))) )
 (run
 (loop for i from start to end do
   (outa i (comb sum (* amp (oscil os
   (outb i (comb sum (* amp (oscil os 
   
 (with-sound (:channels 2 :srate 48000 :header-type mus-riff :output 
mytest.wav)
   (mult-combs 0 5 200 .8)
 )
  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] green, butter clm

2014-06-06 Thread James Hearon
Hi,
For CL/CLM manual under other generators, I'm trying to understand the 
implications of green.cl and butterworth.cl.

green.cl defines several special purpose noise generators.
butterworth.cl has several Butterworth filters.  
(See analog-filter.scm in the Snd package for functions to design all the usual 
analog filters;
the output is compatible with CLM's filter generator).

I think I've understood green.cl, but stuck on butterworth.cl, however I did 
get the Snd analog-filter.scm working in Grace and Snd.

For emacs/slime/lisp with butterworth.cl was trying below, but getting memory 
errors.  Not sure if I understood what .cl is for?  I just named it .lisp, 
added the instrument below to it and tried to compile and load that.  I'm 
thinking I'm off on the wrong track about how the butterworths are intended to 
be utilized in clm.


(definstrument mybutter (beg dur freq amp)
   (let* ((start (floor (* beg *srate*)))
   (end (+ start (floor (* dur *srate*
(flt (make-butterbp 200 .5))
 (os (make-oscil freq)))
(run
 (loop for i from start to end do
   (outa i (* amp (filter flt (oscil os

(with-sound (:channels 2 :srate 48000 :header-type mus-riff :output 
testbutter.wav)
(mybutter 0 5 400 .7)
)

  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] slime printing

2014-04-23 Thread James Hearon
re: clm emacs-slime

...might be a bit OT

I was hoping to get some advice on printing from emacs-slime.  I'm trying to 
print output to a visible area of the emacs editor when the code is compiled 
and runs, such as in with-sound below.

I'm using f20, sbcl, emacs-slime, and clm but having a devil of a time getting 
any contrib to load and run with my .emacs file which might support more repl 
such as to the echo area etc.  I'm wondering what approach you folks might use 
to print to std out?  Are you using a contrib package or other editor and print 
.el utility files?

I've tried things like (print ), and (format t ...) and (message ...), and 
those evaluate the expression to the echo area but they don't work when I 
compile and run and it is beeping.  Or am I totally off base, and lisp doesn't 
do that very well at all?

Thank You,
Jim


(definstrument simp (start-time duration frequency amplitude optional (amp-env 
'(0 0 .5 1.0 1.0 0)))
  (multiple-value-bind (beg end) (times-samples start-time duration)
(let ((osc (make-oscil :frequency frequency))
  (amp-env (make-env amp-env :scaler amplitude :duration duration)))
  (run 
   (loop for i from beg below end do
   (outa i (* (env amp-env) (oscil osc) ))
   (outb i (* (env amp-env) (oscil osc) ))
   )

(with-sound (:channels 2)
(loop
for tt from 1 to 10 by 2
do
** (print tt) ***
(simp tt .25  220 .75)
))
  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] cm 3.9 kde desktop

2014-03-11 Thread James Hearon
Hi,
I got a fedora build of cm 3.9, but am having a KDE issue since the fedora20 
upgrade.

 Error: load file /home/fedora2/Object::connect: No such signal 
 org::freedesktop::UPower::DeviceAdded(QDBusObjectPath)
Object::connect: No such signal 
org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath) does not exist.

The error shows thru the Grace console, and is a KDE problem but renders the 
file editing in Grace such as .scm  and .sal files useless.  Doesn't show some 
text and won't allow you to enter text.  Nasty problem.

CM 3.9 is working fine on Mac and on my f20 with gnome desktop however, so just 
thought I'd post this here and see on the off chance if there might be another 
KDE user who's figured out the UPower, or ibus, or dbus problem. 

I just just went thru a bunch of KDE upgrades and was hoping that would do it 
but no joy.

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


[CM] snd

2014-01-30 Thread James Hearon

re: snd 14.3, fedora20, Motif

Hi,
I was trying to figure out how to play from the cursor (red triangle) with a 
tracking cursor.  Mine seems to always start from the beginning of the file 
when I do ctrl-play.  

Also how would you go about normalizing in snd?  is that what the - 1.0 
selection is for when right clicking on a selection?

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


[CM] Grace, beta 5, sndlib

2014-01-05 Thread James Hearon

  On Jan 2, 2014, at 9:33 PM, Joel Matthys jwmatt...@yahoo.com wrote:
  Thanks for the update! One bugfix: I had to add -ldl to LIBS in s7.make.
  
  Joel

 so you might try what Joel did and see if that builds s7.  


Hi,
Yes, that seems to work.

My changes to get it to build on f20 were:

change premake4.lua, line 350 etc. to include dl... (thanks Bill)

-- Linux
configuration({linux})
links({dl, pthread, rt, X11,GL,GLU,Xinerama,
   asound,freetype, Xext})
if _OPTIONS[with-fomus] then
   links({dl, gsl, gslcblas, m}) 
end

then run configure using premake
$ CFLAGS='-ldl -lpthread ' ./premake4 --with-oscpack

then edit and change s7.make for config debug, release, and speed LIB options 
to (thanks Joel):

  LIBS  += -ldl -lsndlib -lasound

then run $ make
-
Also followed gnome instructions for adding icon to app on fedora with gnome:
Place the icon in
/usr/share/icons/hicolor/48x48/apps/
Then after build is complete right click grace app in bin directory, select 
properties, then click on the icon image on properties page and associate it 
with cm.png.

Regards,
Jim



  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] Grace, beta 5, sndlib

2014-01-04 Thread James Hearon
 Building s7 (debug) 
Running pre-build commands
res/bin/sndlib.sh
Linking s7
/usr/bin/ld: sndlib/lib/libsndlib.a(s7.o): undefined reference to symbol 
'dlclose@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlclose@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 
so try adding it to the linker command line
/lib64/libdl.so.2: could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[1]: *** [bin/s7] Error 1
make: *** [s7] Error 2

Hi,
I tried the Grace beta 5, but having problem with linking in sndlib to complete 
the build.  I'm on fedora20.  It does build a libsndlib.a.  Not sure what the 
error is saying.  Is sndlib not looking in lib64 to get what it needs?

I've tried several things from the command line such as:
$ LIBS='/lib64/libdl.so.2' CFLAGS='-ldl -lpthread' ./premake4 --with-oscpack

Beta4 build has been working fine on f20 after a few tweaks.

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


[CM] S7, float to string conversion

2014-01-03 Thread James Hearon
Hi,
Yes.  all of those will work to convert float to string for output to file.  
There is probably a better way of writing CM pattern float output to a file as 
strings than my example, but at least this gets me going again.  

Regards,
Jim


(number-string 123)
(object-string 123.45)
(format #f ~G 123)
(format #f ~f 123.456)


 (define ouf1 (open-output-file myfloats.txt))
 (define outstring init)
  
 (define (myfloats total)
 (let ((test 0))
  (process  with mytable = (make-heap '(.5 1 2.5 3))
   until (= test total)
   do
 (set! outstring (next mytable))   ;***stuck here with format conversion ***
 (set! outstring (string-append outstring (string #\newline)))
 (display outstring ouf1)
 (print (next mytable))
 (set! test (+ test 1))  
 )))
  
 (sprout (myfloats 10) )
  
 (close-output-port ouf1)

  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] Scheme S7 convert float to string

2014-01-02 Thread James Hearon
Hi,
I'm a bit stuck on finding info for scheme s7 format conversion from float to 
string for output to file.  I've tried several things, mostly looking at lisp 
code, but cannot seem to come up with what it wants.  Any help or hints would 
be appreciated.

Thank you.

 
(define ouf1 (open-output-file myfloats.txt))
(define outstring init)
 
(define (myfloats total)
(let ((test 0))
 (process  with mytable = (make-heap '(.5 1 2.5 3))
  until (= test total)
  do
(set! outstring (next mytable))   ;***stuck here with format conversion ***
(set! outstring (string-append outstring (string #\newline)))
(display outstring ouf1)
(print (next mytable))
(set! test (+ test 1))  
)))
 
(sprout (myfloats 10) )
 
(close-output-port ouf1)
  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] clm, evelope with reverb

2013-12-11 Thread James Hearon
Hi,
I'm getting better at using reverb but wrestling with trying to include 
amplitude envelopes in the instrument now.  The reverb (locsig) is working for 
me, if I just use amplitude instead of the amplitude envelope on the output 
stream, but if I try  to employ the amplitude envelope I loose the reverb.

   (locsig loc i (* amplitude (oscil osc) ))  ;works fine
   (locsig loc i (* (env amp-env) (oscil osc) )) ; no reverb?
   
I've tried several changes to the ins but not sure I understand why (env 
amp-env) takes away the reverb?

 (definstrument examp (start-time duration frequency amplitude 
 optional (amp-env '(0 0 .5 1.0 1.0 0))
   (reverb-amount 0.5)  
 )
  (multiple-value-bind (beg end) (times-samples start-time duration)
(let ((osc (make-oscil :frequency frequency))
  (amp-env (make-env amp-env :scaler amplitude :duration duration))
   (loc (make-locsig :reverb reverb-amount))  )
  (run 
   (loop for i from beg below end do
  (locsig loc i (* (env amp-env) (oscil osc) ))  ;;problem here 
  )

(with-sound (:reverb nrev :reverb-data (:reverb-factor 1.0 :lp-coeff 0.7) 
:channels 2 :srate 48000)
(examp 0  1.5  220.0  0.35  '(0 0 .5 1.0  1.0 1.0  1.5 0) 0.3) )


  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


[CM] clm, slime, reverb

2013-11-20 Thread James Hearon
Hi,
For explanation or reverb.  Thank you for that info. I'm still trying to 
understand what it means by example.  I don't think I quite have it yet.  My 
try below just seems to be increasing gain but not creating reverb.  I also 
looked at locsig explanation in the clm manual, but that's a bit beyond me to 
start.  I just need a simple understanding of how reverb is working in ins 
design to help get started.  Are there any simple examples around?  I've 
grepped thru clm-4 and snd but don't see much by way of example for nrev, 
jcrev, or rev2. 

I'm getting hung up on the out-any part with trying to add reverb to the 
stream.  For ins with complex outputs a clearer example of wet/dry would be 
appreciated to see how it's done.

re: 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.
///

(definstrument simple-saw (beg dur frq amp)
  (let* ((os (make-sawtooth-wave frq))
  (start (floor (* beg *srate*)))
   (end (+ start (floor (* dur *srate*
 )
(run
 (loop for i from start to end do
   (outa i (* amp (sawtooth-wave os)) )
    

(definstrument simple-sawRev (beg dur frq amp)
  (let* ((os (make-sawtooth-wave frq))
  (start (floor (* beg *srate*)))
   (end (+ start (floor (* dur *srate*
 (rev-amount .9)
 )
(run
 (loop for i from start to end do 
(outa i (* (* amp (sawtooth-wave os)) rev-amount) *reverb* )
    

(with-sound (:reverb nrev :reverb-data (:reverb-factor 0.5 :lp-coeff .45) 
:channels 2 
:srate 48000) (simple-saw 0 1 220.0 0.3)
  (simple-sawRev 2 1 220.0 0.3))


  ___
Cmdist mailing list
Cmdist@ccrma.stanford.edu
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist


  1   2   >