Melodeon.net Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the new melodeon.net forum

Pages: [1]   Go Down

Author Topic: Curious bug in abcjs midi player  (Read 562 times)

0 Members and 1 Guest are viewing this topic.

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Online Online
  • Posts: 3043
    • Packie Manus Byrne
Curious bug in abcjs midi player
« on: June 19, 2019, 01:33:25 PM »

Some of you (other than Pete Dunk  8) ) may remember the project that was conceived on this forum to transcribe into ABC all the québécois tunes posted at http://mustrad.udenap.org/lerepertoire.html

Well, the transcription was completed by the intrepid team assembled by Pete well over a year ago, at which point the project stalled due to a number of factors that don't need to be explained here (but which include my own failure to help the site owner move forward with the project).

Anyway, now finally moves are underway and, exploring the possibilities for making the transcriptions available on the site, I have been experimenting with abcjs. All was working fine - sheet music rendering and automatic midi playback - until I tried putting the following tune onto a page. The midi player displayed a mysterious bug, which was that, after the first occurrence of a c# in bar 7, none of the remaining c#s would sound. The player left a silence of the appropriate length every time.

After numerous attempts to remove bits of ABC code that I thought might be tripping up the player, including ! directives such as !fine!, putting spaces after the repeat mark (remembering a bug recently reported here with EasyABC playback), etc. I found the culprit. It was the hyphen tying c4-B2. Removed it and everything worked properly. (The other tie marks, which cross bar lines, are not causing problems).

I suppose I should report the issue to Paul Rosen but am posting it in case it might prove useful to anyone here. Or in case anyone can point out that c4-B2 is not correct syntax?

Code: [Select]
X:2
T:TQ002 Berceuse pour Hannah
C:Réjean Brunet, Richard Forest, Sabin Jacques
Z:Chuck Boody Projet Identitairs. 2017
P:ABA
Q:1/4=124
M:3/4
L:1/8
K: D
P:A
|:D2E2|F3ED2|G2F2 E2|A6|F4D2|d6|c4-B2|A6|F2G2A2|B3AG2|
c3BA2|d2c2d2|e2d3B|A3FD2|1 E3DE2|F3GF2|(3EFE:|2 E3FE2|D6-|!fine!D3z|]
P:B
|:cd|e2c2A2|E3zBc|d2B2G2|E3zAB|c2a2f2|(3gag e2d2|e6-|e3zcd|
e2(3cdcA2|E3z Bc|d2B2G2|E3zAB|c2(3BcBA2|G2F2G2|1A6-|A4:|2 A6-|!D.C.!A2|]

PS will announce the availability of the ABCs on the site as soon as possible.
Logged
Senior member at meoldone.net

www.rogermillington.com

Gena Crisman

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 565
  • 🇬🇧
Re: Curious bug in abcjs midi player
« Reply #1 on: June 19, 2019, 01:36:52 PM »

Isn't a - for joined notes of the same pitch, and () for slurs?

The mean it's still probably a bug...
Logged

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Online Online
  • Posts: 3043
    • Packie Manus Byrne
Re: Curious bug in abcjs midi player
« Reply #2 on: June 19, 2019, 02:40:53 PM »

Isn't a - for joined notes of the same pitch, and () for slurs?

You are correct, according to Steve Mansfield's tutorial. Guido Gonzato's guide also warns against using ties to connect notes of different pitch because "MIDI output would be wrong"!

I have learned something, thank you. But it's still curious that the midi player took the erroneous tie as a signal to play no more c#s!

Also, the transcriber in question (and maybe more of us) doubtless assumed that because ABC software renders such wrongly used ties as slurs on a score, the practice must be OK.

Logged
Senior member at meoldone.net

www.rogermillington.com

Gena Crisman

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 565
  • 🇬🇧
Re: Curious bug in abcjs midi player
« Reply #3 on: June 19, 2019, 02:44:15 PM »

Having confirmed the above on the abc notation pages, if you wanted to 'fix' all your data, You could probably use regex, something like ([a-gA-G])[0-9]?-((?!\1)[a-gA-G]) (tested via regex101.com) to find instances of incorrect syntax across the whole abc database, but you'll need to fix up the optional [0-9] group to include things like /s and other abc length syntax, but I'm using a tablet and text input is hell...
Logged

Stiamh

  • Old grey C#/D pest
  • Hero Member
  • *****
  • Online Online
  • Posts: 3043
    • Packie Manus Byrne
Re: Curious bug in abcjs midi player
« Reply #4 on: June 19, 2019, 02:49:36 PM »

Ah, learning to use regex. Another winter evening project... along with learning Arabic and Welsh...
Logged
Senior member at meoldone.net

www.rogermillington.com

Mike Hirst

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 1057
  • Primatona IV D/D#, Tritone G/C/B, One Row in D
    • Berking Mad Ceilidh Band
Re: Curious bug in abcjs midi player
« Reply #5 on: June 19, 2019, 03:50:42 PM »

If one digs into pre existing abc parsers most often there are multiple regex definitions at the heart

learning (unix) text/string manipulation is essential for working with bulk abc
Logged
feel free to be yourself

Roger Hare

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 518
  • Urmston, Lancs., U.K.
Re: Curious bug in abcjs midi player
« Reply #6 on: June 19, 2019, 05:53:24 PM »

Also, the transcriber in question (and maybe more of us) doubtless assumed that because
ABC software renders such wrongly used ties as slurs on a score, the practice must be OK.
As a relative newcomer to the wonderful world of ABC, about two years ago, I discovered
that this (common?) practice also caused the Android program TradMusician to go completely
haywire on playback. It's now one of the first things I check for on looking at any older ABC
files.
Logged
Roger Hare, Urmston, Lancs., U.K. (rjhare at outlook dot com)   Manchester Morris Men   Beech Band
Music Packages (ABC/PDF/MIDI)    Thompson's Compleat Tutor for Fife (c.1765)

Gena Crisman

  • Hero Member
  • *****
  • Offline Offline
  • Posts: 565
  • 🇬🇧
Re: Curious bug in abcjs midi player
« Reply #7 on: June 19, 2019, 06:07:52 PM »

I actually only know about the different syntax for slurs and joined notes because I came at it from the other side - I'd tried to join 2 notes with ()s, and while the score looked right, the midi playback didn't join them, inevitably leading to the discovery. It's a bit daft really, because as far as I know, you can't slur a note to itself, and you can't join a note with one that's a different pitch, which is to say, they're already mutually exclusive. Maybe there is some esoteric reason, such as playing eg a note joined across two bars while slurring other notes above it.

I do see it crop up fairly frequently, so I believe it is a fairly common practice.

I think it's probably easier to modify the interpreter than it is to write a perfect regex, but easier still to just try and find the instances of it in your data and fix them by hand, just look for vaguely appropriate the instances of -s and check they're legit.
Logged
Pages: [1]   Go Up
 


Melodeon.net - (c) Theo Gibb; Clive Williams 2010. The access and use of this website and forum featuring these terms and conditions constitutes your acceptance of these terms and conditions.
SimplePortal 2.3.5 © 2008-2012, SimplePortal