Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Using "/@" Effectively

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104318] Re: Using "/@" Effectively
  • From: BenT <brtubb at pdmusic.org>
  • Date: Tue, 27 Oct 2009 05:00:12 -0500 (EST)
  • References: <hc38lq$iae$1@smc.vnet.net>

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