diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-07-03 16:37:21 +0200 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2016-07-03 16:37:21 +0200 |
| commit | ef023bd9f0eaa7c50664e89eabc3db539fc38211 (patch) | |
| tree | 941257f322389a86266b27eeb21ce4434324a118 /sndfile.lua | |
| parent | cac2883931aff61dd4d39061ff5aec4edafd0684 (diff) | |
| download | applause2-ef023bd9f0eaa7c50664e89eabc3db539fc38211.tar.gz | |
added InstrumentStream (Stream:instrument)
* allows a stream of note velocities to trigger a note-on and note-off stream.
* usually used on a MIDIVelocityStream
* allows a single note to be triggered including attack, sustain and decay
phases
* by letting the note-on and note-off streams depend on the note/velocity stream,
the note can use the NOTE ON velocity.
* The InstrumentStream constructor will also accept functions on the note_stream,
so it is possible to define the note-on/off streams depending on the velocity stream
on a single line of source code.
* A NOTE OFF velocity is currently not used, though that could be achieved by
letting MIDIVelocityStream generate negative numbers for NOTE OFF velocities.
* This will only work with a single note (ie. a fixed frequency);
when wanting to play polyphony, users will have to mix many different InstrumentStreams, e.g.
iota(69, 79):map(function(note)
return MIDIVelocityStream(note, 1):instrument(function(v) return InstOn(note, v) end,
InstOff(note))
end):fold(function(x,y) return x+y end):ravel()
Diffstat (limited to 'sndfile.lua')
0 files changed, 0 insertions, 0 deletions
