void RA_addNote_FloatPlace( int blocknum, int tracknum, float start, int notenum, float volume, float end) { struct Blocks *block=SWIG_getBlock(blocknum); struct Tracks *track=SWIG_getTrack(blocknum,tracknum); struct Notes *note; Place p2; if(track==NULL) return; note=NewNote(); Float2Placement(start,¬e->l.p); Float2Placement(end,¬e->end); PlaceSetLastPos(block,&p2); if(PlaceGreaterOrEqual(¬e->l.p,&p2)) return; if(PlaceGreaterOrEqual(¬e->end,&p2)){ PlaceCopy(¬e->end,&p2); } note->note=notenum; note->velocity=boundaries( volume*(*track->instrument->getMaxVelocity)(track), 0, (*track->instrument->getMaxVelocity)(track) ); ListAddElement3(&track->notes,¬e->l); }
INT_PTR PluginMenuCommandAddNew(WPARAM w, LPARAM l) { STICKYNOTE *PSN = NewNote(0,0,0,0,NULL,NULL,TRUE,TRUE,0); if(PSN) SetFocus(PSN->REHwnd); return 0; }
void JamCracker::Play(void) { if (--waitCnt == 0) { NewNote(); waitCnt = wait; } SetChannel(&variables[0]); SetChannel(&variables[1]); SetChannel(&variables[2]); SetChannel(&variables[3]); }
struct Notes *InsertNote( struct WBlocks *wblock, struct WTracks *wtrack, Place *placement, Place *end_placement, float notenum, int velocity, bool polyphonic ){ struct Blocks *block=wblock->block; struct Tracks *track=wtrack->track; struct Notes *note=NewNote(); //((char*)note)[-5] = 'b'; // test memory validator PlaceCopy(¬e->l.p,placement); note->note=notenum; note->velocity=velocity; // note->velocity=(*wtrack->track->instrument->getStandardVelocity)(wtrack->track); note->velocity_end=note->velocity; PLAYER_lock(); { ListAddElement3(&track->notes,¬e->l); if(polyphonic==false) StopAllNotesAtPlace(block,track,placement); if (end_placement==NULL) SetEndAttributes(block,track,note); else PlaceCopy(¬e->end, end_placement); track->notes = NOTES_sort_by_pitch(track->notes); } PLAYER_unlock(); NOTE_validate(block, NULL, note); return note; }
// load all songs from ROM into memory void GlobalData::LoadSongs() { u16 checkmagic=0; offset = 0; REG_IME = 0; // disable interrupts debug("Loading songs."); // black = starting SetBG(0, 0, 0); ReadNumber(&checkmagic, sizeof(u16)); // check first if there is any saved data in the databank if (checkmagic == magic) { // until we find the end of the songs while (!CheckMagic()) { // red = song SetBG(10, 0, 0); // start a new song debug("Creating a new song struct."); NewSong(); debug("Reading basic song data."); // read in the song name ReadString(¤tsong->name); debug("Song Name: %s", currentsong->name); // write bpm ReadNumber(¤tsong->bpm, sizeof(u16)); debug("Song Speed: %d", currentsong->bpm); // until we find the end of the loops while (!CheckMagic()) { // green = loop SetBG(0, 10, 0); // create a new loop debug("Creating a new loop struct."); NewLoop(); debug("Reading basic loop data."); // write the loop name ReadString(¤tloop->name); // write the sample number ReadNumber(¤tloop->sample, sizeof(u16)); // write the panning direction ReadNumber(¤tloop->pan, sizeof(bool)); // write the pitch ReadNumber(¤tloop->pitch, sizeof(u16)); // write the number of divisions ReadNumber(¤tloop->divisions, sizeof(u16)); while (!CheckMagic()) { // blue = note SetBG(0, 0, 10); // create a new note debug("Creating a new note struct."); NewNote(); debug("Reading basic note data."); // write the note end action; ReadNumber(¤tnote->noteEnd, sizeof(u8)); // write the beat offset ReadNumber(¤tnote->offset, sizeof(u8)); // write the pitch ReadNumber(¤tnote->pitch, sizeof(u8)); // write the swing ReadNumber(¤tnote->swing, sizeof(u8)); } } } } // if we don't have a default song set yet if (!songdata) { debug("No load data; creating a new song."); NewSong(); } REG_IME = 1; // enable interrupts }