| Author |
Message |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Nov 21, 2013 9:03 AM Post subject: Control of MIDI Volume independent of Note |
|
| Hi Jarek, The MIDI has some really nice sounding continuously-sounding instruments, and so I'm varying the volume of a single sustained non-changing Note for my BioFeedback. Trouble is that MIDI is unable to change the volume of an in-progress note directly, and so I've run my volume signal through ScalarValue and I Restart ScalarValue via ElementInteractor every time State detects that the Volume has changed. This works well BUT because it causes MIDI to stop-start the note, I get a harsh sounding distortion as the volume changes. I can rate-limit this but ti's still an ugly bride. Is there a better way to change the volume of an in-progress MIDI note? If not then would you be able to add this feature to the MIDI? I really miss not being able to do this cleanly in BioEra. Thanks from Stepan. |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Nov 21, 2013 8:03 PM Post subject: |
|
Unfortunately I don't have a way to do this. The midi sounds are played by system. I can only send or cancel a note. Maybe you could try to change the system volume rather than the midi volume. The PCMAudioPlayer has volume input which does that (changes volume on the system mixer - you can see it there).
I have an experimental PCMMidi element (not visible) which can play ONLY ONE instrument which is selected from a wav file (I also don't have instruments though). It isn't finished, but it would definitely allow any control because it sends audio just like SoundFileReader, so it can be fully manipulated in the design. |
|
 |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Nov 22, 2013 12:25 AM Post subject: |
|
I had a pretty good hunch that this was going to be a Java related limitation. The good news is that BioEra has enough flexibility to largely work around this Java MIDI limitation, by force-feeding in the same note upon volume change (I really don't want to mess with system volume since it's global).
Jarek, if you PCMMidi is able to vary the pitch of a recorded sound without changing the duration, then that would be even better than MIDI. The ability to vary the volume, pitch, and playback speed of a recording independently, is in my mind quite powerful because it encodes 3 different feedbacks into one auditory signal. Audacity and VideoLan have this pitch bending but I have a hunch it's somewhat complicated. Would be nice though if it could play without needing to hook it into PCMAudioPlayer, like MIDI does; just makes for a simpler implementation on the protocol design side. cheers. |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Nov 22, 2013 1:36 AM Post subject: |
|
Unfortunately no. The PCMMidi changes pitch along with the duration. It is a simple resampling with interpolation. I don't know how to quickly resample without changing the duration.
Some MIDI instruments come with separate samples for each note, so in such case it would be the same duration for each note. But it requires a lot of disk space to store all those samples. It is possible to implement that way with SteppedSoundFileReader. |
|
 |
snovotill
Joined: Feb 8, 2013 Posts: 80
|
Posted: Nov 22, 2013 4:31 AM Post subject: |
|
If you ever want to torture yourself Jarek, then here is the definitive pitch shifting guide: http://www.dspdimension.com/admin/time-pitch-overview/
And so now my initial workaround is starting to sound better and better all the time =) to the point where I'm actually quite happy with it. I decided that it adds \"character\" much like the wood grain in unpainted furniture.
And I'm pretty sure that the Java MIDI does include different sets of samples for different ranges of the same note; or so it sounds. I'm getting back to work ;-) cheers! |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Nov 22, 2013 5:49 AM Post subject: |
|
Yes, java must have those. But I don't know how to extract them. The API doesn't allow anything like that.
I don't think I want to torture myself. This is too much beyond BioEra. |
|