Play items from [umenu]?


    Jan 05 2010 | 12:53 pm
    Hi,
    I am relatively new to MaxMSP. Im trying to make a patch that plays random files from a folder. So I am using a [opendialog fold] to [folder] to [umenu], but how do I play the files from the [umenu]?
    Regards 123ndy

    • Jan 05 2010 | 2:22 pm
      My first thought is to store all the filenames into a [coll ], then you could send a random index number to coll to output the path of the chosen file into [sfplay~ ] (or just send a random number to umenu to spit out the filename for sfplay~). One problem is that [sfplay~ ] probably won't be able to load and play the file immediately, so you may have to plan for some "lag". But you could work around this, it shouldn't be a big issue. You'll also have to set the search path of the patch to include the selected folder, otherwise [sfplay~] won't be able to load the files. Something like this might help with that:
      Another option is to load all the files into buffers (for playback via groove~), it would avoid the potential loading time lag problem, but would take up loads more RAM.
    • Jan 05 2010 | 2:39 pm
      < blockquote>One problem is that [sfplay~ ] probably won't be able to load and play the file immediately< /blockquote>
      That's why there is a preload method.
      Beside the RAM waste, using a buffer won't work well with long sounds (there are plenty of post on this topic), you'll then need to use hr. objects.
    • Jan 06 2010 | 7:03 pm
      Thanks for answers, but...
      (or just send a random number to umenu to spit out the filename for sfplay~).
      How do I do this? How do I play a file directly from umenu trough sfplay? (do umenu need to consist of the whole path of the file, or just the file name.aiff/wav etc?)
    • Jan 07 2010 | 1:16 am
      perhaps prefix + autopopulate method of umenu will help here:
    • Jan 07 2010 | 9:35 pm
      Thanks! It was exactly what I was looking for :) But why do you use route and autopopulate?
      I got one more question, how do I make another sound start 10 seconds before the other sound ends?
    • Feb 24 2015 | 5:09 pm
      How could i send the selected audio file to the buffer? I try to send the sfplay tilda to a record tilda but it does not seems to work!
    • May 03 2016 | 11:59 pm
      thanks Samuel Freedman, from 6 years in the future. I spent most of today looking for that answer, how to auto populate umenu with a folder of samples.