• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Java Midi Synthesizer API

 
author
Posts: 4342
40
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Is it possible to use the Java Midi Synthesizer API to get a glissando (ascending set of notes) effect? On some instruments this is thought of as a slurring of notes.

http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/midi/Synthesizer.html

An example of what I'd like to do is play a scale (8 notes) fast (1-2 second), probably using noteOn()/noteOff(). Some instruments that require notes to be played long to sound properly (violin) sound very akward when they are played in short bursts. I'd like to know if there is a way to continue the sound of the instrument while switching notes as is done in a glissando.

Thanks,
Scott
[ October 23, 2007: Message edited by: Scott Selikoff ]
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your violin samples, are they samples from the Java API or are you playing the sounds through a peripheral device (like a Yamaha keyboard)?

I'd hate to get something working at home only to have it not work for you because you're using a different setup.
 
Scott Selikoff
author
Posts: 4342
40
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just sounds generated through the API (such as using noteOn and noteOff) and played through the sound card.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One possibility is to make the notes overlap - call noteOff() on the first note only after calling noteOn() on the previous note. For some instruments this may help blend the notes together more smoothly.

Another possibility is to use MidiChannel's setPitchBend() to gradually increase or decrease the pitch. Unfortunately there are limitations:
  • It affects the whole channel at once, so if you want any polyphony (as in my above suggestion) you'll need to play different notes on different channels
  • It's not clear how far up or down the different settings modulate the tone; you may need to experiment.
  • There's a maximum range you can bend up or down - typically two semitones. For a glissando across a larger range, you'd need to mix with other notes and channels.

  • Still, it might be worth trying this as one way to help smooth out the glissando.

    I'll be interested to hear what works for you, if anything.
    [ October 23, 2007: Message edited by: Jim Yingst ]
     
    Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
    Gift giving made easy with the permaculture playing cards
    https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    reply
      Bookmark Topic Watch Topic
    • New Topic