Coder Social home page Coder Social logo

coderline / alphatab Goto Github PK

View Code? Open in Web Editor NEW
1.2K 49.0 199.0 185.09 MB

alphaTab is a cross platform music notation and guitar tablature rendering library.

Home Page: http://www.alphatab.net

License: Mozilla Public License 2.0

JavaScript 0.47% C# 4.48% HTML 0.57% CSS 0.21% TypeScript 89.68% Kotlin 4.50% Ruby 0.06% EJS 0.03%
guitar music-notation music-sheet html5 svg javascript guitar-tablature html5-web-audio musicxml alphatab

alphatab's People

Contributors

adamsey avatar allandiego avatar coluzziandrea avatar danielku15 avatar dependabot[bot] avatar dreamzor avatar jonaro00 avatar jordanske avatar kyledecot avatar ldupouey avatar nybbs2003 avatar thoun avatar wassertim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alphatab's Issues

Audio Playback does not work in FireFox (any version)

Hello,

I have tested the audio playback in Chrome, IE 11, and Safari, the player feature works in all these browsers. It does not however work inf Firefox I tested across several different firefox versions and none of them worked.
Is this a known issue?

Cannot set Caret position via API

The old alphaTab player had a method to set the caret position based on time offset. Could we have the same again (or a callback which gives canvas position at which we could draw our own caret) as currently this doesn't seems to be possible using the new API.

Jquery 2.0.2

Hi,

It doesn't work with the new Jquery 2.0.2 because the $.browser doesn't exist anymore

null beatGroup

Using the latest render engine etc and getting the following error on some tabs:

Error: voice.beatGroup is null
At:

