Page 2 of 3

Re: Go Audio Lesson Tool

Posted: Fri Jun 25, 2010 11:37 am
by Harleqin
ethanb wrote:
Harleqin wrote:That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.


I was talking about the conceptual level. Yes, it is possible to do it with time stamps mangled into the SGF file, but it has to be compared to the alternative, which is much easier to parse and write (example syntax):

Code: Select all

(00:00:00 sgf 0 (;GM[1]...
  ))
(00:00:10 next-node)
(00:00:12 next-node)
(00:00:14 next-node)
(00:00:18 next-node)
(00:00:30 jump-to-node 58)
(00:01:03 mark-circle c i)
(00:03:54 move black c j)
.
.
.
(00:24:27 sgf 1 (;GM[1]...
  ))
(00:25:43 jump-to-node 34)
(00:27:05 jump-to-sgf 0)
.
.
.


This format describes what is actually supposed to happen, and seems much more flexible to me. Anyway, what I am aiming at is that the teacher's actions are orthogonal to the SGF tree. You might be successful in trying to press them into the tree itself, but I think that the way I show above is much easier to understand and implement. Still in other words: the SGF file is contained in the lesson, not the other way around (there may even be more than one SGF file in a lesson, as shown above).

Li Kao seems to use a similar approach.

Re: Go Audio Lesson Tool

Posted: Fri Jun 25, 2010 5:59 pm
by ethanb
Harleqin wrote:
ethanb wrote:
Harleqin wrote:That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.


I was talking about the conceptual level. Yes, it is possible to do it with time stamps mangled into the SGF file, but it has to be compared to the alternative, which is much easier to parse and write (example syntax):

Code: Select all

(00:00:00 sgf 0 (;GM[1]...
  ))
(00:00:10 next-node)
(00:00:12 next-node)
(00:00:14 next-node)
(00:00:18 next-node)
(00:00:30 jump-to-node 58)
(00:01:03 mark-circle c i)
(00:03:54 move black c j)
.
.
.
(00:24:27 sgf 1 (;GM[1]...
  ))
(00:25:43 jump-to-node 34)
(00:27:05 jump-to-sgf 0)
.
.
.


This format describes what is actually supposed to happen, and seems much more flexible to me. Anyway, what I am aiming at is that the teacher's actions are orthogonal to the SGF tree. You might be successful in trying to press them into the tree itself, but I think that the way I show above is much easier to understand and implement. Still in other words: the SGF file is contained in the lesson, not the other way around (there may even be more than one SGF file in a lesson, as shown above).

Li Kao seems to use a similar approach.


It's more flexible in terms of what you can do with it, for sure - I was just saying he could get SGF import and export "for free" this way and if his file structure on disk is in a similar format (of course the memory structures should be as you describe when loaded from disk, which is also what I said in my earlier post with the example) then his entire file-processing function set becomes pretty clean. I like reusable code. :)

Re: Go Audio Lesson Tool

Posted: Sat Jun 26, 2010 3:00 am
by Harleqin
ethanb wrote:It's more flexible in terms of what you can do with it, for sure - I was just saying he could get SGF import and export "for free" this way and if his file structure on disk is in a similar format (of course the memory structures should be as you describe when loaded from disk, which is also what I said in my earlier post with the example) then his entire file-processing function set becomes pretty clean. I like reusable code. :)


What is clean about sprinkling the actions (which are linear in time and orthogonal to the game tree) into the game tree? Your file parsing would have to collect the actions together and sort them, and your file writing would have to distribute them into the different nodes.

I guess that you want to put this mangling code before the SGF writing, so that you can reuse the SGF writing code. I want the SGF writing before the lesson file writing code, so I get to reuse, too.
:ugeek:

Re: Go Audio Lesson Tool

Posted: Sun Jun 27, 2010 12:15 pm
by Li Kao
I now have image recognition which creates screenshots of a kgs window and recognizes the stones and markers(Triangle,Circle,Square) in them.
And I have basic sgf loading support.
So I have to figure out how to combine the scanned data with a sgf-file of the game and the audio to create an actual replay of a KGS (teaching) game.

