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)
Best of Piano Buyer
 Best of Piano Buyer
(ad)
Piano Life Saver - Dampp Chaser
Dampp Chaser Piano Life Saver
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

(ad)
Accu-Tuner
Sanderson Accu-Tuner
Who's Online Now
141 registered members (Andy R, 36251, ando, agraffe, astrotoy, ALEXANDER DYKER, Azzawaba, apianostudent, AZNpiano, AlphaBravoCharlie, 29 invisible), 1,728 guests, and 3 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 04:38 PM
01/09/19 04:38 PM
Joined: Mar 2018
Posts: 54
A
Audetto Offline OP
Full Member
Audetto  Offline OP
Full Member
A

Joined: Mar 2018
Posts: 54
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 05:13 PM
01/09/19 05:13 PM
Joined: Apr 2007
Posts: 2,932
Sofia, Bulgaria
CyberGene Online content
2000 Post Club Member
CyberGene  Online Content
2000 Post Club Member

Joined: Apr 2007
Posts: 2,932
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);
}


My Soundcloud, My YouTube
Currently: Yamaha N1X, DIY hybrid controller -> Garritan CFX
Previously: NU1X, ES7, MP6, CA63, RD-700SX, CDP-100, FP-5, P90, SP-200
Re: Multiple MIDI On question [Re: Audetto] #2800213
01/09/19 05:29 PM
01/09/19 05:29 PM
Joined: Apr 2007
Posts: 2,932
Sofia, Bulgaria
CyberGene Online content
2000 Post Club Member
CyberGene  Online Content
2000 Post Club Member

Joined: Apr 2007
Posts: 2,932
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.


My Soundcloud, My YouTube
Currently: Yamaha N1X, DIY hybrid controller -> Garritan CFX
Previously: NU1X, ES7, MP6, CA63, RD-700SX, CDP-100, FP-5, P90, SP-200
Re: Multiple MIDI On question [Re: Gombessa] #2801168
01/12/19 10:10 AM
01/12/19 10:10 AM
Joined: Mar 2018
Posts: 54
A
Audetto Offline OP
Full Member
Audetto  Offline OP
Full Member
A

Joined: Mar 2018
Posts: 54
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)
Piano & Music Accessories
piano accessories music gifts tuning and moving equipment
Page 3 of 3 1 2 3

Moderated by  Piano World 

Shop Our Online Store!
Shop Our Store Online
Shop PianoSupplies.com

Did you know Piano World has an online store, and that it's loaded with goodies pianists and music lovers want?
Check it out and place your order.

Special Purchase!
Keyboard and Roses Piano Bench Cushion Keyboard & Roses 14"x30" piano bench cushions Regularly sold for $79 to $100, now only $39. (while supplies last)

(ad)
Pianoteq
PianoTeq Bechstein
(ad)
Faust Harrison Pianos
Faust Harrison 100+ Steinways
New Topics - Multiple Forums
Rock School Breakdown?
by stevechris. 03/26/19 05:07 PM
Which Yamaha model?
by Azzawaba. 03/26/19 04:48 PM
CP88
by quindecima. 03/26/19 04:37 PM
Story & Clark Console - Worth Investing in?
by Bean23. 03/26/19 04:19 PM
Which Yamaha model?
by Azzawaba. 03/26/19 03:49 PM
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
Forum Statistics
Forums41
Topics191,147
Posts2,811,139
Members92,886
Most Online15,252
Mar 21st, 2010
Please Support Our Advertisers
Faust Harrison 100+ Steinways

Dampp Chaser Piano Life Saver

Sweetwater

 Best of Piano Buyer

PianoTeq Bechstein
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 - 2019 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