Welcome to the Piano World Piano Forums
Over 2.7 million posts about pianos, digital pianos, and all types of keyboard instruments
Join the World's Largest Community of Piano Lovers (it's free)
It's Fun to Play the Piano ... Please Pass It On!

SEARCH
Piano Forums & Piano World
(ad)
Piano Life Saver - Dampp Chaser
Dampp Chaser Piano Life Saver
What's Hot!!
PIANO TEACHERS Please read this!
-------------------
European Tour for Piano Lovers
JOIN US FOR THE TOUR!
--------------------
Posting Pictures on the Forums
-------------------
Forums RULES & HELP
-------------------
ADVERTISE on Piano World
(ad)
Best of Piano Buyer
 Best of Piano Buyer
Find a Professional
Our Classified Ads
Find Piano Professionals-

*Piano Dealers - Piano Stores
*Piano Tuners
*Piano Teachers
*Piano Movers
*Piano Restorations
*Piano Manufacturers

Advertise on Piano World

Who's Online Now
141 registered members (Alexwm, Bill McKaig,RPT, 90125, Alex C, Amedeus, BeSharp, AZNpiano, Bett, 36 invisible), 1,564 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
(ad)
Estonia Pianos
Estonia Pianos
Quick Links to Useful Piano & Music Resources
Quick Links:
*Advertise On Piano World
*Free Piano Newsletter
*Online Piano Recitals
*Piano Recitals Index
*Piano & Music Accessories
*Live Piano Venues
*Music School Listings
* Buying a Piano
*Buying A Acoustic Piano
*Buying a Digital Piano
*Pianos for Sale
*Sell Your Piano
*How Old is My Piano?
*Directory/Site Map
*Virtual Piano
*Music Word Search
*Piano Videos
*Virtual Piano Chords & Scales
Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
Re: Multiple MIDI On question [Re: arc7urus] #2800189
01/09/19 03:38 PM
01/09/19 03:38 PM
Joined: Mar 2018
Posts: 35
A
Audetto Offline OP
Full Member
Audetto  Offline OP
Full Member
A

Joined: Mar 2018
Posts: 35
Originally Posted by MacMacMac

@audetto: I have not yet understood what you are trying to achieve ;-) Are you trying to layer multiple instances of the same note?


My goal is to achieve (via MIDI) some sort of super-legato / dynamic pedalling where each note is held down for a fixed period of time: 3 seconds.

Why? Just for a bit of fun. I've got other effects in mind, like echo, or a dynamic musical accompaniment.


If the same note is replayed in this interval, this is not well defined but I am happy to make up something reasonable.

Android allows me to schedule MIDI events in the future, so
- when I receive a Note ON I pass it immediately back to the piano and schedule a Note OFF at now() + 3 sec
- note OFF are ignored

This is simple as I do not have a scheduling problem, but really depends on this grey area of the MIDI spec.

As I said before, I will have to handle the scheduling issue and send a Note OFF back to the piano only if no other Note OFF for the same note are currently scheduled.


Kawai CA78
(previously Kawai KDP90)
(ad) ROLAND

Click Here

Re: Multiple MIDI On question [Re: Audetto] #2800206
01/09/19 04:13 PM
01/09/19 04:13 PM
Joined: Apr 2007
Posts: 2,530
Sofia, Bulgaria
CyberGene Offline
2000 Post Club Member
CyberGene  Offline
2000 Post Club Member

Joined: Apr 2007
Posts: 2,530
Sofia, Bulgaria
If I understand your problem correctly, it has a very simple solution. You have to use a “semaphore”, i.e. a counter for each note that is initially zero. On each noteOn you increment it. On each scheduled noteOff you decrement and check if zero. Only when zero you send actual noteOff to MIDI. Otherwise it means there’s a newer noteOn that has overridden the previous one and so you have to turn off only the latest one.

void noteOnCallback(int note) {
counter[note]++;
sendMidiNoteOn(note);
scheduleNoteOff(note);
}

