Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Representing musical timings on a helix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127741] Re: Representing musical timings on a helix
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Sat, 18 Aug 2012 03:43:43 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20120817074724.C276F685F@smc.vnet.net>

data  Flatten[{{
     {0.0348299}, {0.476009}, {0.940408}, {1.3932},
     {1.84599}, {2.29878}, {2.75156}, {3.18113},
     {3.65714}, {4.12154}, {4.59755}, {5.03873},
     {5.49152}, {5.92109}, {6.42032}, {6.90794},
     {7.39556}, {7.87156}, {8.34757}, {8.82358},
     {9.3112}, {9.79882}, {10.3445}, {10.983},
     {11.5751}, {12.2369}, {12.9683}, {13.6882},
     {14.4312}, {15.1859}, {15.9637}, {16.7416},
     {17.5543}
     }}];

len = Length[data];

c = Interpolation[data];

Do not use capital letters as first (or only) letter for user-defined
symbols. This will avoid conflicts with Mathematica's built-in symbols
(e.g., N has a specific meaning).

?N

N[expr] gives the numerical value of expr.
N[expr,n] attempts to give a result with n-digit precision.  >>

pt[t_, k_, n_] = {
   1/c'[t]*Cos[2 Pi*t/n],
   1/c'[t]*Sin[2 Pi*t/n],
   k* c[t]};

With[{n = 8, k = 1/4},
 ParametricPlot3D[pt[t, k, n],
  {t, 1, len}]]

A dynamic version

Manipulate[
 Show[
  ParametricPlot3D[pt[t, k, n],
   {t, 1, len}],
  Graphics3D[{
    Red,
    AbsolutePointSize[6],
    Point[pt[time, k, n]]}]],
 {{n, 8, "beats per cycle"}, 2^Range[2, 4]},
 {{k, 1/4, "height of cycle"}, 2^Range[-3, 0]},
 {{time, len/2.}, 1, len, .1, Appearance -> "Labeled"}]


Bob Hanlon


On Fri, Aug 17, 2012 at 3:47 AM, amcgraw <mcgraw.andrew at gmail.com> wrote:
> Dear List,
>
> I'm a musicologist new to mathematica, hoping the readership will indulge my considerable ignorance for a moment. I'm trying to represent musical timings as points going around a helix. Each full revolution should include 8 beats (points) and the helix should "swell" with slower tempos (longer inter-onset intervals) and "compress" with faster tempos (shorter inter-onset intervals).
>
> Plotting this 2D is easy enough, but uninteresting.
>
> A colleague has suggested the following to graph this helix.
>
>  C(t) counts # of beats elapsed at time t, then slope C'(t) = beats per minute at time t. Constants: K = vertical distance between cycles; N = number of beats in one cycle (here 8). Then the onsets are represented on the spiral using:
>
> x = (1/C'(t)) cos((2pi/N)t)
> y = (1/C'(t)) sin((2pi/N)t)
> z = KC(t)
>
> I'm wondering how the readership would go about realizing this within mathematica. Having just installed the program, I'm just now getting up to speed with basic importing and visualization of data, as well as playing with various ways to build and manipulate 3D graphics. Its bridging these two, in this example, that I'd greatly appreciate pointers on.
>
> Thank You!
> AM
>
> Sample timing data outlining 4 cycles of 8 beats, slowing down:
>
> {{{0.0348299}, {0.476009}, {0.940408}, {1.3932}, {1.84599},
> {2.29878}, {2.75156}, {3.18113}, {3.65714}, {4.12154}, {4.59755},
> {5.03873}, {5.49152}, {5.92109}, {6.42032}, {6.90794}, {7.39556},
> {7.87156}, {8.34757}, {8.82358}, {9.3112}, {9.79882}, {10.3445},
> {10.983}, {11.5751}, {12.2369}, {12.9683}, {13.6882}, {14.4312},
> {15.1859}, {15.9637}, {16.7416}, {17.5543}}}
>
>



  • Prev by Date: Re: Simplify
  • Next by Date: Inconsistent behavior of RegionFunction in ContourPlot and ListContourPlot
  • Previous by thread: Representing musical timings on a helix
  • Next by thread: Re: Representing musical timings on a helix