[CM] Several questions

Heinrich Taube taube at illinois.edu
Tue May 27 08:10:12 PDT 2014


On May 27, 2014, at 1:07 AM, Philippe de Rochambeau <phiroc at free.fr> wrote:

> Hello,
> 
> I have several questions regarding CM/Grace:
> 
> - when should you used SAL and when should you use Scheme? Although SAL seems to be the official CM programming language,
> most examples are in Scheme. I personally prefer C-like languages, but it is sometimes difficult to convert Scheme to SAL and vice-versa.

they really are almost equivalent. I implemented SAL because prefix notation (log (+ 2 3(* 2 3))) got in the way of musicians learning how to program. You can use whichever you feel most comfortable with. Sal is sort of like Lua and uses infix:   log( 2 + 3 + 2 * 3)



> - what’s the equivalent of 'with-sound' in SAL? 'with-sound() do stochastic(0, 1, 440, .1)’, for example? I have tried the latter command,
> but it silently returns an empty list.

its called file:

load("v.ins")

file "foo.wav" (srate: 22050, chans: 1)
  loop for i to 10
	fm-violin(.5 * i, 1, between(55, 880), .1)
  end
end



> 
> - is there a way to display the snd editor in Grace, other than using the with-sound command?

??

> 
> - is there a sndlib tutorial, [other than the manual (https://ccrma.stanford.edu/software/snd/snd/sndscm.html#withsound) which is not too newbie-friendly]?

there are both Sal and Scheme examples in Grace's Help menu. note that if you want to define your own instruments right away that would tip the scale in favor of learning Scheme right off the bat.

> 
> - is there a way to set the Grace Working Directory once and for all? Grace for Mac keeps forgetting that directory. I have noticed a menu item
> to set the Init File, but what should you put in that file?

THe working directory is sticky so it should stay wherever you set it. if this is not happening then its a bug (are you on a mac??)


> - why were objects abandoned in CM3?

they weren't abandoned, there just aren't objects in S7. If I had infinite time Id port stklos or goops  to s7 and then i could integrate CM2 and CM3 back together in one app, which to me would be optimal. after all ,cm2 is actually written in scheme, not common lisp, so there's no inherent reason both code bases can be one system.



> Many thanks.
> 
> Philippe
> 
> 
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist




More information about the Cmdist mailing list