JMSL Tutorial: JScore
Building your own JScore instrument, part 4
Designing a SynthNote by hand
In the previous tutorial we saw that importing a predefined SynthNote into JScore was a one-step task (just type in the class name and listen to it!).
In this tutorial, we will design a SynthNote from scratch, and load it into JScore. Our task breaks down as follows:
- Design and compile a SynthNote with a stage 0 that bangs & sustains, and a stage 1 that terminates the sound (SynthNote calls stage 0 when its noteOn is called, and calls stage 1 when its noteOff is called. If this is at all confusing, revisit JSyn docs).
- Import it into JScore by specifying the class name, just like you did in the previous tutorial. *OR* use the
JScore API to construct an Orchestra by hand,
adding this new SynthNote to it.
The SynthNote
We designed a SynthNote that it uses a simple amplitude envelope. We define Stage 0 (noteOn)
to queue up the attack portion of the envelope, and loop the sustain portion of the envelope. Stage 1 (noteOff) queues the release frame of the
envelope. If any this JSyn discussion is confusing, we highly recommend that you review the JSyn tutorial.
You can test the SynthNote in the applet below. Click stage 0 to hear "note on", click stage 1 to hear "note off".
Next we will see how to load this sound into JScore.
SynthNote source
applet source
(C) 2000 Nick Didkovsky and Phil Burk, All Rights Reserved
JMSL is based upon HMSL (C) Phil Burk, Larry Polansky and David Rosenboom.