Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (623)
Games in Android Showcase (176)
games submitted by our members
Games in WIP (676)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Using hold pedal with midi  (Read 1816 times)
0 Members and 1 Guest are viewing this topic.
Offline jessedeming

Junior Newbie

Java games rock!

« Posted 2003-10-02 16:45:49 »

How can I make a midi note continue for a set amount of time?  I would like to use the acoustic nylon guitar (25) instrument, but rather than fading out I would like it to continue playing the note for 10 or 15 seconds and modify the pitch myself to simulate a person changing finger position in slow motion.

//Initializing the synthesizer
try {
  m_Synth = MidiSystem.getSynthesizer();;
  m_MidiChannel = m_Synth.getChannels();
  m_Instrument = m_Synth.getDefaultSoundbank().getInstruments();            
} catch (Exception ex) {

I've tried controllers 64 - 69 and they don't appear to change anything.

// Use soft pedal to sustain note

Offline erikd

JGO Ninja

Medals: 16
Projects: 4
Exp: 14 years


« Reply #1 - Posted 2003-11-30 06:56:56 »

When you send a note-on event to a MIDI channel, the note is played until you send a note-off event to the same channel with the same note number (or a note-on with velocity 0).
Don't use the sustain pedal controller (64) for this (remember the sustain controller is global over the whole midi channel so *all* playing notes on that channel with hold until the sustain pedal is released *and* the playing notes are released with note-offs or note-ons with velocity 0).
The soft pedal is something completely different and is not even implemented in many synths (so probably not in the javasound too, although I'm not sure).
If the sound still does not sustain, I'd say the sound itself may be the problem (it's probably not a sustained sound which makes sense for a guitar).
Did you test with for example a strings sound or any other sustained sound?
If you have a sustained sound playing, send pitch bender events to the MIDI channel to do what you want.

I must confess I haven't done any MIDI stuff in java yet so this is just MIDI theory.


Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

basil_ (42 views)
2015-09-30 17:04:40

shadowstryker (21 views)
2015-09-29 15:55:06

TheSpaceHedgehog (27 views)
2015-09-29 01:58:48

GamerC4 (50 views)
2015-09-24 21:10:38

GamerC4 (70 views)
2015-09-24 21:09:48

htuy (27 views)
2015-09-24 04:57:24

htuy (35 views)
2015-09-24 04:56:35

htuy (25 views)
2015-09-24 04:56:09

htuy (26 views)
2015-09-24 04:47:33

Roquen (63 views)
2015-09-21 12:54:28
Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!