Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2716 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  

EgonOlsen (74 views)
2018-06-10 19:43:48

EgonOlsen (55 views)
2018-06-10 19:43:44

EgonOlsen (74 views)
2018-06-10 19:43:20

DesertCoockie (254 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (154 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (808 views)
2018-03-24 14:43:53

Solater (172 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!