Help! PlayCommand Agent X

Peter M. Brigham pmbrig at gmail.com
Fri Oct 12 09:22:08 EDT 2012


Instead of delving into PlayCommand Agent X (whatever that is, and my ignorance may make this comment useless), could you not just write your own simpler custom play command in LC, to mirror what you get from shakobox, something along the lines of:

local tChannel, tVolume, tNote, tInstrument, tID, tTempo

on mbPlay tInstrument, tTempo, tNotes
   -- handle default assignments here
   -- get duration from the tTempo variable
   repeat for each item tNote in tNotes
      SunnYmidi.Play tChannel, tDuration, tVolume, tNote
   end repeat
end mbPlay

Probably too crude, but you get the idea. Am I out in left field thinking I'm playing soccer? I usually look for an LC-native way of doing things.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig


On Oct 12, 2012, at 9:06 AM, Marty Billingsley wrote:

> 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.  Students can start with a command that has only one "mystery number" -- "sbPlay 'harpsichord', 100, c' -- and go from there.  Too many mystery numbers in SunnYmidi.Play.
> 
> sunnYmidi is great (and really flexible), but not useful in the teaching environment I need it for.  
> 
> 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.
> 
> cheers,
> - marty
> 
> --
> Marty Billingsley
> Department of Computer Science
> The University of Chicago Laboratory Schools
> 
> Jonathan Adams wrote:
> 
>> 
>> 
>>> The sunnYmidie interface looks a LOT more complicated than the interface of shakobox (which uses PlayCommand Agent X).  I'm basically looking for something that will mimic the old Hypercard "play" command, which wanted an instrument, a tempo, and a note or list of notes.  Unless I'm misreading the tutorial, sunnYmidi is way too complicated for my students.
>> 
>> 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
>> 
>> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list