void noteOffCallback(int note) {
if —counter[note] == 0 sendMidiNoteOff(note);
}


Soundcloud Profile - solo piano compositions, arrangements, reharms
Currently: DIY hybrid controller -> Garritan CFX, Yamaha NU1X
Previously: Kawai (ES7, MP6, CA63), Roland (RD-700SX, FP-5), Yamaha P90, Korg SP-200, Casio CDP-100
Re: Multiple MIDI On question [Re: Audetto] #2800213
01/09/19 04:29 PM
01/09/19 04:29 PM
Joined: Apr 2007
Posts: 2,530
Sofia, Bulgaria
CyberGene Offline
2000 Post Club Member
CyberGene  Offline
2000 Post Club Member

Joined: Apr 2007
Posts: 2,530
Sofia, Bulgaria
P.S. not sure if Android has it but the counter should be AtomicInt array and you should check its value with decrementAndGet to avoid threading issues since the scheduled calllback invocations will be performed in separate threads. Or at least use synchronized block which should certainly be available on Android.


Soundcloud Profile - solo piano compositions, arrangements, reharms
Currently: DIY hybrid controller -> Garritan CFX, Yamaha NU1X
Previously: Kawai (ES7, MP6, CA63), Roland (RD-700SX, FP-5), Yamaha P90, Korg SP-200, Casio CDP-100
Re: Multiple MIDI On question [Re: Gombessa] #2801168
01/12/19 09:10 AM
01/12/19 09:10 AM
Joined: Mar 2018
Posts: 35
A
Audetto Offline OP
Full Member
Audetto  Offline OP
Full Member
A

Joined: Mar 2018
Posts: 35
Originally Posted by Gombessa

Second is a keypress, followed by a typically triple-sensor-like repeition without fully releasing the key. Four sequential note-on events, with the key release resulting in four near-instantaneous, queued note-offs.


Same for a CA78.
There are many note offs when the key is finally released fully.


Kawai CA78
(previously Kawai KDP90)
(ad) SWEETWATER
Sweetwater - Lowest Prices on Gear
Page 3 of 3 1 2 3

Moderated by  Piano World 

(ad)
Pianoteq
PianoTeq Petrof
(ad)
Sweetwater - Keyboards
Sweetwater
ad
Jazz Piano Online
Jazz Piano Lessons Online

New Topics - Multiple Forums
Yamaha P-255 to P-515?
by MegaPiano. 01/17/19 03:56 PM
Roland Keyboard with Alexa Voice Control?
by JohnSprung. 01/17/19 03:49 PM
Time for first tuning?
by mackguy. 01/17/19 12:47 PM
Chickering Manufactured by Baldwin Mid 1990's
by Leslie C. 01/17/19 12:40 PM
Kawai CA63
by Bibster. 01/17/19 12:19 PM
Forum Statistics
Forums40
Topics189,626
Posts2,782,856
Members92,133
Most Online15,252
Mar 21st, 2010
(ad)
Accu-Tuner
Sanderson Accu-Tuner
Please Support Our Advertisers
Dampp Chaser Piano Life Saver

Sweetwater

PianoTeq Petrof
Piano Buyer Spring 2018
Visit our online store for gifts for music lovers


 
Help keep the forums up and running with a donation, any amount is appreciated!
Or by becoming a Subscribing member! Thank-you.
Donate   Subscribe
 
Our Piano Related Classified Ads
| Dealers | Tuners | Lessons | Movers | Restorations | Pianos For Sale | Sell Your Piano |

Advertise on Piano World
| Subscribe | Piano World | PianoSupplies.com | Advertise on Piano World |
| |Contact | Privacy | Legal | About Us | Site Map | Free Newsletter |


copyright 1997 - 2018 Piano World ® all rights reserved
No part of this site may be reproduced without prior written permission
Powered by UBB.threads™ PHP Forum Software 7.6.2