|
use the search feature in CodeProject to see some articles. Trust me...
the best way to learn is to start learning.
|
|
|
|
|
Hello,
I am searching for BPM (Beat per Minute) Library. I want to use it in my robot, using c# only.
I found "adionsoft.net" but it's not good.
Any Help.
Tx.
|
|
|
|
|
What do you need to do? Get BPM from an audio file, parse a MIDI file for tempo data or MTC, generate beats for a given tempo...
All of these things (maybe with an exception of the first) are reasonably trivial to code from scratch and I don't know of any library for any of these.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Tx for replying,
i need to get the bpm from an audio file (not microphone)
|
|
|
|
|
This is never going to be 100% accurate but should suffice for most purposes.
The first thing you will need to ascertain is the sample rate. Once you have that, scan sections of the file for regularly spaced pulses at lower frequencies. This will typically be a bass / bass drum etc. Depending on the style these may or not indicate the actual beats! I would then check for the highest amplitudes in these - you can almost guarantee that the ones with the greastest amplitutde will be the first beat in each bar - or every other bar. Knowing this isn't critical for calculation of BMP but will enable you to calculate time signature (by counting the beats in between each 'first' beat) and work out whether to ignore certain peaks that may appear to beats but actually aren't.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
tx but i really need already programed (library (.dll), cs....)
i don't have time to prog.
tx
|
|
|
|
|
Then you neet to google some more. Maybe you need to adjust your search terms to include things such as audio frequency analysis etc.
Asking in a programming forum is going to get you a programming response.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Tx i tried but nothing new.
|
|
|
|
|
I do also searched the web for this topic cause I'm going to write my master thesis about estimating bpm. As far as I can say, the accuracy of tempo estimation depends of the kind of music you examine. Music with strong beats (techno, house, dance) is quite nice to estimate for its almost suficcient to autocorrelate over energy derivations. Classical music on the other hand is much harder to estimate, given that the tempo is hardly ever constant in classical or jazz music. And you have also to consider that known methods for tempo estimation don't have good performance on slow music for they tend to double the true tempo.
I'd like to implement some really working BPM detection, but I'm wondering which is the best (free) audio lib for .net to start from. I've tried using NAudio for reading Audio files and then Math.Net to do some processing stuff with it, but I'm interested if there are better libs to start from.
|
|
|
|
|
Hello everyone,
I'm new to the forum and this is only my second post, so I apologize in advance for any mistakes.
This is my situation:
I'm using Microsoft Visual Studio 2008 with .Net Framework 3.5.
I'm developing an extension of the Windows Shell Context menu, and I did it, but I have a problem:
when my menu is invoked on the links (*.lnk), it doesn't work and prevents the upper voices.
This only occurs on Vista and Seven, not on XP.
This is the IContextMenu.QueryContextMenu:
int IContextMenu.QueryContextMenu(uint hmenu,
uint iMenu,
int idCmdFirst,
int idCmdLast,
uint uFlags)
{
StringBuilder sb = new StringBuilder(1024);
DllImports.DragQueryFile(m_hDrop, 0, sb, sb.Capacity + 1);
if (new FileInfo(sb.ToString()).Extension == ".lnk") { return 1; }
for (int i = 0; i < Menus.Length; i++)
{
Menus[i].MenuItemInfo.wID += idCmdFirst;
if (Menus[i].SubMenu != null) { PopolateSubMenu(Menus[i], idCmdFirst); }
DllImports.InsertMenuItem(hmenu, Menus[i].Position - 1, 1, ref Menus[i].MenuItemInfo);
if (Menus[i].Image != null) {
System.Drawing.Bitmap Bmp = Menus[i].Image;
DllImports.SetMenuItemBitmaps((IntPtr)hmenu, (IntPtr)(Menus[i].Position - 1), 0x400, Bmp.GetHbitmap(), Bmp.GetHbitmap());
}
}
return (int)(NumeroMenu + 1);
}
I don't know what to do!
Please help me!
Thank you in advance for your help!
PS: I apologize for my bad English, too: I'm Italian!
|
|
|
|
|
|
Hi All,
I've recently been given the task to create a program in C# that retrieves a given user's email attachments and place them in a local folder. The first step I'm researching is how do I initially connect to the mail server when our mail is hosted by Rackspace? Should I be able to use EWS commands? If not is there some other way I can access a user's mail via c#?
I've tried the following:
http://www.omegacoder.com/?p=454[^]
But get the warning message:
An unhandled exception of type 'Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException' occurred in Microsoft.Exchange.WebServices.dll
Additional information: The Autodiscover service could not be located.
It's possible I set the "AutodiscoverUrl" incorrectly, I just put my email address as it states.
Any help on this would be great.
Thanks in advance,
Mel
|
|
|
|
|
Hi,
I found this step-by-step guide on how to connect to a POP3 server using Telnet. I was able to connect following the steps on the command line and when creating the c# program.
http://www.geekpedia.com/tutorial172_Connecting-to-a-POP3-server-using-Csharp.html[^]
This is great so now at least I know i'm dealing with a POP3 server. The thing is I want to get the attachments from the emails. Does anyone know the Telnet commands I can use to achieve this? If not maybe you know an alternative way to connect to a POP3 server to get email attachments?
Thanks,
Mel
|
|
|
|
|
Will this[^] article help?
/ravi
|
|
|
|
|
Ravi,
Thank you for the reply. Although I didn't get the answer I was looking for the link was very informative.
Thanks
|
|
|
|
|
Hi, did you get this to work? Im trying to do something similar here
|
|
|
|
|
Hi,
In my code I have interactions with a WPF control, so using Invoke I am able to call my functions, the problem I am having is that the code inside the function throws an exception, and I was wondering if it is possible to move the exception across the Invoke call. so that my code in the calling thread can handle it.
here is my code which hopefully shows the problem better:
<br />
public void SetProperty(String Path, String Value)<br />
{<br />
if (!this.Dispatcher.CheckAccess())<br />
{<br />
Exception exception = null;<br />
this.Dispatcher.Invoke((Action<String, String>)((path, val) => { <br />
<br />
try<br />
{<br />
SetProperty(path, val);
}<br />
catch (System.Exception e)<br />
{<br />
exception = e;<br />
}<br />
}), Path, Value, exception);<br />
if(exception != null){<br />
MessageBox.Show(exception.Message);<br />
}<br />
unfortunately this code doesn't work and I was wondering if there was a way around it.
Thank you in advance.
|
|
|
|
|
You could try putting the call to the Invoke in a try/catch and looking at the inner exception.
Not sure if it will work.
|
|
|
|
|
Thank you for the reply, I'm afraid that I have already tried that and it didn't work
|
|
|
|
|
At the top level, you can subscribe to AppDomain.CurrentDomain.UnhandledException , otherwise you pretty much have to catch the exception on the thread it was raised on AFAIK.
You can pass the exception by raising an event that takes an Exception as a parameter, then doing the updates to the UI via the subscribing method (remembering to do this on the Dispatcher Thread):
Action<Exception> ExceptionRaised;
public void SetProperty(String Path, String Value)
{
if (!this.Dispatcher.CheckAccess())
{
Exception exception = null;
this.Dispatcher.Invoke((Action<String, String>)((path, val) =>
{
try
{
SetProperty(path, val);
}
catch (System.Exception e)
{
exception = e;
}
}), Path, Value, exception);
}
public Constructor
{
ExceptionRaised += UpdateStatus;
}
void UpdateStatus(Exception exception)
{
if(exception == null)
return;
if (Thread.Current != Dispatcher.Current.Thread)
{
this.Dispatcher.Invoke(new Action<string>(UpdateStatus), new object[]{exception});
return;
}
MessageBox.Show(exception.Message);
}
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Hi,
I have a custom class CReadCDD where I intend to do some processing.
I placed the callbacks also inside this class (like mLoadXmlOnHeap_WorkThread).
From the Form class I instantiate my CReadCDD class and create the thread with call to mLoadXmlOnHeap_WorkThread.
In mLoadXmlOnHeap_WorkThread (not to have an additional proprty for the Form, I send an event to the Form class with the text I want as event args); the event is received in the Forms class, it goes to mfHandleCustomEvent_PrintRichTextConsole but here after entering
in Invoke method IT BLOCK my Form. The richtext control is not updated.
Where I did the mistake?
I read the MSDN but still I have problem to access the control from my thread
George
public class CReadCDD
{
private CProcessXMLdoc mdoc;
private string mFileName;
public RichTextBox pRichTextBox1 {get; set;}
public event EventHandler<CCustomEventArgs> RaiseCustomEvent;
protected void pOnRaiseCustomEvent(CCustomEventArgs pEv)
{
EventHandler<CCustomEventArgs> handler = RaiseCustomEvent;
if (handler != null)
handler(this, pEv);
}
public CReadCDD(string pFileName, Form1 pForm)
{
mFileName= pFileName;
}
#region Worker Threads
public void mLoadXmlOnHeap_WorkThread()
{
mdoc = new CProcessXMLdoc(mFileName);
CCustomEventArgs evObj= new CCustomEventArgs("Load The XML Data from Cdd file on the HEAP\n");
pOnRaiseCustomEvent(evObj);
}
}
namespace CddToCaplDiagnosticTestsGenerator
{
public partial class Form1 : Form
{
private CReadCDD objReadCdd;
public delegate void DelegateTypePrntText(string text);
public DelegateTypePrntText mdelT;
public Form1()
{
mdelT = new DelegateTypePrntText(mSetTextToRichTextControl);
InitializeComponent();
}
void mfHandleCustomEvent_PrintRichTextConsole(object sender, CCustomEventArgs e)
{
byte debug=0;
string text = e.pTextBox;
if (this.richTextBox1.InvokeRequired)
{
this.Invoke (mdelT, new object[] { text + " (Invoke)" });
}
else
richTextBox1.AppendText("No Invoke");
}
void mSetTextToRichTextControl(string pText)
{
richTextBox1.AppendText("Inner thread");
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = "c:\\";
openFileDialog1.Filter = "Cdd files (*.cdd)|*.cdd";
openFileDialog1.FilterIndex = 2;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
string filename = openFileDialog1.FileName;
try
{
objReadCdd= new CReadCDD(filename, this);
objReadCdd.RaiseCustomEvent += mfHandleCustomEvent_PrintRichTextConsole;
#region LoadXMLinMemory
objReadCdd.pRichTextBox1= richTextBox1;
Thread thrdLoadXmlOnHeap = new Thread(objReadCdd.mLoadXmlOnHeap_WorkThread);
thrdLoadXmlOnHeap.Start();
thrdLoadXmlOnHeap.Join();
#endregion
#region Load Data in the CData tree
#endregion
}
catch (Exception ex)
{
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
}
}
}
}
}
<
modified on Thursday, March 25, 2010 9:09 AM
|
|
|
|
|
After the first look I would say thrdLoadXmlOnHeap.Join(); is your problem.
After you started your thread from your main/guithread your main/guithread waits for the end of
the thread you started. This blocks your ui.
At first I would try just to comment this line out.
Greetings
Covean
|
|
|
|
|
|
You are welcome.
Greetings
Covean
|
|
|
|
|
hey,
I've a dictionary, which i sorted by value with linq, how can i get those sorted value from the sorted result i get
that's what i did so far
Dictionary<char, int> lettersAcurr = new Dictionary<char, int>();
var sortedDict = (from entry in lettersAcurr orderby entry.Value descending select entry);
during the debug i can see that sortedDic has a KeyValuePar, but i cant accesses to it
thanks for help
|
|
|
|
|