Click here to Skip to main content
15,892,059 members
Articles / Artificial Intelligence

Developing MIDI applications with DirectMusic

Rate me:
Please Sign up or sign in to vote.
4.91/5 (45 votes)
11 Apr 2008LGPL325 min read 612.4K   9.5K   147  
A wrapper class library for the DirectMusic MIDI.
// Octave.h: interface for the COctave class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OCTAVE_H__292BCB61_52E6_11D6_AA7A_00105A212DC5__INCLUDED_)
#define AFX_OCTAVE_H__292BCB61_52E6_11D6_AA7A_00105A212DC5__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Object.h"
#include "Key.h"


class COctave:public CObj  
{
protected:
	CDC *m_dc;	// Pointer to the dialog DC
	CKey m_key[12];	// Array of 12 key objects of a octave
	CDC m_memDC;	// Memory DC	
	CBitmap m_bmp;	
	BlitKey(int numKey);
public:
	struct note_info	// note info structure to store info about keys
	{
		char note;
		int key;
		int octave;
	};
	
	COctave();
	virtual ~COctave();
	Initialize(CDC *pDC,int px,int py);
	SetRange(unsigned char LoRange);
	note_info IsKeyPressed(int x,int y);
	Draw();
	DrawOnKey(int numKey);
	Blit();
	ReleaseKey(int numKey);
	unsigned char GetKeyNote(int numKey) { return m_key[numKey].m_note; } 
};

#endif // !defined(AFX_OCTAVE_H__292BCB61_52E6_11D6_AA7A_00105A212DC5__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Software Developer
Spain Spain
I obtained my PhD degree in Computer Graphics at the National Distance Education University (UNED) in October 2019. I also hold a Ms. degree in Software Engineering and Computer Systems and a Bs. degree in Computer Science from the National Distance Education University (UNED).
I have been employed as a C++ software developer in several companies since year 2000.
I currently work as a Tutor-Professor of Symbolic Logic, Discrete Math and Java Object-Oriented Programming at UNED-Cartagena (Spain) since 2015.

Comments and Discussions