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

MathGroup Archive 2009

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

Search the Archive

Error using Manpulate that is NOT obvious (to me)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96744] Error using Manpulate that is NOT obvious (to me)
  • From: brtubb at pdmusic.org
  • Date: Mon, 23 Feb 2009 05:04:02 -0500 (EST)

Using Mathematica 6.0.2, I can't get this relatively straight forward code to
work, Can anyone explain what's wrong and how to fix it. It's
essentially intended to be musician utility for using the SoundNote
function which I hope to further elaborate by also converting any
(MIDI note range frequency) into the appropriate MIDI note number and
pitch bend values assumming a fine tuning RPN range of +/- 1 semitone,
allowing 100 cents "sensitivity" to be defined.

Manipulate[
 DynamicModule[{f, m, s, sd, pt, p, o},
  f = N[(440/64) 2^((m + 3)/12)];
  sd = {"C", "C#", "D", "D#", "E", "F",
    "F#", "G", "G#", "A", "A#", "B"};
  s = m - 60;
  pt = Mod[m, 12];
  p = sd[[pt + 1]];
  o = Integer[m/12] - 1;
  Print[
   "MIDI Note Number (0-127)", m,
   " equals ", f, " Hertz (8-12600)",
   ", and its SoundNote number (-60 to 67) is ", s,
   ", which has the Pitch name of (C to B) ", p,
   " in Octave (-1 to 9) ", o, "."
   ]
  ],
 {m, 0, 127, 1},
 SaveDefinitions -> True
 ]

Benjamin Tubb
using Mathematica 6.0.2
and still occasionally v3.0.1 <g>


  • Prev by Date: Re: Precise bitmaps
  • Next by Date: Re: Exporting data into a file, OpenWrite
  • Previous by thread: Re: no message from Minimize[] on a weird function(x^x)
  • Next by thread: Re: Error using Manpulate that is NOT obvious (to me)