How do I use the internal FM sound generator to play sounds without predetermined duration?
That is, something like:
aSound pitch: aPitch volume: aVolume play
aSound stop
I had a look through AbstractSound, LoopedSampleSound and various other classes but couldn't seem to find anything that has protocol something like 'start' and 'stop'.
But as this is how MIDI works, I guess it must be possible?
Thanks all
Daniel
How do I use the internal FM sound generator to play sounds without predetermined duration?
That is, something like: aSound pitch: aPitch volume: aVolume play aSound stop
I had a look through AbstractSound, LoopedSampleSound and various other classes but couldn't seem to find anything that has protocol something like 'start' and 'stop'.
But as this is how MIDI works, I guess it must be possible?
Daniel -
Yes it is. You might want to look at PianoKeyboardMorph. It's a complete keyboard UI and synthesizer in 5 methods.
- Dan
[the ability to drag along the keyboard which works in 2.8 is currently broken in 2.9alpha, but I'll put out a fix soon]
Thanks Dan. I'm looking at how this works now, so that I can maybe use it as a basis to work from.
Can you please answer this:
looking at the 'buildKeyboard' method, I can see where the mouse down event is picked up and handled using the
mouseDownEvent: event noteMorph: noteMorph pitch: midiKey
method. But I can't work out where the arguments come from. This is the line in buildKeyboard
on: #mouseDown send: #mouseDownEvent:noteMorph:pitch: to: self withValue: i-1*12 + (#(1 3 5 6 8 10 12) at: j);
ands I can see that this calculates the midi note number corresponding to the 'key' that has been pressed. But where do the arguments to mouseDownEvent: and noteMorph: come from?
Thanks again
Daniel
At 09:19 22/11/00 -0800, you wrote:
How do I use the internal FM sound generator to play sounds without predetermined duration?
That is, something like: aSound pitch: aPitch volume: aVolume play aSound stop
I had a look through AbstractSound, LoopedSampleSound and various other classes but couldn't seem to find anything that has protocol something like 'start' and 'stop'.
But as this is how MIDI works, I guess it must be possible?
Daniel -
Yes it is. You might want to look at PianoKeyboardMorph. It's a complete keyboard UI and synthesizer in 5 methods.
- Dan
[the ability to drag along the keyboard which works in 2.8 is currently broken in 2.9alpha, but I'll put out a fix soon]
squeak-dev@lists.squeakfoundation.org