MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Using "/@" Effectively


The solutions since sent me, as well as discovering one of them on my
own, werel

(1) a "generic" and prefered solution for my overall needs:

Sound[melody[#[[1]], #[[2]]] & /@ {{0, 1}, {5, 0.5}, {7, 0.5}, {12,
1}}, {0,
   3}, SoundVolume -> .5]

(2) a "specific" solution for two-element lists only:

Sound[melody[First[#1], Last[#2]] & /@ {{0, 1}, {5, 0.5}, {7, 0.5},
{12, 1}}, {0,
  3}, SoundVolume -> .5]

I hope these solutions might help others too.

---
Ben


  • Prev by Date: Re: Using "/@" Effectively
  • Next by Date: Re: Summing all the elements along a dimension in a matrix
  • Previous by thread: Re: Using "/@" Effectively
  • Next by thread: Re: Using "/@" Effectively