First time here? Check out the FAQ!

Is it possible to use a !BPM hotValue in a Smalltalk script instead of MM?

0 votes
I've been looking more into the Text to Pitch prototype, reading documentation and searching the Q&A. I would like to replace the "MM" variable with a !BPM EventValue, adjustable by the user on the fly. But every time I try it I get "Unhandled exception: My subclass should have overridden one of my messages."

I've also tried putting a green variable into Gate, in the KeyMappedMultiSample that is the input to the script, without success.

From some examples, it looks like it is possible to include hotValues in a script, but this one isn't working for me. Thanks for any advice!
asked May 23, 2016 in Capytalk & Smalltalk by stephen-taylor (Adept) (1,620 points)

2 Answers

+1 vote

How large is your text file (how many lines)? Is the desired result to have a sequence of events that you can loop and play at different rates?

One thing to keep in mind is that Smalltalk in the Script (or in a parameter field) is evaluated before the Sound starts playing.  That's why it isn't letting you using an EventValue to control the rate within the Script (since that Script is evaluated and gone by the time the Sound starts playing).

It may be possible to use a Script to create a StepSequencer with your data-driven events in it; then you could play the StepSequencer at any rate and modify the rate on the fly.

Another alternative would be to evaluate the Smalltalk live in a Tool and play as you go.

Otherwise, you could just make multiple copies of your Script, each with a different MM value.

Let us know how many events we're talking about; there may be an alternative solution.

answered May 23, 2016 by ssc (Savant) (127,080 points)
It's potentially up to thousands of characters, not separated into lines per se, just a long string of characters (actg). I'd like to be able to speed up and slow down arbitrarily; another possibility would be to program tempo ramps into the Script, but it would be more fun to change tempo with a slider, or by drawing a breakpoint.

I was trying to make a short array of characters (adapting your "Play Random Samples with Polyphony" Sound) and read through it. But even if I got it to work, I don't know if an array would be long enough.

I will read about making Tools. Thanks!
Here's something you could try. Put your MIDIVoice with the text to pitch mapping into a Timeline.  (It will warn you that a MIDIVoice might conflict with the MIDI assignment to that track, but if you put it into Track 1, it won't matter).
Stretch the time bar out to longer than the duration of your "score".
Below it drag a TimeControl module, and stretch its time bar out to the same length as the MIDIVoice.
When you play the Timeline, you can do some slow changes to the rate of playback.
Fantastic - it works beautifully, thanks very much!
0 votes
answered May 24, 2016 by ssc (Savant) (127,080 points)
Fantastic - I've got this one working too, this gives me a lot to chew on, thanks so much!