Help! PlayCommand Agent X

Thierry Douez th.douez at gmail.com
Fri Oct 12 11:35:51 EDT 2012


Hi Marty,

2012/10/12 Marty Billingsley <marty at ucls.uchicago.edu>:
> Thanks Jon, I had looked at the tutorial. I personally find the interface easy enough to use, but not suited to my curriculum, which is aimed at 13-year-old beginning programmers. The curriculum progression that we go through really wants some of the shakobox functionality, such as setting the instrument at the same time as playing the note.  It also depends on the fact that shakobox puts in default note durations and octaves, so we can start very simply and add the complexity as students move through the project.

Write a LC handler which hides this to your student,

> Students can start with a command that has only one "mystery number" -- "sbPlay 'harpsichord', 100, c' -- and go from there.


Have you read my last email (yesterday) ?

       3 minutes to emulate PlayCommand agent X on (Mountain) Lion

        You could see that  few lines of LC code do that:  sbPlay,
'harpishord', 100, c

         I did copy from Shakobox doc a full tune, paste it in LC and play it!


If you don't like the Midi notation, simply transform your pitch name
in a LC handler.
LiveCode is for that.

> Too many mystery numbers in SunnYmidi.Play.

Mistery ?  channel, velocity, note ?

Again, as a Livecode user you certainly know that you can write any
command/fucntion you like,
set default values to whatever variable ?

If you want I can write a handler so your students can just type:

          myHarpishord 'high', 'C'

which is even less myterious than the  sbPlay ... above.


> sunnYmidi is great (and really flexible),
>  but not useful in the teaching environment I need it for.

Actually, 80% of sunnYmidi users  are musician teachers and as far as I know,
they enjoy it and the kids too.



>
> Thanks for all the replies.  Jacque pointed me to the source code
> -- thanks, Jacque -- so perhaps I can update PlayCommand Agent X.  If so, I'll let y'all know.

I had this code 2 years ago before developping sunnYmidi. (Jacque sent it to me)
I choose to put it aside and to start from scratch.

I will be very interested to know how much time you spend on this road,
instead of writing your own wrapper in LC on the top of an existing external.

Anyway, good luck with your project.

Regards,

Thierry



> Jonathan Adams wrote:
>
>> Hi Marty,
>>
>> I am finding sunnYmidi extremely easy to use. Of course, because it has so many options it is easy to miss it but:
>>
>> 1) On startup, turn it on with: SunnYmidi.Start user, key    --user and key are provided when you purchase.
>> 2) when quiting, you should turn it off with: SunnYmidi.Stop
>>
>> 3) To play notes it is: SunnYmidi.Play channel, duration, volume, note  --put 1 into channel unless you need multiple channels, duration is milliseconds, volume 1-128 and pitch (60 is middle C)
>>
>> 4) Finally, you can change the instrument assigned to any channel with SunnYmidi.Set channel, "instrument", id  --id being standard GM voices (1 is piano, 74 is flute, etc.)
>>
>> Lots of other commands that you could use if you want but probably aren't necessary for what you want to do. You might however want to look at the command that emulates the hypercard player: sunnYmidi.HCplay channel, volume, "c3w d3h e3q f3e"  --although I haven't actually tried this command.
>>
>> Hope that helps,
>>
>> Jon




More information about the use-livecode mailing list