alphatab.tablature.model.ScoreStave.prototype.paintTriplet = function(layout,context,voice,x,y) { ... var direction = voice.beatGroup.getDirection();

Thought I could fix it by just initializing it as default, but that created another error:

Error: note is null
At:

alphatab.tablature.model.BeatGroup.prototype.checkNote = function(note) { var value = note.realValue();

Test case

Audio Playback

alphaTab will get a new midi synthesizing engine named alphaSynth.

The actual synthesizing engine is already on a good development state (minor SoundFont2 bugs) but the real problem is bringing this engine into the web.

hello daniel.

hi, Daniel:
I'm glad to see your introduction "He is a guitarist and a software developer and alphaTab is the combination of those two hobbies. "
basically i am like you and want to do similiar thing you have been doing: render guitar nonations on the web, anyone can find nonations and use it on any device: desktop, pad, phone, tv etc. so at least two key feature should included: dynamically render and responsive design.
I find https://github.com/0xfe/vexflow first then your repo second, both seems dedicated to this area. your repo seems maitanance better but i'm not familiar with HAXE, besides cross plateform, it has other benifit towards javascript? it can use the full feature of javascript?
anyway, wanna to say hi and good job.

Not able to get Hammer-on notes to render correctly

I have only tested this with the GDI renderer in WPF control.

I am not sure if I do something wrong, or if there are bugs / missing features related to rendering hammer-on notes.

I am building my own model (from RockSmith 2014 files), but I also noticed that no hammer-ons were rendered when I imported a simple .GP5 file.

I have tried various combinations of properties, but nothing seems to work.

I believe the correct syntax when building the model should be something like this:
note1.isHammerPullOrigin = true;
note2.isHammerPullDestination = true;
note2.hammerPullOrigin = note1;
(note1 belongs to beat1, note2 belongs to beat2. Beats are added sequentially to the same voice.)

The only way I am able to see any result in the renderer is by setting note2.hammerPullOrigin=note2, which leads to a hammer-on line being drawn from note2 to nowhere.

Marker Styling

Introduce a new font style in DrawingResources to support custom marker styling. This should allow some sort of rehearshal letters.

Repeated measures breaks clicking accuracy

For some reason repeated measures are ignored with the new click-to-jump code.

[measure 1] [4 repeated measures] [measure 6] [2 repeated measures] [measure 9]

clicking on measure 6 will result in measure 2 being selected, while clicking on measure 9 results in measure 3 being selected.

Player hangs when paused

An occasional issue that crops up and I can't seem to recreate on demand.. Already tried modifying the applet to send the allsoundsoff event to all channels but it doesn't resolve the problem.

All browsers are affected. When you hit pause, the last note will hang and the browser will become unresponsive. Happens pretty frequently across all tabs.

Support Splitted Rendering in Horizontal Layout

horizontallayout

This is from the unedited demo.

I think it has something to do with memory allocation or a boundary error. It doesnt work when the Bar Count in the left pane is on -1. It works until around 150. higher than 150 (even though there are more bars) the canvas renders white. If you lower the number of stave types being rendered, the bar count can be raised again, suggesting something with memory.

javascript code for json exporter

Iā€™m trying to write simple javascript code for json exporter from guitarpro files based on your code, but iā€™m not that good in programming.
Can you please help me how to use class alphatab.model.Note or other classes to get result for at least one note in format note[1]{string:2,fret:19} as for instance of Canon Rock.

Thank you.

Java applet stutters/stalls on Mac OSX

A longstanding issue that I haven't been able to fix. Initial research seems to suggest that this is a bug in Apple's Java implementation. Some report that it is a Lion-only bug.

Some testing reveals that this is indeed the case:

            import javax.sound.midi.*;
            import java.io.InputStream;
            import java.io.IOException;
            import java.io.FileInputStream;
            import java.io.FileNotFoundException;

            public class MidiPlayer {

              public static void main(String[] args) {
                  try {
                      Sequencer sequencer = MidiSystem.getSequencer();
                      if (sequencer == null)
                          throw new MidiUnavailableException();
                      sequencer.open();
                      FileInputStream is = new FileInputStream("sample.mid");
                      Sequence mySeq = MidiSystem.getSequence(is);
                      sequencer.setSequence(mySeq);
                      sequencer.start();
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
              }
            }

This ultra-simple test demonstrates stuttering/hanging of playback on Mac OSX.

However, TuxGuitar, which is Java based, doesn't exhibit this issue. Poking around the source code reveals that they used a coreaudio wrapper to get reliable audio on OSX. Will work on integrating this into the applet!

Until AlphaSynth is up, we're gonna have to make do with java ):

Note Ties

Note ties should be drawn on the Score Stave. (HammerOn, Tied Note,...)

Long measures break renderer

Seems like if alphatab cannot render a measure within the maximum width set, it generates a blank canvas.

Possibly fixed with the new renderer? Haven't tried it yet.

MIDI generation

Hi Daniel!

I am trying to generate MIDI with alphatab and already implemented some core classes from the TuxGuitar: MidiFileWriter, MidiEvent, MidiMessage, MidiSequence, MidiTrack and rewrited MidiSequenceHandler. I didn't touch MidiSequenceParser. The problem is with strange big size of outputed MIDI. I made a test conversion with clean TuxGuitar code and with my current implementation. You could see tracks data below. The size of a alphaTab converted MIDI array is larger than TuxGuitar converted array (~ 36000 - 41000).

Did you do any significant changes in alphaTab that could make this happen?
It would be great if we could have a Skype chat to discuss other questions and problems.
Thanks for your attention!

P. S.
I've tried to remove makeMixChange() method from MidiSequenceParser, but problem hasn't gone.

Human Abstract - Patterns gp5
-------------------------------------------------------------
Java:

Track size: 68
    Event data length sum: 202

Track size: 2257
    Event data length sum: 6766

Track size: 2257
    Event data length sum: 6766

Track size: 989
    Event data length sum: 2962

Track size: 1520
    Event data length sum: 4555

Track size: 763
    Event data length sum: 2284

-----------------------------------------------------------------
Haxe: 

trackSize: 68
sumDataLength: 202
, 
trackSize: 2281
sumDataLength: 6838
, 
trackSize: 2281
sumDataLength: 6838
, 
trackSize: 1003
sumDataLength: 3004
, 
trackSize: 1534
sumDataLength: 4595
, 
trackSize: 2071
sumDataLength: 6208

GDI rendering freezes UI

Currently the UI freezes for about 3s

Is there any way to get the expensive operations to run in a BackgroundWorker and UI operations to happen in callbacks on the main thread?

screenshot-p142

no dotted rests possible

If you try to make a dotted or doubledotted rest it gets ignored.
This sample:

.
r r{d} r{dd}

will result in three equal rests.

Voice Chain causes previousVoice.Beats[-1] attempt

Voice.cs was throwing an exception when previousVoice.Beats.Count was 0.

beat.PreviousBeat = previousVoice.Beats[previousVoice.Beats.Count - 1];
beat.PreviousBeat.NextBeat = beat;

I managed to get it working by adding a special case

if (previousVoice.Beats.Count > 0)
{
   beat.PreviousBeat = previousVoice.Beats[previousVoice.Beats.Count - 1];
   beat.PreviousBeat.NextBeat = beat;
}
else
{
   beat.PreviousBeat = null;
}

Could it have been caused by empty bars in the song? Or was I doing something else wrong?

Can't parse some files

Hi there,

I was delighted to find alphaTab, it's a very cool piece of software. My use-case for it is simply loading .gpx files so I can print them.

Long story short, it doesn't seem to parse some/many of the files produced by the (Android) mobile app. After debugging it a bit, it seems the problem is that alphaTab is a bit too strict in parsing. Wild guess: the mobile app doesn't clean up the file contents after deleting notes, so the file ends up with "empty" notes that make alphaTab barf; maybe the desktop version does clean up and that's why you haven't seen the issue.

Anyway, as I didn't really want to learn Haxe or install any of the tools and figure them out, I simply debugged and patched the generated Javascript. The patch is very small and simple, so it shouldn't be any problem for you to figure out how to adapt it to the original sources. See https://gist.github.com/3854210 for the raw JS patch.

I haven't written any tests (I haven't even checked if you have tests for this), but I can send you a couple of files that failed but work now, if you want.

Thanks a lot for alphaTab, you rock!

Serializiable Model

The current model has a quite complex structure and several references. It would be great to have some sort of flattened model exporter which creates a simple object hierarchy without functions and stuff (see #50 ). This can model also would need an importer which recreates a valid alphatab.model.Score from it.

The serializable model can be used for several tasks:

  • save and load scores from the file system using some binary or custom text serialization (JSON)
  • save and load scores from a database
  • load scores using WebWorkers

Multi-Track Rendering

It would be great if multiple tracks could be rendered in a single canvas.

Possible implementation:

  1. Add a new renderMultiple(tracks:Array) method.
    https://github.com/CoderLine/alphaTab/blob/master/src/alphatab/rendering/ScoreRenderer.hx#L82
  2. Extend the stave creation to create staves for all tracks
    https://github.com/CoderLine/alphaTab/blob/master/src/alphatab/rendering/layout/ScoreLayout.hx#L61
  3. Extend this method to hint the track which the stave is for:
    addStave(trackIndex:Int, stave:Stave) https://github.com/CoderLine/alphaTab/blob/master/src/alphatab/rendering/staves/StaveGroup.hx#L94
  4. Replace the addBar with a more multi-track variant.
    maybe something like addBar(score:Score, barIndex:Int).
    https://github.com/CoderLine/alphaTab/blob/master/src/alphatab/rendering/staves/StaveGroup.hx
  5. Extend the accolade rendering to render the track names at the beginning.
    https://github.com/CoderLine/alphaTab/blob/master/src/alphatab/rendering/staves/StaveGroup.hx#L150

Basically it will be an additional grouping of the StaveGroup. The BarRenderers will handle a multi track layouting already.

Java problem

When I joined this link http://www.alphatab.net/demo/plugins/player/ I got some java error that

load: class net.alphatab.midi.MidiPlayer.class not found.
java.lang.ClassNotFoundException: net.alphatab.midi.MidiPlayer.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: net.alphatab.midi.MidiPlayer.class

And I download project from github and try to run player on my local, I gave same error..

Java applet crashes Chrome occasionally

Been tracking this issue for a while now, still nowhere close to solving it, but here is what I've found so far.

This crash occurs something like 1/5 of the time when on Google Chrome, and has never occured in firefox.

The crash occurs when the applet is being loaded. Nothing happens, the browser just hangs until you kill the java plugin.

Someone mentioned that the skype toolbar was causing issues: http://www.google.ru/support/forum/p/Chrome/thread?tid=2d8e04e3f25bff69&hl=en

However, uninstalling the toolbar from my browser didn't seem to solve the issue. Was it just a coincidence that both java and the skype plugin failed together?

Log file when everything works normally:

basic: Plugin2ClassLoader.addURL parent called for http://localhost/scripts/alphaTab/alphaTab.jar
security: Blacklist revocation check is enabled
security: Trusted libraries list check is enabled
network: Cache entry found [url: http://localhost/scripts/alphaTab/alphaTab.jar, version: null] prevalidated=false/0
network: Connecting http://localhost/scripts/alphaTab/alphaTab.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
network: Connecting http://localhost/scripts/alphaTab/alphaTab.jar with cookie "[removed]"
network: ResponseCode for http://localhost/scripts/alphaTab/alphaTab.jar : 304
network: Encoding for http://localhost/scripts/alphaTab/alphaTab.jar : null
network: Disconnect connection to http://localhost/scripts/alphaTab/alphaTab.jar
cache: Reading Signers from 0 http://localhost/scripts/alphaTab/alphaTab.jar | C:\Users___\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\43\171902ab-6daccc62.idx
network: No certificate info for unsigned JAR file: http://localhost/scripts/alphaTab/alphaTab.jar
network: No certificate info for unsigned JAR file: http://localhost/scripts/alphaTab/alphaTab.jar
cache:  Read manifest for http://localhost/scripts/alphaTab/alphaTab.jar: read=112 full=112
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 144773 us, pluginInit dt 1959898 us, TotalTime: 2104671 us
basic: Applet initialized
basic: Removed progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@82d37
basic: Applet made visible
basic: Starting applet
basic: completed perf rollup
basic: Applet started
basic: Told clients applet is started
basic: Starting applet teardown
basic: Finished applet teardown

Log file when crash occurs:


security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@82d37
basic: Plugin2ClassLoader.addURL parent called for http://localhost/scripts/alphaTab/alphaTab.jar
security: Blacklist revocation check is enabled
security: Trusted libraries list check is enabled
network: Cache entry found [url: http://localhost/scripts/alphaTab/alphaTab.jar, version: null] prevalidated=false/0
network: Connecting http://localhost/scripts/alphaTab/alphaTab.jar with proxy=DIRECT
network: Connecting http://localhost:80/ with proxy=DIRECT
[Chrome hangs here, after which I killed the browser and the log file continued as follows...]
java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
    at sun.plugin2.message.Pipe.receive(Unknown Source)
    at sun.plugin2.main.client.MessagePassingExecutionContext.doCookieOp(Unknown Source)
    at sun.plugin2.main.client.MessagePassingExecutionContext.getCookie(Unknown Source)
    at sun.plugin2.main.client.PluginCookieSelector.getCookieFromBrowser(Unknown Source)
    at com.sun.deploy.net.cookie.DeployCookieSelector.getCookieInfo(Unknown Source)
    at com.sun.deploy.net.cookie.DeployCookieSelector.get(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.setCookieHeader(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
    at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
    at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
java.io.IOException: namedPipe shutdown
    at sun.plugin2.message.transport.NamedPipeTransport$SerializerImpl.flush(Unknown Source)
    at sun.plugin2.message.transport.NamedPipeTransport.signalDataWritten(Unknown Source)
    at sun.plugin2.message.transport.SerializingTransport.write(Unknown Source)
    at sun.plugin2.message.Pipe.send(Unknown Source)
    at sun.plugin2.main.client.MessagePassingExecutionContext.getProxyList(Unknown Source)
    at sun.plugin2.main.client.PluginProxySelector.select(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at sun.net.NetworkClient.doConnect(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.openServer(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
    at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
    at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
    at com.sun.deploy.cache.DeployCacheHandler.get(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
    at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$800(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
network: Connecting http://localhost:80/ with proxy=DIRECT
network: ResponseCode for http://localhost/scripts/alphaTab/alphaTab.jar : 304
network: Encoding for http://localhost/scripts/alphaTab/alphaTab.jar : null
network: Disconnect connection to http://localhost/scripts/alphaTab/alphaTab.jar
cache: Reading Signers from 0 http://localhost/scripts/alphaTab/alphaTab.jar | C:\Users___\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\43\171902ab-6daccc62.idx
network: No certificate info for unsigned JAR file: http://localhost/scripts/alphaTab/alphaTab.jar
network: No certificate info for unsigned JAR file: http://localhost/scripts/alphaTab/alphaTab.jar
cache:  Read manifest for http://localhost/scripts/alphaTab/alphaTab.jar: read=112 full=112

Editor sample bug

The editor sample "bin/js/demo/editor.html" in the github project has a script error, with the last version of alphatab.js it worked, but with the new version don't

getSongMidiData not return full data in some cases

when song contains reprises with length 2 measure MidiRepeatController ommit them (in first measure repeat open, in next close). _repeatNumber not increments in this case.

    if(this._repeatOpen && this._repeatAlternative > 0 && (this._repeatAlternative & 1 << this._repeatNumber) == 0) {
        this.repeatMove -= header.length();
        if(header.repeatClose > 0) {
            this._repeatAlternative = 0;
        }
        this.shouldPlay = false;
        this.index++;
        return;
    }

Here, previously _repeatNumber was reset to 0 . When _repeatNumber = 0 , (this._repeatAlternative & 1 << this._repeatNumber) == 0) always true. So we omit everything from that moment and to the very end. I do not understand logic very well to correct this part.

Blank canvas in Firefox4

If hardware acceleration is turned on in FF4, canvas sizes appear to be limited and alphatab fails to render larger tablatures.

Possibly circumvented by using SVG instead?

Memory leak in WPF GDI Control

While using the control in a WPF project I ran into various out-of-memory exceptions after rendering several Scores.

It seems like memory for the previous generated bitmap is not released when a new bitmap is generated.

The code below is taken from OnRenderFinished in AlphaTabGdi.cs:

        using (Bitmap bitmap = ((GdiCanvas)_renderer.canvas).getImage())
        {
            Source = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                bitmap.GetHbitmap(),
                IntPtr.Zero, Int32Rect.Empty,
                BitmapSizeOptions.FromWidthAndHeight(bitmap.Width, bitmap.Height));
            Width = bitmap.Width;
            Height = bitmap.Height;
        }

As far as I have understood, the call to bitmap.GetHbitmap() gives a pointer to unmanaged memory that must be freed after use.

I applied the following quick-fix / workaround.

    [System.Runtime.InteropServices.DllImport("gdi32.dll")]
    public static extern int DeleteObject(IntPtr hObject);

    IntPtr _currentlyAllocatedBitmap = IntPtr.Zero;

    // This method raises the Tap event 
    protected virtual void OnRenderFinished()
    {
        using (Bitmap bitmap = ((GdiCanvas)_renderer.canvas).getImage())
        {
            if (_currentlyAllocatedBitmap != IntPtr.Zero) 
             {
                DeleteObject(_currentlyAllocatedBitmap);
                _currentlyAllocatedBitmap=  IntPtr.Zero;
             }

            _currentlyAllocatedBitmap=bitmap.GetHbitmap();
            Source = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                _currentlyAllocatedBitmap,
                IntPtr.Zero, Int32Rect.Empty,
                BitmapSizeOptions.FromWidthAndHeight(bitmap.Width, bitmap.Height));

            Width = bitmap.Width;
            Height = bitmap.Height;
        }

        RoutedEventArgs newEventArgs = new RoutedEventArgs(RenderFinishedEvent);
        RaiseEvent(newEventArgs);
    }

This quick-fix is far from perfect, and memory may probably still leak in some cases, but it solved the problems I were experiencing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.