Re: Go Audio Lesson Tool

Posted: Mon Jun 28, 2010 3:55 am
by FrankdeGroot
Moyo Go Studio has the ability to record audio (using speex). The advantage is that the audio is included as standard SGF. Moyo Go can be freely downloaded.

Re: Go Audio Lesson Tool

Posted: Mon Jun 28, 2010 9:42 am
by Li Kao
FrankdeGroot wrote:Moyo Go Studio has the ability to record audio (using speex). The advantage is that the audio is included as standard SGF. Moyo Go can be freely downloaded.

Adding an audio comment to individual nodes and recording a whole teaching game with jumps in the sgf and continuous audio is a pretty different use-case. So I don't think these functions can replace each other.

Re: Go Audio Lesson Tool

Posted: Tue Jul 13, 2010 3:54 am
by Li Kao
Sourcecode is available at github:
http://github.com/CodeInChaos

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 4:41 am
by Li Kao
New Release:
Download Alpha 1

New Features:
* Can use image recognition to record games from other programs
* Basic SGF-Importer
* Support for multiple board-sizes

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 5:17 am
by topazg
Does anyone have a game they'd like me to review to test this? I'm keen to give it a go ...

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 5:39 am
by Li Kao
I'm not sure if it's stable enough to risk a full game review. The current versions are mainly for technical testing and bug searching.

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 6:23 am
by topazg
When I try to import an .sgf file I get the following:

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Model.GraphicalGameTree.PositionOfNode(Int32 node)
   at GoClient.GameForm.RenderField()
   at GoClient.GameForm.timer1_Tick(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3607 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GoClient
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/GoClient.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
CommonGui
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/CommonGui.DLL
----------------------------------------
Model
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/Model.DLL
----------------------------------------
ChaosUtil
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/grahamp/Desktop/GAL/ChaosUtil.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 3:19 pm
by Li Kao
Added a few bugfixes
Download Alpha 2
Fixed the exception in the sgf importer and a few more bugs.

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 5:45 pm
by wms
For the KGS lectures and Guo Juan's teaching site, I used an XML format that embeds changes to an SGF file. Something like this:

<addproperty nodeid="10" sgf="W[ae]"/>
<pause time="63943">
<addnode parentid="10" nodeid="11"/>
<addproperty nodeid="11" sgf="B[cj]TR[cj]"/>
<speex>98g74293p40231940923490 (imagine that this is a chunk of base64 data) oqeuth233dtoe</speex>

etc...the "speex" tags delimit base64 encoded speex data. Then I take the whole big XML file and zip it up. The sizes end up pretty tolerable, because zip gets rid of most of the overhead from XML and speex is very low bit rate.

But of course for a new project, do whatever seems best. :)

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 6:06 pm
by fwiffo
I thought about writing a programming blog named <xml verbosity="verbosity">XML Verbosity</xml>. :-)

Re: Go Audio Lesson Tool

Posted: Thu Jul 15, 2010 11:43 pm
by CarlJung
wms wrote:For the KGS lectures and Guo Juan's teaching site, I used an XML format that embeds changes to an SGF file. Something like this:

<addproperty nodeid="10" sgf="W[ae]"/>
<pause time="63943">
<addnode parentid="10" nodeid="11"/>
<addproperty nodeid="11" sgf="B[cj]TR[cj]"/>
<speex>98g74293p40231940923490 (imagine that this is a chunk of base64 data) oqeuth233dtoe</speex>

etc...the "speex" tags delimit base64 encoded speex data. Then I take the whole big XML file and zip it up. The sizes end up pretty tolerable, because zip gets rid of most of the overhead from XML and speex is very low bit rate.

But of course for a new project, do whatever seems best. :)


Simple and elegant. You use xml in all it's glory and reuse your sgf parser from kgs. Now if we only could get rid of sgf completely...