Exemplo n.º 1
0
RBuffer* makeRBufferOptions(size_t startSize, size_t objectCount) {
    RBuffer *object = allocator(RBuffer);
    if(object != nil) {
        // allocation of buffer
        master(object, RData) = makeRDataBytes(arrayAllocator(byte, startSize), startSize);
        if(master(object, RData) != nil) {

            // allocation of sizes array
            object->sizesArray = arrayAllocator(RRange, objectCount);

            if(object->sizesArray  != nil) {
                object->classId     = registerClassOnce(toString(RBuffer));
                object->freePlaces  = objectCount;
                object->count       = 0;
                object->totalPlaced = 0;
#ifdef RAY_BUFFER_THREAD_SAFE
                mutexWithType(&object->mutex, RMutexRecursive);
#endif
            } else {
                RError("RBuffer. Allocation of sizes array failed.", object);
                deleter(master(object, RData), RData);
            }
        } else {
            RError("RBuffer. Allocation of master RData failed.", object);
            deallocator(object);
            object = nil;
        }
    }
    return object;
}
Exemplo n.º 2
0
float lineDuration(int line, int tracknum, int blocknum, int windownum){
  struct Tracker_Windows *window;
  struct WBlocks *wblock;
  struct WTracks *wtrack = getWTrackFromNumA(windownum, &window, blocknum, &wblock, tracknum);
  if (wtrack==NULL)
    return 1.0;

  struct Blocks *block = wblock->block;
  
  if (line < 0){
    RError("lineDuration: Line must be 0 or larger: %d",line);
    return 1.0;
  }

  if (line >= block->num_lines){
    RError("lineDuration: Line must be less than the number of lines: %d >= %d or larger: %d",line, block->num_lines);
    return 1.0;
  }
  
  Place p1 = {line, 0, 1};
  Place p2 = {line+1, 0, 1};

  STime s1 = Place2STime(block, &p1);
  STime s2 = Place2STime(block, &p2);

  return (double)(s2-s1) / (double)MIXER_get_sample_rate();
}
Exemplo n.º 3
0
void GFXS_BitBltType(
		     void (*GFX_P_OSFunc)(
					  struct Tracker_Windows *window,
					  int dx,int dy,
					  int x,int y,
					  int x2,int y2
					  ),
		     struct Tracker_Windows *window,
		     int dx,int dy,
		     int x,int y,
		     int x2,int y2
		     )
{
  struct WBlocks *wblock=window->wblock;

  if(GFXS_EnsureBoundaries(window,"GFXS_BitBltType",x,y,x2,y2)==false){
    OS_GFX_CancelMixColor(window);
    return;
  }

  if(x+dx<0){
    x=dx;
  }
  if(x+dx>=wblock->a.x2){
    RError("Error in function GFXS_BitBltType. x+dx>wblock->a.x2: %d,%d,%d\n",x,dx,wblock->a.x2);
    return;
  }

  if(x2+dx<0){
    RError("Error in function GFXS_BitBltType. x2+dx<0: %d,%d\n",x2,dx);
    return;
  }

  if(x2+dx>=wblock->a.x2){
    x2=wblock->a.x2-dx-1;
  }


  if(GFXS_EnsureBoundaries(window,"GFXS_BitBltType2",x,y,x2,y2)==false){
    OS_GFX_CancelMixColor(window);
    return;
  }
  
  (*GFX_P_OSFunc)(
		  window,
		  dx,dy,
		  x,y,
		  x2,y2
		  );
}
Exemplo n.º 4
0
void *ListFindElement1(const struct ListHeader1 *list,NInt num){
	NInt lastnum;

	while(list!=NULL && list->num<=num){
		lastnum=list->num;
		if(list->num==num) return (void*)list;
		list=list->next;
		if(list!=NULL && lastnum+1!=list->num){
			RError("Warning. In function 'ListFindElement1' in file 'list.c'. Strange list. Last: %d, now: %d\n",lastnum,list->num);
		}
	}

	RError("Warning. In function 'ListFindElement1' in file 'list.c'. Could not find element %d.\n",num);
	return NULL;
}
Exemplo n.º 5
0
static void set_effect_value(struct SoundPlugin *plugin, int64_t time, int effect_num, float value, enum ValueFormat value_format, FX_when when){
  Data *data = (Data*)plugin->data;

  if(value_format==PLUGIN_FORMAT_SCALED){
    switch(effect_num){
    case EFF_PITCH:
      data->pitch = scale(value,0.0f,1.0f,0,16383);
      //printf("Setting Pitch to %d\n",(int)data->pitch);
      sendpitchbend(data,0,data->pitch,time);
      break;
    case EFF_PITCH_RANGE:
      data->pitch_range = scale(value,0.0f,1.0f,1,48);
      fluid_synth_pitch_wheel_sens(data->synth,0,data->pitch_range);
      break;
    case EFF_MODULATION:
      data->modulation = value * 127;
      sendcontrolchange(data,0,1,data->modulation,time);
      break;
    case EFF_SUSTAIN_PEDAL:
      data->sustain_on = value*127;
      sendcontrolchange(data,0,64,data->sustain_on,time);
      break;
    default:
      RError("Unknown effect number %d\n",effect_num);
    }
  }else{
    switch(effect_num){
    case EFF_PITCH:
      data->pitch = value;
      sendpitchbend(data,0,value,time);
      break;
    case EFF_PITCH_RANGE:
      data->pitch_range = value;
      fluid_synth_pitch_wheel_sens(data->synth,0,value);
      break;
    case EFF_MODULATION:
      data->modulation = value;
      sendcontrolchange(data,0,1,value,time);
      break;
    case EFF_SUSTAIN_PEDAL:
      data->sustain_on = value;
      sendcontrolchange(data,0,64,value,time);
      break;
    default:
      RError("Unknown effect number %d\n",effect_num);
    }
  }
}
Exemplo n.º 6
0
void GFX_PP_Update(struct Patch *patch, bool is_loading){
  printf("GFX_PP_Update %s\n", patch==NULL?"(null)":patch->name);
  
  called_from_pp_update = true;{
    //if(g_currpatch==patch)
    //  goto exit;
    if(patch==NULL){

      //g_instruments_widget->tabs->showPage(no_instrument_widget);

    }else if(patch->instrument==get_MIDI_instrument()){
      printf("PP update. Instrument name: \"%s\". port name: \"%s\"\n",patch==NULL?"(null)":patch->name,patch==NULL?"(null)":((struct PatchData*)patch->patchdata)->midi_port->name);

      MIDI_instrument_widget *instrument = get_midi_instrument_widget(patch);
      if(instrument==NULL){
        instrument = create_midi_instrument(patch);
        //instrument = get_midi_instrument_widget(patch);
      }

      update_midi_instrument_widget(instrument,patch);
      
      g_instruments_widget->tabs->setCurrentWidget(instrument);
      MW_update_all_chips();

      MIDI_SetThroughPatch(patch);

    }else if(patch->instrument==get_audio_instrument()){
      Audio_instrument_widget *instrument = get_audio_instrument_widget(patch);
      if(instrument==NULL){
        fprintf(stderr,"                 WARNING: patch %s didn't have an instrument widget. Creating one now. (Might happen when loading song or starting up. Nothing is wrong if that is the case)\n",patch->name);
        instrument = create_audio_instrument_widget(patch, true);
        //instrument = get_audio_instrument_widget(patch);
      }
      
      update_audio_instrument_widget(instrument,patch);
      g_instruments_widget->tabs->setCurrentWidget(instrument);
      //if (instrument->_sample_requester_widget != NULL && !is_loading)
      //  instrument->_sample_requester_widget->update_file_list_if_needed();

      MW_update_all_chips();      

      MIDI_SetThroughPatch(patch);

    }else if(patch->instrument!=NULL){
      RError("PP_Update: Don't know how to handle instrument %p",patch->instrument);
    }

    // background color for editor tracks assigned to current instrument are slightly different than background color for non-current instruments.
    if(patch!=NULL && patch_used_in_current_editor_block(patch))
      root->song->tracker_windows->must_redraw = true;
    else if (g_currpatch != NULL && patch_used_in_current_editor_block(g_currpatch))
      root->song->tracker_windows->must_redraw = true;
    
    g_currpatch = patch;
    redrawMixerStrips(false);

  }
  //exit:
  called_from_pp_update = false;
}
Exemplo n.º 7
0
static int time_to_frame(Data *data, double time, float f_note_num){

  int i_note_num = (int)f_note_num;
  
  const Sample *sample=NULL;
  int samplenum = 0;
  
  const Note *note=&data->notes[(int)i_note_num];
  
  for(;;){
    sample = note->samples[samplenum];
    if (sample!=NULL)
      break;
    
    samplenum++;
    if (samplenum==note->num_samples) {
      RError("samplenum==num_samples. %f\n",f_note_num);
      return data->startpos*sample->num_frames + time/30000.0f;
    }
  }
  

  double src_ratio = RT_get_src_ratio2(data, sample, f_note_num);

  return
    data->startpos*sample->num_frames 
    + time/src_ratio ;
}
Exemplo n.º 8
0
static void set_new_position(struct Tracks *track, struct Notes *note, Place *start, Place *end){

  bool has_lock = PLAYER_current_thread_has_lock();

  if (track==NULL && has_lock)
    RError("track==NULL && has_lock");
  
  if (track!=NULL) {
    if (has_lock==false)
      PLAYER_lock();
    ListRemoveElement3(&track->notes, &note->l);
  }

  if (start!=NULL && start!=&note->l.p)
    note->l.p = *start;

  if (end!=NULL && end!=&note->end)
    note->end = *end;

  if (track!=NULL){
    ListAddElement3(&track->notes, &note->l);
    if (has_lock==false)
      PLAYER_unlock();
  }
}
Exemplo n.º 9
0
void OS_tfree(void *element){
	struct GC_AllocedMemoryHeader *gc_am=GC_AM;
	struct GC_AllocedMemoryHeader *temp=NULL;

//	fprintf(stderr,"about to free\n");

	while(gc_am!=(void *)(((char *)(element))-sizeof(struct GC_AllocedMemoryHeader))){
		temp=gc_am;
		gc_am=gc_am->next;
		if(gc_am==NULL){
			RError("Error. Element %x, was not in allocated list. Can't free\n",element);
			return;
		}
	}

	if(temp==NULL){
		GC_AM=gc_am->next;
	}else{
		temp->next=gc_am->next;
	}

	FreeMem(gc_am,gc_am->size);

//	fprintf(stderr,"freeing successful\n");
}
Exemplo n.º 10
0
char *GFX_ReadStringFromPythonCommand(char *pythoncommand){
  FILE *file;
  char filename[50];
  char temp[strlen(pythoncommand)+500];
  char *ret=talloc_atomic(strlen(pythoncommand)+500);
  ret[0] = '\0';

  sprintf(filename,"/tmp/radiumipctempfileXXXXXX");
  int x1 = mkstemp(filename);
  (void)x1;

  sprintf(temp,pythoncommand,filename);


  PyRun_SimpleString(temp);


  file=fopen(filename,"r");
  if(file==NULL) {
    RError("GFX_ReadStringFromPythonCommand: File is null -%s-.\n",filename);
    return ret;
  }

  void* x2 = fgets(ret,strlen(pythoncommand)+499,file);
  fclose(file);
  (void)x2;

  printf("Tried to read -%s-\n",ret);
  sprintf(temp,"rm %s",filename);
  if(system(temp)==-1)
    RWarning("Unable to delete \"%s\"",filename);
  
  return ret;
}
Exemplo n.º 11
0
static const char *get_effect_name(struct SoundPlugin *plugin, int effect_num){
  switch(effect_num){
  case EFF_STARTPOS:
    return "Start Position";
  case EFF_FINETUNE:
    return "Finetune";
  case EFF_A:
    return "Attack";
  case EFF_H:
    return "Hold";
  case EFF_D:
    return "Decay";
  case EFF_S:
    return "Sustain";
  case EFF_R:
    return "Release";
  case EFF_NOTE_ADJUST:
    return "Note adjustment";
#if 0
  case EFF_OCTAVE_ADJUST:
    return "Octave adjustment";      
#endif
  case EFF_LOOP_ONOFF:
    return "Loop";
  case EFF_CROSSFADE_LENGTH:
    return "Crossfade";

  default:
    RError("Unknown effect number %d\n",effect_num);
    return NULL;
  }
}
Exemplo n.º 12
0
static void put_hash(hash_t *hash, const char *key, int i, hash_t *val){
  if (val==NULL){
    RError("put_hash: val==NULL. key: %s, i: %d\n", key, i);
    return;
  }

  put_dyn(hash, key, i, DYN_create_hash(val));
}
Exemplo n.º 13
0
// must keep order
void VECTOR_remove(vector_t *v, const void *element){
  int pos=VECTOR_find_pos(v,element);
  if(pos==-1){
    RError("Element %p not found in vector %p\n",element,v);
    return;
  }
  VECTOR_delete(v,pos);
}
Exemplo n.º 14
0
static int64_t RT_scheduled_glide_pitch(struct SeqTrack *seqtrack, int64_t time, union SuperType *args){
  const struct SeqBlock   *seqblock  = args[0].const_pointer;
  const struct Tracks     *track     = args[1].const_pointer;
  const struct Notes      *note      = args[2].pointer;
  const struct Pitches *pitch1 = args[3].pointer;
  int64_t                  time1     = args[4].int_num;
  int64_t                  time2     = args[5].int_num;
  bool                     doit      = args[6].bool_num;

  struct Patch *patch = track->patch;

  if (patch==NULL)
    return DONT_RESCHEDULE;

#if !defined(RELEASE)
  if (time < time1 || time>time2)
    RError("RT_scheduled_glide_pitch: time: %d, time1: %d, time2: %d", time, time1, time2);
#endif
  
  if (time < time1)
    time = time1;
  if (time > time2)
    time = time2;

  const struct Pitches *pitch2 = pitch1==NULL ? note->pitches : NextPitch(pitch1);

  if (doit) {
    float val1 = pitch1==NULL ? note->note      : pitch1->note;
    float val2 = pitch2==NULL ? note->pitch_end : pitch2->note;
    
    float val = time1==time2 ? val2 : scale(time, time1, time2, val1, val2); // We get divide by zero in scale() if time1==time2
    
#if DO_DEBUG
    printf("  Sending pitch %f at %d\n",val,(int)time);
#endif

    if (time==time1 || val1!=val2)
      RT_PATCH_change_pitch(seqtrack,
                            patch,
                            create_note_t2(seqblock,note->id, val),
                            time
                            );
  }
  
  if (time >= time2) {
    
    if (pitch2 != NULL)
      RT_schedule_pitch(seqtrack, time, seqblock, track, note, pitch2, true);
    
    return DONT_RESCHEDULE;
    
  } else {

    return R_MIN(time2, time + RADIUM_BLOCKSIZE);
    
  }
}
Exemplo n.º 15
0
void *ListFindElementP(struct ListHeaderP *list,NInt num){

	while(list!=NULL && list->time<=num){
		if(list->time==num) return list;
		list=list->next;
	}

	RError("Warning. In function 'ListFindElementP' in file 'list.c'. Could not find element %d.\n",num);
	return NULL;
}
Exemplo n.º 16
0
static int get_effect_num(struct SoundPlugin *plugin, const char *effect_name){
  int i;
  for(i=0;i<EFF_NUM_EFFECTS;i++)
    if(!strcmp(effect_name,get_effect_name(plugin,i)))
      return i;

  RError("Unknown effect name \"%s\"",effect_name);

  return 0;
}
Exemplo n.º 17
0
void CutNoteAt(struct Blocks *block, struct Tracks *track,struct Notes *note, Place *place){

  R_ASSERT(PLAYER_current_thread_has_lock() || is_playing()==false);
          
  if (PlaceGreaterOrEqual(place, &note->end)){
    RError("Illegal argument for CutNoteAt 1. %f >= %f\n",GetfloatFromPlacement(place),GetfloatFromPlacement(&note->end));
    return;
  }
  
  if (PlaceLessOrEqual(place, &note->l.p)){
    RError("Illegal argument for CutNoteAt 2. %f <= %f\n",GetfloatFromPlacement(place),GetfloatFromPlacement(&note->l.p));
    return;
  }
  
  CutListAt(&note->velocities,place);
  CutListAt(&note->pitches,place);
  PlaceCopy(&note->end,place);

}
Exemplo n.º 18
0
void GFX_Point(
               struct Tracker_Windows *window,
               int color,
               int brightness,
               int x,int y,
               int where
               )
{
  if(where==PAINT_DIRECTLY){
    RError("GFX_Point can not be called with where==PAINT_DIRECTLY");
    return;
  }

  if(color>=16 || color<0){
    RError("Illegal color: %d",color);
    color = R_ABS(color) % 16;
  }

  brightness = R_BOUNDARIES(0, brightness, MAX_BRIGHTNESS);

#if 0
  OS_GFX_Point(window,color,brightness,x,y,where);
  return;
#endif

  struct Points *point=points[color][brightness];
  if(point==NULL)
    points[color][brightness] = point = calloc(1,sizeof(struct Points));

  int pos = point->pos;

  if(point->pos==point->size){
    point->size = R_MAX(128,point->size*2);
    point->x=realloc(point->x,point->size*sizeof(uint16_t));
    point->y=realloc(point->y,point->size*sizeof(uint16_t));
  }

  point->x[pos] = x;
  point->y[pos] = y;
  point->pos = pos+1;

  is_dirty=true;
}
Exemplo n.º 19
0
static float get_effect_value(struct SoundPlugin *plugin, int effect_num, enum ValueFormat value_format){
  Data *data = (Data*)plugin->data;
  //int val;

  if(value_format==PLUGIN_FORMAT_SCALED){
    switch(effect_num){
    case EFF_PITCH:
      //fluid_synth_get_pitch_bend(data->synth,0,&val);
      return scale(data->pitch,0,16383,0.0f,1.0f);
    case EFF_PITCH_RANGE:
      //fluid_synth_get_pitch_wheel_sens(data->synth,0,&val);
      return scale(data->pitch_range,1,48,0.0f,1.0f);
    case EFF_MODULATION:
      //fluid_synth_get_cc(data->synth,0,1,&val);
      return data->modulation / 127.0;
    case EFF_SUSTAIN_PEDAL:
      //fluid_synth_get_cc(data->synth,0,64,&val);
      return data->sustain_on / 127.0;
    default:
      RError("Unknown effect number %d\n",effect_num);
    }
  }else{
    switch(effect_num){
    case EFF_PITCH:
      //fluid_synth_get_pitch_bend(data->synth,0,&val);
      return data->pitch;
    case EFF_PITCH_RANGE:
      //fluid_synth_get_pitch_wheel_sens(data->synth,0,&val);
      return data->pitch_range;
    case EFF_MODULATION:
      //fluid_synth_get_cc(data->synth,0,1,&val);
      return data->modulation;
    case EFF_SUSTAIN_PEDAL:
      //fluid_synth_get_cc(data->synth,0,64,&val);
      return data->sustain_on;
    default:
      RError("Unknown effect number %d\n",effect_num);
    }
  }

  return 0.0f;
}
Exemplo n.º 20
0
static int get_effect_num(const struct SoundPluginType *plugin_type, const char *effect_name){
  Data *data = (Data*)plugin_type->data;
  Voice *voice = &data->voices[0];
  for(unsigned int i=0;i<voice->myUI._controllers.size();i++){
    MyUI::Controller *controller = &voice->myUI._controllers.at(i);
    if(!strcmp(controller->name.c_str(),effect_name))
      return i;
  }
  RError("Couldn't find effect name \"%s\" in plugin %s/%s\n",plugin_type->type_name,plugin_type->name);
  return 0;
}
Exemplo n.º 21
0
static const ColorConfig get_color_config(enum ColorNums colornum){
  int i=0;
  while(g_colorconfig[i].num != END_CONFIG_COLOR_NUM){
    if (g_colorconfig[i].num==colornum)
      return g_colorconfig[i];
    i++;
  }

  RError("Unknown color %s", colornum);
  return g_colorconfig[0];
}
Exemplo n.º 22
0
void NOTE_validate(const struct Blocks *block, struct Tracks *track, struct Notes *note){
  R_ASSERT_RETURN_IF_FALSE(block!=NULL);
  R_ASSERT_RETURN_IF_FALSE(note!=NULL);

  R_ASSERT(track==NULL || PLAYER_current_thread_has_lock() || is_playing()==false);
  
  if (note->note<=0.0f){
    RError("notenum<=0.0f: %f. Setting to 0.01",note->note);
    note->note=0.01f;
  }
  if(note->note>=128.0f){
    RError("notenum>=128.0f: %f. Setting to 127.99",note->note);
    note->note=127.99;
  }

  set_legal_start_and_end_pos(block, track, note);

  ValidatePlace(&note->l.p);
  ValidatePlace(&note->end);
}
Exemplo n.º 23
0
static hash_t *get_hash(const hash_t *hash, const char *key, int i){
  hash_element_t *element = HASH_get(hash,key,i,HASH_TYPE);
  if(element==NULL)
    return NULL;
  
  if (element->a.hash==NULL){
    RError("element->hash==NULL. key: %s, i: %d\n", key, i);
    return HASH_create(1);
  }
  
  return element->a.hash;
}
Exemplo n.º 24
0
void InsertCoordinatesForThisNoteLines(
	struct Tracker_Windows *window,
	struct WTracks *wtrack,
	int realline,
	struct TrackReallineElements *element
){
	int velend=0;
	struct TrackReallineElements *temp=wtrack->trackreallines[realline].trackreallineelements;

   /****************************************************************
     First find a suitable TRE_VELLINE element related to this note.
	 ****************************************************************/
	for(;;){
		if(temp==NULL){
			RError("Error in function 'InsertCoordinatesForThisNoteLines' in file 'trackreallines.c %x'\n",wtrack->trackreallines[realline].trackreallineelements);
			temp=wtrack->trackreallines[realline].trackreallineelements;
			break;
		}
		if(temp->pointer==element->pointer){
			if(temp->type==TRE_VELLINE &&
				(1==velend || (
					temp->y2 >= 0.5f &&
					temp->y1 <= 0.5f
			)))break;

			if(
				0==velend &&
				(temp->type==TRE_VELLINEEND || temp->type==TRE_VELLINESTART)
			){
				temp=wtrack->trackreallines[realline].trackreallineelements;
				velend=1;
				continue;
			}
		}
		temp=temp->next;
	}


	/****************************************************************
	  Then use the coordinates for that TRE_VELLINE element to
	  calculate the coordinates for the TRE_THISNOTELINES element.
	 ****************************************************************/
	element->x1=0;
	element->y1=0.5f;

	element->x2=(temp->x1+temp->x2)/2;
	element->y2=(temp->y1+temp->y2)/2;
	element->subtype=temp->subtype;

	wtrack->trackreallines[realline].note=((struct Notes *)(element->pointer))->note;
	wtrack->trackreallines[realline].dasnote=(struct Notes *)element->pointer;
}
Exemplo n.º 25
0
static void recreate_from_state(struct SoundPlugin *plugin, hash_t *state){
  const wchar_t *filename          = HASH_get_string(state, "filename");
  int            instrument_number = HASH_get_int(state, "instrument_number");
  int            resampler_type    = HASH_get_int(state, "resampler_type");

  if(filename==NULL){
    RError("filename==NULL");
    return;
  }

  if(set_new_sample(plugin,filename,instrument_number,resampler_type)==false)
    RWarning("Could not load soundfile \"%s\". (instrument number: %d)\n",STRING_get_chars(filename),instrument_number);
}
Exemplo n.º 26
0
void PR_add_plugin_type_no_menu(SoundPluginType *type){
  if(type->name==NULL || type->type_name==NULL)
    RError("Can not be null. type_name: %s, name: %s\n",type->type_name,type->name);
  
  if(!strcmp(type->type_name,"Faust") && !strcmp(type->name,"Zita Reverb"))
    type->info = "Zita Reverb is a reverb designed by Fons Adriaensen.\n"
      "The Faust version is implemented by Julius O. Smith III.\n"
      "\n"
      "Julius O. Smith III writes: "
      "\"Internal 8x8 late-reverberation FDN used in the FOSS Linux reverb zita-rev1 "
      "by Fons Adriaensen <*****@*****.**>.  This is an FDN reverb with "
      "allpass comb filters in each feedback delay in addition to the "
      "damping filters.\"\n"
      "\n"
      "Note that both the original version of Zita Reverb, and the Faust version (which the Radium version is based on), "
      "have two additional equalizers plus a slider to adjust dry/wet. "
      "These controllers are not needed, and have been removed, since Radium provides this functionality for all audio instruments and audio effects.\n"
      ;

  if(!strcmp(type->type_name,"Faust") && !strcmp(type->name,"Multiband Compressor"))
    type->info =
      "Multiband compression makes the spectrum of a sound more audible. "
      "Multiband compression is normally performed as the last step in the mix of a piece, applied after the final equalization. "
      "\n\n"
      "This Multiband Compressor is assembled using various audio signal processing bricks implemented by Julius O. Smith III in the Faust language (http://faust.grame.fr). "
      "Homepage of Julius O. Smith III is https://ccrma.stanford.edu/~jos/"
      "\n\n"
      "First the separate bands are created using Butterworth band-splits. Then each band is sent through a standard compressor."
      "Finally, the three bands are mixed together and sent through a limiter."
      ;
      
      

  if(!strcmp(type->type_name,"Faust") && type->name[0]=='S' && type->name[1]=='T' && type->name[2]=='K')
    type->info = 
      "The FAUST Synthesis ToolKit is a set virtual musical instruments written in the FAUST "
      "programming language and based on waveguide algorithms and modal synthesis. Most of them "
      "were inspired by instruments implemented in the Synthesis ToolKit and the program SynthBuilder.\n"
      "\n"
      "The STK is developed since 1996 by P. R. Cook and G. P. Scavone. It is a set of open  "
      "source audio signal processing and algorithmic synthesis classes written in the C++ programming "
      "language that can be used in the development of music synthesis and audio processing "
      "software (https://ccrma.stanford.edu/software/stk/).\n"
      "\n"
      "Romain Michon";

  if(!strcmp(type->type_name,"Faust") && !strcmp(type->name,"Tapiir"))
    type->info = "The tapiir program is a multitap delay program. It has a stereo input and a stereo output. Each channel of the stereo signal is sent to 6 independant delays, not necessarily with the same gain for each delay. Then, each delay output is sent to the 5 other delay input, and also to its own input (to provide feedback possibilities), and all volumes can be changed independantly. Finally, each delay output, and each input of the tapiir is connected to both channels of the stereo output of the tapiir, still with configurable volumes. A wide range of effect can be constructed out of this complex system of delays (feedback, echos, filters). (This text is copied from http://faust.grame.fr)\n\nThe first Tapiir was made by Maarten de Boer's. This Faust version is implemented by the Faust team.";

  g_plugin_types.add(type);
}
Exemplo n.º 27
0
static void get_display_value_string(SoundPlugin *plugin, int effect_num, char *buffer, int buffersize){
  Data *data = (Data*)plugin->data;
  switch(effect_num){
  case EFF_STARTPOS:
    snprintf(buffer,buffersize-1,"%.2f%%",scale(data->startpos,0.0,1.0,0,100));
    break;
  case EFF_FINETUNE:
    snprintf(buffer,buffersize-1,"%f cents",scale(data->finetune,0.0,1.0,-100,100));
    break;
  case EFF_A:
    snprintf(buffer,buffersize-1,"%f ms",data->a);
    break;
  case EFF_H:
    snprintf(buffer,buffersize-1,"%f ms",data->h);
    break;
  case EFF_D:
    snprintf(buffer,buffersize-1,"%f ms",data->d);
    break;
  case EFF_S:
    snprintf(buffer,buffersize-1,"%f",data->s);
    break;
  case EFF_R:
    snprintf(buffer,buffersize-1,"%f ms",data->r);
    break;
  case EFF_NOTE_ADJUST:
    if(false && data->num_different_samples>1)
      snprintf(buffer,buffersize-1,"disabled (multi-sample instrument)");
    else{
      int adjust = data->note_adjust;
      snprintf(buffer,buffersize-1,"%s%d note%s",adjust>0?"+":"",adjust,adjust==-1?"":adjust==1?"":"s");
    }
    break;
#if 0
  case EFF_OCTAVE_ADJUST:
    if(false && data->num_different_samples>1)
      snprintf(buffer,buffersize-1,"disabled (multi-sample instrument)");
    else{
      int adjust=data->octave_adjust;
      snprintf(buffer,buffersize-1,"%s%d octave%s",adjust>0?"+":"",adjust,adjust==-1?"":adjust==1?"":"s");
    }
    break;
#endif
  case EFF_CROSSFADE_LENGTH:
    snprintf(buffer,buffersize-1,"%d samples",(int)data->crossfade_length);
    break;

  default:
    RError("Unknown effect number %d\n",effect_num);
  }
}
Exemplo n.º 28
0
bool InitClock(void){
#ifdef _AMIGA
	clocksig=AllocSignal(-1);
	if(clocksig==-1){
		RError("Could not allocate signal\n");
		return false;
	}
#endif

//	ClockSemaphore=NewRSemaphore();
//	if(ClockSemaphore==NULL) return false;

	return true;
}
Exemplo n.º 29
0
bool CB_PasteTrack(
	struct WBlocks *wblock,
	struct WTracks *wtrack,
	struct WTracks *towtrack
){
	struct Tracks *totrack;
	struct Tracks *track;
	Place *p1,p2;

	if(towtrack==NULL){
		RError("Error in function CB_PasteTrack in file clipboard_track_paste.c; towtrack=NULL\n");
		return false;
	}

	totrack=towtrack->track;
	track=wtrack->track;

	towtrack->notelength=wtrack->notelength;
	towtrack->fxwidth=wtrack->fxwidth;

	totrack->patch=track->patch;
	totrack->onoff=track->onoff;
	totrack->pan=track->pan;
	totrack->volume=track->volume;
	totrack->panonoff=track->panonoff;
	totrack->volumeonoff=track->volumeonoff;

	if(track->midi_instrumentdata!=NULL){
          totrack->midi_instrumentdata=MIDI_CopyInstrumentData(track);
	}

	totrack->trackname=talloc_strdup(track->trackname);

	totrack->notes=NULL;
	totrack->stops=NULL;
	totrack->fxs=NULL;

	p1=PlaceGetFirstPos();
	PlaceSetLastPos(wblock->block,&p2);

	CopyRange_notes(&totrack->notes,track->notes,p1,&p2);
	CopyRange_stops(&totrack->stops,track->stops,p1,&p2);
	CopyRange_fxs(&totrack->fxs,track->fxs,p1,&p2);

	LegalizeFXlines(wblock->block,totrack);
	LegalizeNotes(wblock->block,totrack);

	return true;
}
Exemplo n.º 30
0
static dynvec_t get_array(const hash_t *hash, const char *key, int i){
  hash_element_t *element = HASH_get(hash,key,i,ARRAY_TYPE);
  if(element==NULL){
    dynvec_t ret = {0};
    return ret;
  }

  if (element->a.array==NULL){
    RError("element->array==NULL. key: %s, i: %d\n", key, i);
    dynvec_t ret = {0};
    return ret;
  }
  
  return *element->a.array;
}