Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'InputField and Manipulate' topicStudent Support Forum > General > Archives > "InputField and Manipulate"

Help | Reply To Topic
Author Comment/Response
Rangarajan Krishnamoorthy
02/05/13 5:10pm

I am trying to use Manipulate to allow musical pieces to be played. The following works as expected:

Manipulate[Sound[SoundNote[0, t, instr]], {t, 0, 5}, {instr, {"Organ", "Sitar"}}]

I want to extend the idea to allow the user to enter the notes to be played in an InputField. I tried the following, but it doesn't work:

DynamicModule[{p}, InputField[Dynamic[p]]; Manipulate[Sound[SoundNote[p, t, instr]], {t, 0, 5}, {instr, {"Organ", "Sitar"}}]]

I assumed that this will display an input field and the entered value will be passed on to SoundNote function. But it does not work that way.

How do I use InputField and Manipulate together?


URL: ,
Help | Reply To Topic